2019-01-18 18:03:45 +01:00
|
|
|
import { Component, OnInit } from '@angular/core';
|
2023-04-26 16:25:59 +02:00
|
|
|
import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
|
2023-05-02 12:48:07 +02:00
|
|
|
import { Router } from '@angular/router';
|
2023-10-18 09:31:57 +02:00
|
|
|
import { SupportiveMaterialFieldType } from '@app/core/common/enum/supportive-material-field-type';
|
2023-04-26 16:25:59 +02:00
|
|
|
import { LanguageService } from '@app/core/services/language/language.service';
|
2020-12-14 18:28:13 +01:00
|
|
|
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
2023-10-18 09:31:57 +02:00
|
|
|
import { SupportiveMaterialService } from '@app/core/services/supportive-material/supportive-material.service';
|
2023-04-26 16:25:59 +02:00
|
|
|
import { BaseComponent } from '@common/base/base.component';
|
2023-05-02 12:48:07 +02:00
|
|
|
import { TranslateService, LangChangeEvent } from '@ngx-translate/core';
|
2023-04-26 16:25:59 +02:00
|
|
|
import { takeUntil } from 'rxjs/operators';
|
2019-01-18 18:03:45 +01:00
|
|
|
|
|
|
|
@Component({
|
2020-12-14 18:28:13 +01:00
|
|
|
selector: 'app-about-componet',
|
|
|
|
templateUrl: './about.component.html',
|
|
|
|
styleUrls: ['./about.component.scss']
|
2019-01-18 18:03:45 +01:00
|
|
|
})
|
2023-04-26 16:25:59 +02:00
|
|
|
export class AboutComponent extends BaseComponent implements OnInit {
|
|
|
|
|
|
|
|
aboutHTMLUrl: SafeResourceUrl;
|
|
|
|
sanitizedGuideUrl: any;
|
2019-01-18 18:03:45 +01:00
|
|
|
|
2020-12-14 18:28:13 +01:00
|
|
|
constructor(
|
2023-10-18 09:31:57 +02:00
|
|
|
private supportiveMaterialService: SupportiveMaterialService,
|
2023-04-26 16:25:59 +02:00
|
|
|
private sanitizer: DomSanitizer,
|
|
|
|
private languageService: LanguageService,
|
2023-05-02 12:48:07 +02:00
|
|
|
private matomoService: MatomoService,
|
|
|
|
private translate: TranslateService,
|
|
|
|
private router: Router
|
2023-04-26 16:25:59 +02:00
|
|
|
) { super(); }
|
2019-01-18 18:03:45 +01:00
|
|
|
|
2020-12-14 18:28:13 +01:00
|
|
|
ngOnInit() {
|
|
|
|
this.matomoService.trackPageView('About');
|
2023-05-02 12:48:07 +02:00
|
|
|
this.translate.onLangChange.subscribe((event: LangChangeEvent) => {
|
|
|
|
this.router.navigate(['/reload'], { skipLocationChange: true }).then(() => this.router.navigate(['/about']));
|
|
|
|
});
|
2023-11-03 12:30:11 +01:00
|
|
|
this.supportiveMaterialService.getMaterial(this.languageService.getCurrentLanguage(), SupportiveMaterialFieldType.About)
|
2023-04-26 16:25:59 +02:00
|
|
|
.pipe(takeUntil(this._destroyed))
|
|
|
|
.subscribe(response => {
|
|
|
|
const blob = new Blob([response.body], { type: 'text/html' });
|
|
|
|
this.aboutHTMLUrl = this.sanitizer.bypassSecurityTrustResourceUrl((window.URL ? URL : webkitURL).createObjectURL(blob));
|
|
|
|
});
|
2020-12-14 18:28:13 +01:00
|
|
|
}
|
2019-01-18 18:03:45 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|