2022-07-27 11:34:10 +02:00
|
|
|
import {Component, OnDestroy, OnInit} from '@angular/core';
|
2022-06-16 16:54:50 +02:00
|
|
|
import {ValidatorFn, Validators} from "@angular/forms";
|
|
|
|
import {StringUtils} from "../string-utils.class";
|
2022-07-27 11:34:10 +02:00
|
|
|
import {ActivatedRoute} from "@angular/router";
|
|
|
|
import {Subscriber} from "rxjs";
|
2023-10-05 15:59:41 +02:00
|
|
|
import {OpenaireEntities} from "../properties/searchFields";
|
2020-06-03 11:49:18 +02:00
|
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'theme',
|
|
|
|
templateUrl: 'theme.component.html',
|
|
|
|
})
|
|
|
|
|
2022-07-27 11:34:10 +02:00
|
|
|
export class ThemeComponent implements OnInit, OnDestroy {
|
2022-06-16 16:54:50 +02:00
|
|
|
url: string = 'https://example.com';
|
|
|
|
logoURL: string = 'https://example.com/test.png';
|
2022-07-27 11:34:10 +02:00
|
|
|
parentClass: string;
|
|
|
|
private subscriptions: any[] = [];
|
2022-06-16 16:54:50 +02:00
|
|
|
required: ValidatorFn = Validators.required;
|
|
|
|
urlValidator: ValidatorFn = StringUtils.urlValidator;
|
2022-07-27 11:34:10 +02:00
|
|
|
|
|
|
|
constructor(private route: ActivatedRoute) {
|
|
|
|
}
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
this.subscriptions.push(this.route.queryParams.subscribe(params => {
|
|
|
|
if(params['parentClass']) {
|
|
|
|
this.parentClass = params['parentClass'];
|
|
|
|
}
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
|
|
|
|
ngOnDestroy() {
|
|
|
|
this.subscriptions.forEach(value => {
|
|
|
|
if (value instanceof Subscriber) {
|
|
|
|
value.unsubscribe();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2023-10-05 15:59:41 +02:00
|
|
|
|
|
|
|
protected readonly OpenaireEntities = OpenaireEntities;
|
2020-06-03 11:49:18 +02:00
|
|
|
}
|