From 0573f4217ba772ddbaffbf3c004023a5c04ec36a Mon Sep 17 00:00:00 2001 From: Sanjay Babu Date: Fri, 29 Sep 2023 15:26:22 -0700 Subject: [PATCH] issuing agency replaced with api call --- .../administrative-sanction-add-edit.component.ts | 6 ++++-- .../administrative-sanction-detail.component.ts | 5 +++-- .../annual-report-add-edit.component.ts | 6 ++++-- .../annual-report-detail.component.ts | 5 +++-- .../certificate-amendments-add-edit.component.ts | 6 ++++-- .../certificate-amendments-detail.component.ts | 5 +++-- .../certificate-add-edit.component.ts | 6 ++++-- .../certificate-detail/certificate-detail.component.ts | 5 +++-- .../construction-plan-add-edit.component.ts | 6 ++++-- .../construction-plan-detail.component.ts | 5 +++-- .../correspondence-add-edit.component.ts | 6 ++++-- .../correspondence-detail.component.ts | 5 +++-- .../court-conviction-add-edit.component.ts | 6 ++++-- .../court-conviction-detail.component.ts | 5 +++-- .../dam-safety-inspection-add-edit.component.ts | 6 ++++-- .../dam-safety-inspection-detail.component.ts | 5 +++-- .../inspection-add-edit.component.ts | 8 +++++--- .../management-plan-add-edit.component.ts | 6 ++++-- .../management-plan-detail.component.ts | 10 +++++++--- .../permit-add-edit/permit-add-edit.component.ts | 6 ++++-- .../report-add-edit/report-add-edit.component.ts | 6 ++++-- .../reports/report-detail/report-detail.component.ts | 5 +++-- .../restorative-justice-add-edit.component.ts | 6 ++++-- .../restorative-justice-detail.component.ts | 5 +++-- 24 files changed, 90 insertions(+), 50 deletions(-) diff --git a/angular/projects/admin-nrpti/src/app/records/administrative-sanctions/administrative-sanction-add-edit/administrative-sanction-add-edit.component.ts b/angular/projects/admin-nrpti/src/app/records/administrative-sanctions/administrative-sanction-add-edit/administrative-sanction-add-edit.component.ts index c6cc1b37a..f6b1b280e 100644 --- a/angular/projects/admin-nrpti/src/app/records/administrative-sanctions/administrative-sanction-add-edit/administrative-sanction-add-edit.component.ts +++ b/angular/projects/admin-nrpti/src/app/records/administrative-sanctions/administrative-sanction-add-edit/administrative-sanction-add-edit.component.ts @@ -10,6 +10,7 @@ import { Utils as CommonUtils } from '../../../../../../common/src/app/utils/uti import { RecordUtils } from '../../utils/record-utils'; import { LoadingScreenService, LoggerService } from 'nrpti-angular-components'; import { Constants } from '../../../utils/constants/misc'; +import { AgencyDataService } from '../../../../../../../projects/global/src/lib/utils/agency-data-service'; @Component({ selector: 'app-administrative-sanction-add-edit', @@ -32,7 +33,7 @@ export class AdministrativeSanctionAddEditComponent implements OnInit, OnDestroy public nrcedPublishSubtext = 'Not published'; // Pick lists - public agencies = Picklists.agencyPicklist; + public agencies = Picklists.agencyCodePicklist; public authors = Picklists.authorPicklist; private defaultAgency = ''; @@ -546,7 +547,8 @@ export class AdministrativeSanctionAddEditComponent implements OnInit, OnDestroy } displayName(agency) { - return Utils.displayNameFull(agency); + const agencyDataService = new AgencyDataService(this.factoryService); + return agencyDataService.displayNameFull(agency); } cancel() { diff --git a/angular/projects/admin-nrpti/src/app/records/administrative-sanctions/administrative-sanction-detail/administrative-sanction-detail.component.ts b/angular/projects/admin-nrpti/src/app/records/administrative-sanctions/administrative-sanction-detail/administrative-sanction-detail.component.ts index c51923589..e65052557 100644 --- a/angular/projects/admin-nrpti/src/app/records/administrative-sanctions/administrative-sanction-detail/administrative-sanction-detail.component.ts +++ b/angular/projects/admin-nrpti/src/app/records/administrative-sanctions/administrative-sanction-detail/administrative-sanction-detail.component.ts @@ -7,7 +7,7 @@ import { RecordDetailComponent } from '../../utils/record-component'; import { RecordUtils } from '../../utils/record-utils'; import { Utils as CommonUtils } from '../../../../../../common/src/app/utils/utils'; import { FactoryService } from '../../../services/factory.service'; -import { Utils } from 'nrpti-angular-components'; +import { AgencyDataService } from '../../../../../../../projects/global/src/lib/utils/agency-data-service'; @Component({ selector: 'app-administrative-sanction-detail', @@ -60,7 +60,8 @@ export class AdministrativeSanctionDetailComponent extends RecordDetailComponent } displayName(agency) { - return Utils.displayNameFull(agency); + const agencyDataService = new AgencyDataService(this.factoryService); + return agencyDataService.displayNameFull(agency); } navigateToEditPage() { diff --git a/angular/projects/admin-nrpti/src/app/records/annual-reports/annual-report-add-edit/annual-report-add-edit.component.ts b/angular/projects/admin-nrpti/src/app/records/annual-reports/annual-report-add-edit/annual-report-add-edit.component.ts index ddac22488..0bf7fd1b9 100644 --- a/angular/projects/admin-nrpti/src/app/records/annual-reports/annual-report-add-edit/annual-report-add-edit.component.ts +++ b/angular/projects/admin-nrpti/src/app/records/annual-reports/annual-report-add-edit/annual-report-add-edit.component.ts @@ -10,6 +10,7 @@ import { Utils as CommonUtils } from '../../../../../../common/src/app/utils/uti import { RecordUtils } from '../../utils/record-utils'; import { LoadingScreenService, StoreService } from 'nrpti-angular-components'; import { Constants } from '../../../utils/constants/misc'; +import { AgencyDataService } from '../../../../../../../projects/global/src/lib/utils/agency-data-service'; @Component({ selector: 'app-annual-report-add-edit', @@ -30,7 +31,7 @@ export class AnnualReportAddEditComponent implements OnInit, OnDestroy { public bcmiPublishSubtext = 'Not published'; // Pick lists - public agencies = Picklists.agencyPicklist; + public agencies = Picklists.agencyCodePicklist; public datepickerMinDate = Constants.DatepickerMinDate; public datepickerMaxDate = Constants.DatepickerMaxDate; @@ -414,7 +415,8 @@ export class AnnualReportAddEditComponent implements OnInit, OnDestroy { } displayName(agency) { - return Utils.displayNameFull(agency); + const agencyDataService = new AgencyDataService(this.factoryService); + return agencyDataService.displayNameFull(agency); } cancel() { diff --git a/angular/projects/admin-nrpti/src/app/records/annual-reports/annual-report-detail/annual-report-detail.component.ts b/angular/projects/admin-nrpti/src/app/records/annual-reports/annual-report-detail/annual-report-detail.component.ts index ac040825c..c85df69c0 100644 --- a/angular/projects/admin-nrpti/src/app/records/annual-reports/annual-report-detail/annual-report-detail.component.ts +++ b/angular/projects/admin-nrpti/src/app/records/annual-reports/annual-report-detail/annual-report-detail.component.ts @@ -7,7 +7,7 @@ import { RecordDetailComponent } from '../../utils/record-component'; import { RecordUtils } from '../../utils/record-utils'; import { Utils as CommonUtils } from '../../../../../../common/src/app/utils/utils'; import { FactoryService } from '../../../services/factory.service'; -import { Utils } from 'nrpti-angular-components'; +import { AgencyDataService } from '../../../../../../../projects/global/src/lib/utils/agency-data-service'; @Component({ selector: 'app-annual-report-detail', @@ -64,7 +64,8 @@ export class AnnualReportDetailComponent extends RecordDetailComponent implement } displayName(agency) { - return Utils.displayNameFull(agency); + const agencyDataService = new AgencyDataService(this.factoryService); + return agencyDataService.displayNameFull(agency); } ngOnDestroy() { diff --git a/angular/projects/admin-nrpti/src/app/records/certificate-amendments/certificate-amendments-add-edit/certificate-amendments-add-edit.component.ts b/angular/projects/admin-nrpti/src/app/records/certificate-amendments/certificate-amendments-add-edit/certificate-amendments-add-edit.component.ts index 7e97e1672..7ca86b85f 100644 --- a/angular/projects/admin-nrpti/src/app/records/certificate-amendments/certificate-amendments-add-edit/certificate-amendments-add-edit.component.ts +++ b/angular/projects/admin-nrpti/src/app/records/certificate-amendments/certificate-amendments-add-edit/certificate-amendments-add-edit.component.ts @@ -10,6 +10,7 @@ import { Utils as CommonUtils } from '../../../../../../common/src/app/utils/uti import { RecordUtils } from '../../utils/record-utils'; import { LoadingScreenService, StoreService } from 'nrpti-angular-components'; import { Constants } from '../../../utils/constants/misc'; +import { AgencyDataService } from '../../../../../../../projects/global/src/lib/utils/agency-data-service'; @Component({ selector: 'app-certificate-amendment-add-edit', @@ -33,7 +34,7 @@ export class CertificateAmendmentAddEditComponent implements OnInit, OnDestroy { // Pick lists public certificateSubtypes = Picklists.certificateSubtypePicklist; - public agencies = Picklists.agencyPicklist; + public agencies = Picklists.agencyCodePicklist; public datepickerMinDate = Constants.DatepickerMinDate; public datepickerMaxDate = Constants.DatepickerMaxDate; @@ -482,7 +483,8 @@ export class CertificateAmendmentAddEditComponent implements OnInit, OnDestroy { } displayName(agency) { - return Utils.displayNameFull(agency); + const agencyDataService = new AgencyDataService(this.factoryService); + return agencyDataService.displayNameFull(agency); } cancel() { diff --git a/angular/projects/admin-nrpti/src/app/records/certificate-amendments/certificate-amendments-detail/certificate-amendments-detail.component.ts b/angular/projects/admin-nrpti/src/app/records/certificate-amendments/certificate-amendments-detail/certificate-amendments-detail.component.ts index eaa68c522..ac4478584 100644 --- a/angular/projects/admin-nrpti/src/app/records/certificate-amendments/certificate-amendments-detail/certificate-amendments-detail.component.ts +++ b/angular/projects/admin-nrpti/src/app/records/certificate-amendments/certificate-amendments-detail/certificate-amendments-detail.component.ts @@ -7,7 +7,7 @@ import { RecordDetailComponent } from '../../utils/record-component'; import { RecordUtils } from '../../utils/record-utils'; import { Utils as CommonUtils } from '../../../../../../common/src/app/utils/utils'; import { FactoryService } from '../../../services/factory.service'; -import { Utils } from 'nrpti-angular-components'; +import { AgencyDataService } from '../../../../../../../projects/global/src/lib/utils/agency-data-service'; @Component({ selector: 'app-certificate-amendment-detail', @@ -64,7 +64,8 @@ export class CertificateAmendmentDetailComponent extends RecordDetailComponent i } displayName(agency) { - return Utils.displayNameFull(agency); + const agencyDataService = new AgencyDataService(this.factoryService); + return agencyDataService.displayNameFull(agency); } ngOnDestroy() { diff --git a/angular/projects/admin-nrpti/src/app/records/certificates/certificate-add-edit/certificate-add-edit.component.ts b/angular/projects/admin-nrpti/src/app/records/certificates/certificate-add-edit/certificate-add-edit.component.ts index 5950c2b68..70ea1dc4d 100644 --- a/angular/projects/admin-nrpti/src/app/records/certificates/certificate-add-edit/certificate-add-edit.component.ts +++ b/angular/projects/admin-nrpti/src/app/records/certificates/certificate-add-edit/certificate-add-edit.component.ts @@ -10,6 +10,7 @@ import { Utils as CommonUtils } from '../../../../../../common/src/app/utils/uti import { RecordUtils } from '../../utils/record-utils'; import { LoadingScreenService, StoreService, LoggerService } from 'nrpti-angular-components'; import { Constants } from '../../../utils/constants/misc'; +import { AgencyDataService } from '../../../../../../../projects/global/src/lib/utils/agency-data-service'; @Component({ selector: 'app-certificate-add-edit', @@ -31,7 +32,7 @@ export class CertificateAddEditComponent implements OnInit, OnDestroy { // Pick lists public certificateSubtypes = Picklists.certificateSubtypePicklist; - public agencies = Picklists.agencyPicklist; + public agencies = Picklists.agencyCodePicklist; public datepickerMinDate = Constants.DatepickerMinDate; public datepickerMaxDate = Constants.DatepickerMaxDate; @@ -390,7 +391,8 @@ export class CertificateAddEditComponent implements OnInit, OnDestroy { } displayName(agency) { - return Utils.displayNameFull(agency); + const agencyDataService = new AgencyDataService(this.factoryService); + return agencyDataService.displayNameFull(agency); } ngOnDestroy(): void { diff --git a/angular/projects/admin-nrpti/src/app/records/certificates/certificate-detail/certificate-detail.component.ts b/angular/projects/admin-nrpti/src/app/records/certificates/certificate-detail/certificate-detail.component.ts index 298668b27..9e3d02ffb 100644 --- a/angular/projects/admin-nrpti/src/app/records/certificates/certificate-detail/certificate-detail.component.ts +++ b/angular/projects/admin-nrpti/src/app/records/certificates/certificate-detail/certificate-detail.component.ts @@ -7,7 +7,7 @@ import { RecordDetailComponent } from '../../utils/record-component'; import { RecordUtils } from '../../utils/record-utils'; import { Utils as CommonUtils } from '../../../../../../common/src/app/utils/utils'; import { FactoryService } from '../../../services/factory.service'; -import { Utils } from 'nrpti-angular-components'; +import { AgencyDataService } from '../../../../../../../projects/global/src/lib/utils/agency-data-service'; @Component({ selector: 'app-certificate-detail', @@ -64,7 +64,8 @@ export class CertificateDetailComponent extends RecordDetailComponent implements } displayName(agency) { - return Utils.displayNameFull(agency); + const agencyDataService = new AgencyDataService(this.factoryService); + return agencyDataService.displayNameFull(agency); } ngOnDestroy() { diff --git a/angular/projects/admin-nrpti/src/app/records/construction-plans/construction-plan-add-edit/construction-plan-add-edit.component.ts b/angular/projects/admin-nrpti/src/app/records/construction-plans/construction-plan-add-edit/construction-plan-add-edit.component.ts index 39ad0bcb7..23b1814ef 100644 --- a/angular/projects/admin-nrpti/src/app/records/construction-plans/construction-plan-add-edit/construction-plan-add-edit.component.ts +++ b/angular/projects/admin-nrpti/src/app/records/construction-plans/construction-plan-add-edit/construction-plan-add-edit.component.ts @@ -10,6 +10,7 @@ import { Utils as CommonUtils } from '../../../../../../common/src/app/utils/uti import { RecordUtils } from '../../utils/record-utils'; import { LoadingScreenService, StoreService, LoggerService } from 'nrpti-angular-components'; import { Constants } from '../../../utils/constants/misc'; +import { AgencyDataService } from '../../../../../../../projects/global/src/lib/utils/agency-data-service'; @Component({ selector: 'app-construction-plan-add-edit', @@ -30,7 +31,7 @@ export class ConstructionPlanAddEditComponent implements OnInit, OnDestroy { public lngPublishSubtext = 'Not published'; // Pick lists - public agencies = Picklists.agencyPicklist; + public agencies = Picklists.agencyCodePicklist; // Documents public documents = []; @@ -305,7 +306,8 @@ export class ConstructionPlanAddEditComponent implements OnInit, OnDestroy { } displayName(agency) { - return Utils.displayNameFull(agency); + const agencyDataService = new AgencyDataService(this.factoryService); + return agencyDataService.displayNameFull(agency); } cancel() { diff --git a/angular/projects/admin-nrpti/src/app/records/construction-plans/construction-plan-detail/construction-plan-detail.component.ts b/angular/projects/admin-nrpti/src/app/records/construction-plans/construction-plan-detail/construction-plan-detail.component.ts index 4781517cf..9d232f766 100644 --- a/angular/projects/admin-nrpti/src/app/records/construction-plans/construction-plan-detail/construction-plan-detail.component.ts +++ b/angular/projects/admin-nrpti/src/app/records/construction-plans/construction-plan-detail/construction-plan-detail.component.ts @@ -6,7 +6,7 @@ import { ActivatedRoute, Router } from '@angular/router'; import { RecordDetailComponent } from '../../utils/record-component'; import { RecordUtils } from '../../utils/record-utils'; import { FactoryService } from '../../../services/factory.service'; -import { Utils } from 'nrpti-angular-components'; +import { AgencyDataService } from '../../../../../../../projects/global/src/lib/utils/agency-data-service'; @Component({ selector: 'app-construction-plan-detail', @@ -54,7 +54,8 @@ export class ConstructionPlanDetailComponent extends RecordDetailComponent imple } displayName(agency) { - return Utils.displayNameFull(agency); + const agencyDataService = new AgencyDataService(this.factoryService); + return agencyDataService.displayNameFull(agency); } ngOnDestroy() { diff --git a/angular/projects/admin-nrpti/src/app/records/correspondences/correspondence-add-edit/correspondence-add-edit.component.ts b/angular/projects/admin-nrpti/src/app/records/correspondences/correspondence-add-edit/correspondence-add-edit.component.ts index 293090893..3de9d0edc 100644 --- a/angular/projects/admin-nrpti/src/app/records/correspondences/correspondence-add-edit/correspondence-add-edit.component.ts +++ b/angular/projects/admin-nrpti/src/app/records/correspondences/correspondence-add-edit/correspondence-add-edit.component.ts @@ -10,6 +10,7 @@ import { Utils as CommonUtils } from '../../../../../../common/src/app/utils/uti import { RecordUtils } from '../../utils/record-utils'; import { LoadingScreenService, StoreService } from 'nrpti-angular-components'; import { Constants } from '../../../utils/constants/misc'; +import { AgencyDataService } from '../../../../../../../projects/global/src/lib/utils/agency-data-service'; @Component({ selector: 'app-correspondence-add-edit', @@ -32,7 +33,7 @@ export class CorrespondenceAddEditComponent implements OnInit, OnDestroy { public bcmiPublishSubtext = 'Not published'; // Pick lists - public agencies = Picklists.agencyPicklist; + public agencies = Picklists.agencyCodePicklist; // Documents public documents = []; @@ -477,7 +478,8 @@ export class CorrespondenceAddEditComponent implements OnInit, OnDestroy { } displayName(agency) { - return Utils.displayNameFull(agency); + const agencyDataService = new AgencyDataService(this.factoryService); + return agencyDataService.displayNameFull(agency); } cancel() { diff --git a/angular/projects/admin-nrpti/src/app/records/correspondences/correspondence-detail/correspondence-detail.component.ts b/angular/projects/admin-nrpti/src/app/records/correspondences/correspondence-detail/correspondence-detail.component.ts index aea343150..e810532cb 100644 --- a/angular/projects/admin-nrpti/src/app/records/correspondences/correspondence-detail/correspondence-detail.component.ts +++ b/angular/projects/admin-nrpti/src/app/records/correspondences/correspondence-detail/correspondence-detail.component.ts @@ -7,7 +7,7 @@ import { RecordDetailComponent } from '../../utils/record-component'; import { RecordUtils } from '../../utils/record-utils'; import { Utils as CommonUtils } from '../../../../../../common/src/app/utils/utils'; import { FactoryService } from '../../../services/factory.service'; -import { Utils } from 'nrpti-angular-components'; +import { AgencyDataService } from '../../../../../../../projects/global/src/lib/utils/agency-data-service'; @Component({ selector: 'app-correspondence-detail', @@ -64,7 +64,8 @@ export class CorrespondenceDetailComponent extends RecordDetailComponent impleme } displayName(agency) { - return Utils.displayNameFull(agency); + const agencyDataService = new AgencyDataService(this.factoryService); + return agencyDataService.displayNameFull(agency); } ngOnDestroy() { diff --git a/angular/projects/admin-nrpti/src/app/records/court-convictions/court-conviction-add-edit/court-conviction-add-edit.component.ts b/angular/projects/admin-nrpti/src/app/records/court-convictions/court-conviction-add-edit/court-conviction-add-edit.component.ts index 6034f690d..72b417415 100644 --- a/angular/projects/admin-nrpti/src/app/records/court-convictions/court-conviction-add-edit/court-conviction-add-edit.component.ts +++ b/angular/projects/admin-nrpti/src/app/records/court-convictions/court-conviction-add-edit/court-conviction-add-edit.component.ts @@ -9,6 +9,7 @@ import { Utils, LoadingScreenService, LoggerService, StoreService } from 'nrpti- import { Utils as CommonUtils } from '../../../../../../common/src/app/utils/utils'; import { RecordUtils } from '../../utils/record-utils'; import { Constants } from '../../../utils/constants/misc'; +import { AgencyDataService } from '../../../../../../../projects/global/src/lib/utils/agency-data-service'; @Component({ selector: 'app-court-conviction-add-edit', @@ -33,7 +34,7 @@ export class CourtConvictionAddEditComponent implements OnInit, OnDestroy { public bcmiPublishSubtext = 'Not published'; // Pick lists - public agencies = Picklists.agencyPicklist; + public agencies = Picklists.agencyCodePicklist; public authors = Picklists.authorPicklist; public courtConvictionSubtypes = Picklists.courtConvictionSubtypePicklist; protected defaultAgency = ''; @@ -636,7 +637,8 @@ export class CourtConvictionAddEditComponent implements OnInit, OnDestroy { } displayName(agency) { - return Utils.displayNameFull(agency); + const agencyDataService = new AgencyDataService(this.factoryService); + return agencyDataService.displayNameFull(agency); } cancel() { diff --git a/angular/projects/admin-nrpti/src/app/records/court-convictions/court-conviction-detail/court-conviction-detail.component.ts b/angular/projects/admin-nrpti/src/app/records/court-convictions/court-conviction-detail/court-conviction-detail.component.ts index bfb373cef..e2f64fb5f 100644 --- a/angular/projects/admin-nrpti/src/app/records/court-convictions/court-conviction-detail/court-conviction-detail.component.ts +++ b/angular/projects/admin-nrpti/src/app/records/court-convictions/court-conviction-detail/court-conviction-detail.component.ts @@ -7,7 +7,7 @@ import { RecordDetailComponent } from '../../utils/record-component'; import { RecordUtils } from '../../utils/record-utils'; import { Utils as CommonUtils } from '../../../../../../common/src/app/utils/utils'; import { FactoryService } from '../../../services/factory.service'; -import { Utils } from 'nrpti-angular-components'; +import { AgencyDataService } from '../../../../../../../projects/global/src/lib/utils/agency-data-service'; @Component({ selector: 'app-court-conviction-detail', @@ -64,7 +64,8 @@ export class CourtConvictionDetailComponent extends RecordDetailComponent implem } displayName(agency) { - return Utils.displayNameFull(agency); + const agencyDataService = new AgencyDataService(this.factoryService); + return agencyDataService.displayNameFull(agency); } ngOnDestroy() { diff --git a/angular/projects/admin-nrpti/src/app/records/dam-safety-inspections/dam-safety-inspection-add-edit/dam-safety-inspection-add-edit.component.ts b/angular/projects/admin-nrpti/src/app/records/dam-safety-inspections/dam-safety-inspection-add-edit/dam-safety-inspection-add-edit.component.ts index bb760afe2..5ebee5cd2 100644 --- a/angular/projects/admin-nrpti/src/app/records/dam-safety-inspections/dam-safety-inspection-add-edit/dam-safety-inspection-add-edit.component.ts +++ b/angular/projects/admin-nrpti/src/app/records/dam-safety-inspections/dam-safety-inspection-add-edit/dam-safety-inspection-add-edit.component.ts @@ -10,6 +10,7 @@ import { Utils as CommonUtils } from '../../../../../../common/src/app/utils/uti import { RecordUtils } from '../../utils/record-utils'; import { LoadingScreenService, StoreService } from 'nrpti-angular-components'; import { Constants } from '../../../utils/constants/misc'; +import { AgencyDataService } from '../../../../../../../projects/global/src/lib/utils/agency-data-service'; @Component({ selector: 'app-dam-safety-inspection-add-edit', @@ -32,7 +33,7 @@ export class DamSafetyInspectionAddEditComponent implements OnInit, OnDestroy { public bcmiPublishSubtext = 'Not published'; // Pick lists - public agencies = Picklists.agencyPicklist; + public agencies = Picklists.agencyCodePicklist; // Documents public documents = []; @@ -492,7 +493,8 @@ export class DamSafetyInspectionAddEditComponent implements OnInit, OnDestroy { } displayName(agency) { - return Utils.displayNameFull(agency); + const agencyDataService = new AgencyDataService(this.factoryService); + return agencyDataService.displayNameFull(agency); } ngOnDestroy(): void { diff --git a/angular/projects/admin-nrpti/src/app/records/dam-safety-inspections/dam-safety-inspection-detail/dam-safety-inspection-detail.component.ts b/angular/projects/admin-nrpti/src/app/records/dam-safety-inspections/dam-safety-inspection-detail/dam-safety-inspection-detail.component.ts index 03505382a..58297c1e5 100644 --- a/angular/projects/admin-nrpti/src/app/records/dam-safety-inspections/dam-safety-inspection-detail/dam-safety-inspection-detail.component.ts +++ b/angular/projects/admin-nrpti/src/app/records/dam-safety-inspections/dam-safety-inspection-detail/dam-safety-inspection-detail.component.ts @@ -7,7 +7,7 @@ import { RecordDetailComponent } from '../../utils/record-component'; import { RecordUtils } from '../../utils/record-utils'; import { Utils as CommonUtils } from '../../../../../../common/src/app/utils/utils'; import { FactoryService } from '../../../services/factory.service'; -import { Utils } from 'nrpti-angular-components'; +import { AgencyDataService } from '../../../../../../../projects/global/src/lib/utils/agency-data-service'; @Component({ selector: 'app-dam-safety-inspection-detail', @@ -64,7 +64,8 @@ export class DamSafetyInspectionDetailComponent extends RecordDetailComponent im } displayName(agency) { - return Utils.displayNameFull(agency); + const agencyDataService = new AgencyDataService(this.factoryService); + return agencyDataService.displayNameFull(agency); } ngOnDestroy() { diff --git a/angular/projects/admin-nrpti/src/app/records/inspections/inspection-add-edit/inspection-add-edit.component.ts b/angular/projects/admin-nrpti/src/app/records/inspections/inspection-add-edit/inspection-add-edit.component.ts index adb64a0c3..07a6cfd0f 100644 --- a/angular/projects/admin-nrpti/src/app/records/inspections/inspection-add-edit/inspection-add-edit.component.ts +++ b/angular/projects/admin-nrpti/src/app/records/inspections/inspection-add-edit/inspection-add-edit.component.ts @@ -10,6 +10,7 @@ import { Utils as CommonUtils } from '../../../../../../common/src/app/utils/uti import { RecordUtils } from '../../utils/record-utils'; import { LoadingScreenService, StoreService, LoggerService } from 'nrpti-angular-components'; import { Constants } from '../../../utils/constants/misc'; +import { AgencyDataService } from '../../../../../../../projects/global/src/lib/utils/agency-data-service'; @Component({ selector: 'app-inspection-add-edit', @@ -32,7 +33,7 @@ export class InspectionAddEditComponent implements OnInit, OnDestroy { public nrcedPublishSubtext = 'Not published'; // Pick lists - public agencies = Picklists.agencyPicklist; + public agencies = Picklists.agencyCodePicklist; public authors = Picklists.authorPicklist; public outcomeStatuses = Picklists.outcomeStatusPicklist; private defaultAgency = ''; @@ -514,8 +515,9 @@ export class InspectionAddEditComponent implements OnInit, OnDestroy { return Utils.convertAcronyms(acronym); } - displayName(agencyCode) { - return Utils.displayNameFull(agencyCode); + displayName(agency) { + const agencyDataService = new AgencyDataService(this.factoryService); + return agencyDataService.displayNameFull(agency); } cancel() { diff --git a/angular/projects/admin-nrpti/src/app/records/management-plans/management-plan-add-edit/management-plan-add-edit.component.ts b/angular/projects/admin-nrpti/src/app/records/management-plans/management-plan-add-edit/management-plan-add-edit.component.ts index 2c74fd446..1ccb362fb 100644 --- a/angular/projects/admin-nrpti/src/app/records/management-plans/management-plan-add-edit/management-plan-add-edit.component.ts +++ b/angular/projects/admin-nrpti/src/app/records/management-plans/management-plan-add-edit/management-plan-add-edit.component.ts @@ -10,6 +10,7 @@ import { Utils as CommonUtils } from '../../../../../../common/src/app/utils/uti import { RecordUtils } from '../../utils/record-utils'; import { LoadingScreenService, StoreService, LoggerService } from 'nrpti-angular-components'; import { Constants } from '../../../utils/constants/misc'; +import { AgencyDataService } from '../../../../../../../projects/global/src/lib/utils/agency-data-service'; @Component({ selector: 'app-management-plan-add-edit', @@ -30,7 +31,7 @@ export class ManagementPlanAddEditComponent implements OnInit, OnDestroy { public lngPublishSubtext = 'Not published'; // Pick lists - public agencies = Picklists.agencyPicklist; + public agencies = Picklists.agencyCodePicklist; // Documents public documents = []; @@ -306,7 +307,8 @@ export class ManagementPlanAddEditComponent implements OnInit, OnDestroy { } displayName(agency) { - return Utils.displayNameFull(agency); + const agencyDataService = new AgencyDataService(this.factoryService); + return agencyDataService.displayNameFull(agency); } cancel() { diff --git a/angular/projects/admin-nrpti/src/app/records/management-plans/management-plan-detail/management-plan-detail.component.ts b/angular/projects/admin-nrpti/src/app/records/management-plans/management-plan-detail/management-plan-detail.component.ts index 895ac2ba6..12b600c0e 100644 --- a/angular/projects/admin-nrpti/src/app/records/management-plans/management-plan-detail/management-plan-detail.component.ts +++ b/angular/projects/admin-nrpti/src/app/records/management-plans/management-plan-detail/management-plan-detail.component.ts @@ -5,7 +5,8 @@ import { Subject } from 'rxjs'; import { ActivatedRoute, Router } from '@angular/router'; import { RecordComponent } from '../../utils/record-component'; import { RecordUtils } from '../../utils/record-utils'; -import { Utils } from 'nrpti-angular-components'; +import { AgencyDataService } from '../../../../../../../projects/global/src/lib/utils/agency-data-service'; +import { FactoryService } from '../../../services/factory.service'; @Component({ selector: 'app-management-plan-detail', @@ -15,8 +16,10 @@ import { Utils } from 'nrpti-angular-components'; export class ManagementPlanDetailComponent extends RecordComponent implements OnInit, OnDestroy { private ngUnsubscribe: Subject = new Subject(); - constructor(public route: ActivatedRoute, public router: Router, public changeDetectionRef: ChangeDetectorRef) { + constructor(public route: ActivatedRoute, public router: Router, public changeDetectionRef: ChangeDetectorRef + ,public factoryService: FactoryService) { super(); + } ngOnInit() { @@ -46,7 +49,8 @@ export class ManagementPlanDetailComponent extends RecordComponent implements On } displayName(agency) { - return Utils.displayNameFull(agency); + const agencyDataService = new AgencyDataService(this.factoryService); + return agencyDataService.displayNameFull(agency); } ngOnDestroy() { diff --git a/angular/projects/admin-nrpti/src/app/records/permits/permit-add-edit/permit-add-edit.component.ts b/angular/projects/admin-nrpti/src/app/records/permits/permit-add-edit/permit-add-edit.component.ts index b94839cae..924a48bf6 100644 --- a/angular/projects/admin-nrpti/src/app/records/permits/permit-add-edit/permit-add-edit.component.ts +++ b/angular/projects/admin-nrpti/src/app/records/permits/permit-add-edit/permit-add-edit.component.ts @@ -10,6 +10,7 @@ import { Utils as CommonUtils } from '../../../../../../common/src/app/utils/uti import { RecordUtils } from '../../utils/record-utils'; import { LoadingScreenService, StoreService } from 'nrpti-angular-components'; import { Constants } from '../../../utils/constants/misc'; +import { AgencyDataService } from '../../../../../../../projects/global/src/lib/utils/agency-data-service'; @Component({ selector: 'app-permit-add-edit', @@ -31,7 +32,7 @@ export class PermitAddEditComponent implements OnInit, OnDestroy { // Pick lists public permitSubtypes = Picklists.permitSubtypePicklist; - public agencies = Picklists.agencyPicklist; + public agencies = Picklists.agencyCodePicklist; private defaultAgency = ''; // Documents @@ -376,7 +377,8 @@ export class PermitAddEditComponent implements OnInit, OnDestroy { } displayName(agency) { - return Utils.displayNameFull(agency); + const agencyDataService = new AgencyDataService(this.factoryService); + return agencyDataService.displayNameFull(agency); } cancel() { diff --git a/angular/projects/admin-nrpti/src/app/records/reports/report-add-edit/report-add-edit.component.ts b/angular/projects/admin-nrpti/src/app/records/reports/report-add-edit/report-add-edit.component.ts index 8ec105758..2921e8483 100644 --- a/angular/projects/admin-nrpti/src/app/records/reports/report-add-edit/report-add-edit.component.ts +++ b/angular/projects/admin-nrpti/src/app/records/reports/report-add-edit/report-add-edit.component.ts @@ -10,6 +10,7 @@ import { Utils as CommonUtils } from '../../../../../../common/src/app/utils/uti import { RecordUtils } from '../../utils/record-utils'; import { LoadingScreenService, StoreService } from 'nrpti-angular-components'; import { Constants } from '../../../utils/constants/misc'; +import { AgencyDataService } from '../../../../../../../projects/global/src/lib/utils/agency-data-service'; @Component({ selector: 'app-report-add-edit', @@ -32,7 +33,7 @@ export class ReportAddEditComponent implements OnInit, OnDestroy { public bcmiPublishSubtext = 'Not published'; // Pick lists - public agencies = Picklists.agencyPicklist; + public agencies = Picklists.agencyCodePicklist; // Documents public documents = []; @@ -479,7 +480,8 @@ export class ReportAddEditComponent implements OnInit, OnDestroy { } displayName(agency) { - return Utils.displayNameFull(agency); + const agencyDataService = new AgencyDataService(this.factoryService); + return agencyDataService.displayNameFull(agency); } cancel() { diff --git a/angular/projects/admin-nrpti/src/app/records/reports/report-detail/report-detail.component.ts b/angular/projects/admin-nrpti/src/app/records/reports/report-detail/report-detail.component.ts index 78c8033da..76beee24b 100644 --- a/angular/projects/admin-nrpti/src/app/records/reports/report-detail/report-detail.component.ts +++ b/angular/projects/admin-nrpti/src/app/records/reports/report-detail/report-detail.component.ts @@ -7,7 +7,7 @@ import { RecordDetailComponent } from '../../utils/record-component'; import { RecordUtils } from '../../utils/record-utils'; import { Utils as CommonUtils } from '../../../../../../common/src/app/utils/utils'; import { FactoryService } from '../../../services/factory.service'; -import { Utils } from 'nrpti-angular-components'; +import { AgencyDataService } from '../../../../../../../projects/global/src/lib/utils/agency-data-service'; @Component({ selector: 'app-report-detail', @@ -64,7 +64,8 @@ export class ReportDetailComponent extends RecordDetailComponent implements OnIn } displayName(agency) { - return Utils.displayNameFull(agency); + const agencyDataService = new AgencyDataService(this.factoryService); + return agencyDataService.displayNameFull(agency); } ngOnDestroy() { diff --git a/angular/projects/admin-nrpti/src/app/records/restorative-justices/restorative-justice-add-edit/restorative-justice-add-edit.component.ts b/angular/projects/admin-nrpti/src/app/records/restorative-justices/restorative-justice-add-edit/restorative-justice-add-edit.component.ts index e014b2048..efb52c90e 100644 --- a/angular/projects/admin-nrpti/src/app/records/restorative-justices/restorative-justice-add-edit/restorative-justice-add-edit.component.ts +++ b/angular/projects/admin-nrpti/src/app/records/restorative-justices/restorative-justice-add-edit/restorative-justice-add-edit.component.ts @@ -10,6 +10,7 @@ import { Utils as CommonUtils } from '../../../../../../common/src/app/utils/uti import { RecordUtils } from '../../utils/record-utils'; import { LoadingScreenService, LoggerService } from 'nrpti-angular-components'; import { Constants } from '../../../utils/constants/misc'; +import { AgencyDataService } from '../../../../../../../projects/global/src/lib/utils/agency-data-service'; @Component({ selector: 'app-restorative-justice-add-edit', @@ -32,7 +33,7 @@ export class RestorativeJusticeAddEditComponent implements OnInit, OnDestroy { public nrcedPublishSubtext = 'Not published'; // Pick lists - public agencies = Picklists.agencyPicklist; + public agencies = Picklists.agencyCodePicklist; public authors = Picklists.authorPicklist; private defaultAgency = ''; @@ -543,7 +544,8 @@ export class RestorativeJusticeAddEditComponent implements OnInit, OnDestroy { } displayName(agency) { - return Utils.displayNameFull(agency); + const agencyDataService = new AgencyDataService(this.factoryService); + return agencyDataService.displayNameFull(agency); } cancel() { diff --git a/angular/projects/admin-nrpti/src/app/records/restorative-justices/restorative-justice-detail/restorative-justice-detail.component.ts b/angular/projects/admin-nrpti/src/app/records/restorative-justices/restorative-justice-detail/restorative-justice-detail.component.ts index ed8b7b143..5469f9a69 100644 --- a/angular/projects/admin-nrpti/src/app/records/restorative-justices/restorative-justice-detail/restorative-justice-detail.component.ts +++ b/angular/projects/admin-nrpti/src/app/records/restorative-justices/restorative-justice-detail/restorative-justice-detail.component.ts @@ -7,7 +7,7 @@ import { RecordDetailComponent } from '../../utils/record-component'; import { RecordUtils } from '../../utils/record-utils'; import { Utils as CommonUtils } from '../../../../../../common/src/app/utils/utils'; import { FactoryService } from '../../../services/factory.service'; -import { Utils } from 'nrpti-angular-components'; +import { AgencyDataService } from '../../../../../../../projects/global/src/lib/utils/agency-data-service'; @Component({ selector: 'app-restorative-justice-detail', @@ -64,7 +64,8 @@ export class RestorativeJusticeDetailComponent extends RecordDetailComponent imp } displayName(agency) { - return Utils.displayNameFull(agency); + const agencyDataService = new AgencyDataService(this.factoryService); + return agencyDataService.displayNameFull(agency); } ngOnDestroy() {