openaire-library/monitor-admin/utils/stakeholder-base.component.ts

44 lines
1.2 KiB
TypeScript
Raw Normal View History

import {Directive} from "@angular/core";
import {BaseComponent} from "../../sharedComponents/base/base.component";
import {IndicatorUtils, StakeholderUtils} from "./indicator-utils";
@Directive()
export abstract class StakeholderBaseComponent extends BaseComponent {
stakeholderUtils: StakeholderUtils = new StakeholderUtils();
get entities() {
return this.stakeholderUtils.entities;
}
get showVisibility() {
return this.stakeholderUtils.showField(this.stakeholderUtils.visibilities);
}
get showType() {
return this.stakeholderUtils.showField(this.stakeholderUtils.types);
}
get showFunderType() {
return this.stakeholderUtils.showField(this.stakeholderUtils.funderTypes);
}
getFunderTypeLabel(value: any) {
return this.stakeholderUtils.getLabel(this.stakeholderUtils.funderTypes, value);
}
get showLocale() {
return this.stakeholderUtils.showField(this.stakeholderUtils.locales);
}
protected navigateToError() {
this._router.navigate([this.properties.errorLink], {queryParams: {'page': this._router.url}});
}
}
@Directive()
export abstract class IndicatorStakeholderBaseComponent extends StakeholderBaseComponent {
indicatorUtils: IndicatorUtils = new IndicatorUtils();
}