From 21f49bbc6cd0d4b350a68eabd8c79cb32b310658 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Wed, 3 Jan 2024 11:00:11 +0200 Subject: [PATCH] [angular-16-irish-monitor | FIXED | DONE]: Manage stakeholders retrieve types from configuration. --- .../manageStakeholders.component.ts | 26 +++---------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/monitor-admin/manageStakeholders/manageStakeholders.component.ts b/monitor-admin/manageStakeholders/manageStakeholders.component.ts index 76781fc4..e1479b01 100644 --- a/monitor-admin/manageStakeholders/manageStakeholders.component.ts +++ b/monitor-admin/manageStakeholders/manageStakeholders.component.ts @@ -35,14 +35,8 @@ export class ManageStakeholdersComponent extends StakeholderBaseComponent implem public tab: Tab = 'all'; public currentPage: number = 1; public currentTemplatesPage: number = 1; - public pageSize: number = 10; - public typeOptions: Option[] = [ - {value: 'all', label: 'All'}, - {value: 'country', label: 'National'}, - {value: 'organization', label: 'RPO'}, - {value: 'funder', label: 'RFO'}, - {value: 'datasource', label: 'Repository Monitor'}, - ]; + public pageSize: number = 15; + public typeOptions: Option[]; /** * Filtered Stakeholders */ @@ -52,11 +46,6 @@ export class ManageStakeholdersComponent extends StakeholderBaseComponent implem * Top filters */ public filters: UntypedFormGroup; - public all: Option = { - value: 'all', - label: 'All' - }; - public callback: Function; /** @@ -76,6 +65,7 @@ export class ManageStakeholdersComponent extends StakeholderBaseComponent implem } ngOnInit(): void { + this.typeOptions = [{value: 'all', label: 'All'}].concat(this.stakeholderUtils.types); this.buildFilters(); this.title = 'Manage Profiles'; this.setMetadata(); @@ -120,16 +110,6 @@ export class ManageStakeholdersComponent extends StakeholderBaseComponent implem })); } - // onStatusChange(value) { - // this.displayDefaultStakeholders = this.filterStatus(this.defaultStakeholders, value); - // this.displayStakeholders = this.filterStatus(this.stakeholders, value); - // } - - // onKeywordChange(value) { - // this.displayDefaultStakeholders = this.filterByKeyword(this.defaultStakeholders, value); - // this.displayStakeholders = this.filterByKeyword(this.stakeholders, value); - // } - private filterByStatus(stakeholders: Stakeholder[], value): Stakeholder[] { if (value === 'all') { return stakeholders;