-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(FAQ): Extract common code to parent
- Loading branch information
1 parent
2a75a5a
commit 80ba308
Showing
14 changed files
with
638 additions
and
670 deletions.
There are no files selected for viewing
1 change: 0 additions & 1 deletion
1
...lp/student-faq/student-faq.component.scss → src/app/help/faq/faq.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
.title-icon { | ||
margin-right: 8px; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { Directive, OnInit } from '@angular/core'; | ||
import { ConfigService } from '../../services/config.service'; | ||
import { filter } from 'rxjs'; | ||
|
||
@Directive() | ||
export abstract class FaqComponent implements OnInit { | ||
protected contextPath: string; | ||
|
||
constructor(private configService: ConfigService) { | ||
this.configService | ||
.getConfig() | ||
.pipe(filter((config) => config != null)) | ||
.subscribe((config) => { | ||
this.contextPath = config.contextPath; | ||
}); | ||
} | ||
|
||
ngOnInit(): void {} | ||
|
||
ngAfterViewInit(): void { | ||
document.getElementsByTagName('app-help')[0]?.scrollIntoView(); | ||
} | ||
|
||
protected scrollTo(id: string): void { | ||
document.getElementById(id).scrollIntoView(); | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Component } from '@angular/core'; | ||
import { FaqComponent } from '../faq.component'; | ||
|
||
@Component({ | ||
selector: 'app-student-faq', | ||
templateUrl: './student-faq.component.html', | ||
styleUrls: ['../faq.component.scss'] | ||
}) | ||
export class StudentFaqComponent extends FaqComponent {} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Component } from '@angular/core'; | ||
import { FaqComponent } from '../faq.component'; | ||
|
||
@Component({ | ||
selector: 'app-teacher-faq', | ||
templateUrl: './teacher-faq.component.html', | ||
styleUrls: ['../faq.component.scss'] | ||
}) | ||
export class TeacherFaqComponent extends FaqComponent {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.