Skip to content

Commit

Permalink
issuing agency replaced with api call
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjaytkbabu committed Sep 29, 2023
1 parent 0b51cf1 commit 0573f42
Show file tree
Hide file tree
Showing 24 changed files with 90 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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 = '';

Expand Down Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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;
Expand Down Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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;
Expand Down Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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 = [];
Expand Down Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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 = [];
Expand Down Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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 = '';
Expand Down Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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 = [];
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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 = '';
Expand Down Expand Up @@ -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() {
Expand Down
Loading

0 comments on commit 0573f42

Please sign in to comment.