From 05d5ce70872b5f33ed59457a571daca0910ab732 Mon Sep 17 00:00:00 2001 From: acatchpole Date: Thu, 20 Jun 2024 15:12:08 -0700 Subject: [PATCH] moved permitName to utils and refactored to support --- .../mines-record-add/mines-record-add.component.html | 4 ++-- .../mines-record-add/mines-record-add.component.ts | 11 ----------- .../mines-records-edit.component.html | 4 ++-- .../mines-records-edit.component.ts | 11 ----------- .../admin-nrpti/src/app/records/utils/record-utils.ts | 11 +++++++++++ 5 files changed, 15 insertions(+), 26 deletions(-) diff --git a/angular/projects/admin-nrpti/src/app/mines/mines-record-add/mines-record-add.component.html b/angular/projects/admin-nrpti/src/app/mines/mines-record-add/mines-record-add.component.html index 24a9efdd2..ffbef3040 100644 --- a/angular/projects/admin-nrpti/src/app/mines/mines-record-add/mines-record-add.component.html +++ b/angular/projects/admin-nrpti/src/app/mines/mines-record-add/mines-record-add.component.html @@ -45,8 +45,8 @@ * diff --git a/angular/projects/admin-nrpti/src/app/mines/mines-record-add/mines-record-add.component.ts b/angular/projects/admin-nrpti/src/app/mines/mines-record-add/mines-record-add.component.ts index 8f3ddd9c8..4f684f4e8 100644 --- a/angular/projects/admin-nrpti/src/app/mines/mines-record-add/mines-record-add.component.ts +++ b/angular/projects/admin-nrpti/src/app/mines/mines-record-add/mines-record-add.component.ts @@ -179,17 +179,6 @@ export class MinesRecordAddComponent implements OnInit, OnDestroy { return agencyDataService.displayNameFull(agency); } - permitName(typeCode) { - switch (typeCode) { - case 'OGP': - return 'Permit'; - case 'ALG': - return 'Amalgamated Permit'; - default: - return 'Permit Amendment' //AMD - } - } - ngOnDestroy(): void { this.ngUnsubscribe.next(); this.ngUnsubscribe.complete(); diff --git a/angular/projects/admin-nrpti/src/app/mines/mines-records-edit/mines-records-edit.component.html b/angular/projects/admin-nrpti/src/app/mines/mines-records-edit/mines-records-edit.component.html index 30951bc0d..cc3ce5cb6 100644 --- a/angular/projects/admin-nrpti/src/app/mines/mines-records-edit/mines-records-edit.component.html +++ b/angular/projects/admin-nrpti/src/app/mines/mines-records-edit/mines-records-edit.component.html @@ -67,8 +67,8 @@

Edit record

diff --git a/angular/projects/admin-nrpti/src/app/mines/mines-records-edit/mines-records-edit.component.ts b/angular/projects/admin-nrpti/src/app/mines/mines-records-edit/mines-records-edit.component.ts index 68abc189d..bed9645c2 100644 --- a/angular/projects/admin-nrpti/src/app/mines/mines-records-edit/mines-records-edit.component.ts +++ b/angular/projects/admin-nrpti/src/app/mines/mines-records-edit/mines-records-edit.component.ts @@ -304,17 +304,6 @@ export class MinesRecordsEditComponent implements OnInit { return agencyDataService.displayNameFull(agency); } - permitName(typeCode) { - switch (typeCode) { - case 'OGP': - return 'Permit'; - case 'ALG': - return 'Amalgamated Permit'; - default: - return 'Permit Amendment' //AMD - } - } - /** * Cancel editing. * diff --git a/angular/projects/admin-nrpti/src/app/records/utils/record-utils.ts b/angular/projects/admin-nrpti/src/app/records/utils/record-utils.ts index 3ec13b205..0b6ffcc09 100644 --- a/angular/projects/admin-nrpti/src/app/records/utils/record-utils.ts +++ b/angular/projects/admin-nrpti/src/app/records/utils/record-utils.ts @@ -287,4 +287,15 @@ export class RecordUtils { const actTitle = dataservice.displayActTitleFull(actCode); return actTitle; } + + permitName(typeCode: string): string { + switch (typeCode) { + case 'OGP': + return 'Permit'; + case 'ALG': + return 'Amalgamated Permit'; + default: + return 'Permit Amendment'; // AMD + } + } }