diff --git a/angular/projects/admin-nrpti/src/app/mines/mines-enforcement-actions/mines-administrative-penalty-add-edit/mines-administrative-penalty-add-edit.component.html b/angular/projects/admin-nrpti/src/app/mines/mines-enforcement-actions/mines-administrative-penalty-add-edit/mines-administrative-penalty-add-edit.component.html
index 6999cc412..7e57b086a 100644
--- a/angular/projects/admin-nrpti/src/app/mines/mines-enforcement-actions/mines-administrative-penalty-add-edit/mines-administrative-penalty-add-edit.component.html
+++ b/angular/projects/admin-nrpti/src/app/mines/mines-enforcement-actions/mines-administrative-penalty-add-edit/mines-administrative-penalty-add-edit.component.html
@@ -94,6 +94,7 @@
Contravention
[formArray]="this.myForm.controls.legislations"
[sourceSystemRef]="this.currentRecord && this.currentRecord.sourceSystemRef"
[hasOffence]="true"
+ [recordType]="'AdministrativePenalty'"
>
diff --git a/angular/projects/admin-nrpti/src/app/mines/mines-enforcement-actions/mines-court-convictions/mines-court-convictions-add-edit/mines-court-convictions-add-edit.component.html b/angular/projects/admin-nrpti/src/app/mines/mines-enforcement-actions/mines-court-convictions/mines-court-convictions-add-edit/mines-court-convictions-add-edit.component.html
index 3ea8c7753..f7bfd9a73 100644
--- a/angular/projects/admin-nrpti/src/app/mines/mines-enforcement-actions/mines-court-convictions/mines-court-convictions-add-edit/mines-court-convictions-add-edit.component.html
+++ b/angular/projects/admin-nrpti/src/app/mines/mines-enforcement-actions/mines-court-convictions/mines-court-convictions-add-edit/mines-court-convictions-add-edit.component.html
@@ -94,6 +94,7 @@ Contravention
[formArray]="this.myForm.controls.legislations"
[sourceSystemRef]="this.currentRecord && this.currentRecord.sourceSystemRef"
[hasOffence]="true"
+ [recordType]="'CourtConviction'"
>
diff --git a/angular/projects/admin-nrpti/src/app/records/administrative-penalties/administrative-penalty-add-edit/administrative-penalty-add-edit.component.html b/angular/projects/admin-nrpti/src/app/records/administrative-penalties/administrative-penalty-add-edit/administrative-penalty-add-edit.component.html
index de1ab91ea..e3d4d59bf 100644
--- a/angular/projects/admin-nrpti/src/app/records/administrative-penalties/administrative-penalty-add-edit/administrative-penalty-add-edit.component.html
+++ b/angular/projects/admin-nrpti/src/app/records/administrative-penalties/administrative-penalty-add-edit/administrative-penalty-add-edit.component.html
@@ -89,6 +89,7 @@ Contravention
[formArray]="this.myForm.controls.legislations"
[sourceSystemRef]="this.currentRecord && this.currentRecord.sourceSystemRef"
[hasOffence]="true"
+ [recordType]="'AdministrativePenalty'"
>
diff --git a/angular/projects/admin-nrpti/src/app/records/administrative-sanctions/administrative-sanction-add-edit/administrative-sanction-add-edit.component.html b/angular/projects/admin-nrpti/src/app/records/administrative-sanctions/administrative-sanction-add-edit/administrative-sanction-add-edit.component.html
index 1ae5ce4c9..67561f6c5 100644
--- a/angular/projects/admin-nrpti/src/app/records/administrative-sanctions/administrative-sanction-add-edit/administrative-sanction-add-edit.component.html
+++ b/angular/projects/admin-nrpti/src/app/records/administrative-sanctions/administrative-sanction-add-edit/administrative-sanction-add-edit.component.html
@@ -81,6 +81,7 @@ Legislation
[formArray]="this.myForm.controls.legislations"
[sourceSystemRef]="this.currentRecord && this.currentRecord.sourceSystemRef"
[hasOffence]="false"
+ [recordType]="'AdministrativeSanction'"
>
diff --git a/angular/projects/admin-nrpti/src/app/records/annual-reports/annual-report-add-edit/annual-report-add-edit.component.html b/angular/projects/admin-nrpti/src/app/records/annual-reports/annual-report-add-edit/annual-report-add-edit.component.html
index 1dddebc11..ec23ab737 100644
--- a/angular/projects/admin-nrpti/src/app/records/annual-reports/annual-report-add-edit/annual-report-add-edit.component.html
+++ b/angular/projects/admin-nrpti/src/app/records/annual-reports/annual-report-add-edit/annual-report-add-edit.component.html
@@ -68,6 +68,7 @@ Legislation
[formArray]="this.myForm.controls.legislations"
[sourceSystemRef]="this.currentRecord && this.currentRecord.sourceSystemRef"
[hasOffence]="false"
+ [recordType]="'AnnualReport'"
>
diff --git a/angular/projects/admin-nrpti/src/app/records/certificate-amendments/certificate-amendments-add-edit/certificate-amendments-add-edit.component.html b/angular/projects/admin-nrpti/src/app/records/certificate-amendments/certificate-amendments-add-edit/certificate-amendments-add-edit.component.html
index 62df1baca..fd9f12e22 100644
--- a/angular/projects/admin-nrpti/src/app/records/certificate-amendments/certificate-amendments-add-edit/certificate-amendments-add-edit.component.html
+++ b/angular/projects/admin-nrpti/src/app/records/certificate-amendments/certificate-amendments-add-edit/certificate-amendments-add-edit.component.html
@@ -74,6 +74,7 @@ Legislation
[formArray]="this.myForm.controls.legislations"
[sourceSystemRef]="this.currentRecord && this.currentRecord.sourceSystemRef"
[hasOffence]="false"
+ [recordType]="'CertificateAmendment'"
>
diff --git a/angular/projects/admin-nrpti/src/app/records/certificates/certificate-add-edit/certificate-add-edit.component.html b/angular/projects/admin-nrpti/src/app/records/certificates/certificate-add-edit/certificate-add-edit.component.html
index 3130aab92..a43f525d3 100644
--- a/angular/projects/admin-nrpti/src/app/records/certificates/certificate-add-edit/certificate-add-edit.component.html
+++ b/angular/projects/admin-nrpti/src/app/records/certificates/certificate-add-edit/certificate-add-edit.component.html
@@ -74,6 +74,7 @@ Legislation
[formArray]="this.myForm.controls.legislations"
[sourceSystemRef]="this.currentRecord && this.currentRecord.sourceSystemRef"
[hasOffence]="false"
+ [recordType]="'Certificate'"
>
diff --git a/angular/projects/admin-nrpti/src/app/records/correspondences/correspondence-add-edit/correspondence-add-edit.component.html b/angular/projects/admin-nrpti/src/app/records/correspondences/correspondence-add-edit/correspondence-add-edit.component.html
index 9bd670eb9..49f5ba57a 100644
--- a/angular/projects/admin-nrpti/src/app/records/correspondences/correspondence-add-edit/correspondence-add-edit.component.html
+++ b/angular/projects/admin-nrpti/src/app/records/correspondences/correspondence-add-edit/correspondence-add-edit.component.html
@@ -68,6 +68,7 @@ Legislation
[formArray]="this.myForm.controls.legislations"
[sourceSystemRef]="this.currentRecord && this.currentRecord.sourceSystemRef"
[hasOffence]="false"
+ [recordType]="'Correspondence'"
>
diff --git a/angular/projects/admin-nrpti/src/app/records/court-convictions/court-conviction-add-edit/court-conviction-add-edit.component.html b/angular/projects/admin-nrpti/src/app/records/court-convictions/court-conviction-add-edit/court-conviction-add-edit.component.html
index f5391e4a9..2f8da78b8 100644
--- a/angular/projects/admin-nrpti/src/app/records/court-convictions/court-conviction-add-edit/court-conviction-add-edit.component.html
+++ b/angular/projects/admin-nrpti/src/app/records/court-convictions/court-conviction-add-edit/court-conviction-add-edit.component.html
@@ -112,6 +112,7 @@ Contravention
[formArray]="this.myForm.controls.legislations"
[sourceSystemRef]="this.currentRecord && this.currentRecord.sourceSystemRef"
[hasOffence]="true"
+ [recordType]="'CourtConviction'"
>
diff --git a/angular/projects/admin-nrpti/src/app/records/dam-safety-inspections/dam-safety-inspection-add-edit/dam-safety-inspection-add-edit.component.html b/angular/projects/admin-nrpti/src/app/records/dam-safety-inspections/dam-safety-inspection-add-edit/dam-safety-inspection-add-edit.component.html
index cc4d3abd9..3574df854 100644
--- a/angular/projects/admin-nrpti/src/app/records/dam-safety-inspections/dam-safety-inspection-add-edit/dam-safety-inspection-add-edit.component.html
+++ b/angular/projects/admin-nrpti/src/app/records/dam-safety-inspections/dam-safety-inspection-add-edit/dam-safety-inspection-add-edit.component.html
@@ -68,6 +68,7 @@ Legislation
[formArray]="this.myForm.controls.legislations"
[sourceSystemRef]="this.currentRecord && this.currentRecord.sourceSystemRef"
[hasOffence]="false"
+ [recordType]="'DamSafetyInspection'"
>
diff --git a/angular/projects/admin-nrpti/src/app/records/inspections/inspection-add-edit/inspection-add-edit.component.html b/angular/projects/admin-nrpti/src/app/records/inspections/inspection-add-edit/inspection-add-edit.component.html
index f232667e7..4f2f210e7 100644
--- a/angular/projects/admin-nrpti/src/app/records/inspections/inspection-add-edit/inspection-add-edit.component.html
+++ b/angular/projects/admin-nrpti/src/app/records/inspections/inspection-add-edit/inspection-add-edit.component.html
@@ -74,6 +74,7 @@ Legislation
[formArray]="this.myForm.controls.legislations"
[sourceSystemRef]="this.currentRecord && this.currentRecord.sourceSystemRef"
[hasOffence]="false"
+ [recordType]="'Inspection'"
>
diff --git a/angular/projects/admin-nrpti/src/app/records/orders/order-add-edit/order-add-edit.component.html b/angular/projects/admin-nrpti/src/app/records/orders/order-add-edit/order-add-edit.component.html
index 3df5eb88b..f312c35cd 100644
--- a/angular/projects/admin-nrpti/src/app/records/orders/order-add-edit/order-add-edit.component.html
+++ b/angular/projects/admin-nrpti/src/app/records/orders/order-add-edit/order-add-edit.component.html
@@ -80,6 +80,7 @@ Legislation
[formArray]="this.myForm.controls.legislations"
[sourceSystemRef]="this.currentRecord && this.currentRecord.sourceSystemRef"
[hasOffence]="false"
+ [recordType]="'Order'"
>
diff --git a/angular/projects/admin-nrpti/src/app/records/permits/permit-add-edit/permit-add-edit.component.html b/angular/projects/admin-nrpti/src/app/records/permits/permit-add-edit/permit-add-edit.component.html
index e23f08c74..3fe107753 100644
--- a/angular/projects/admin-nrpti/src/app/records/permits/permit-add-edit/permit-add-edit.component.html
+++ b/angular/projects/admin-nrpti/src/app/records/permits/permit-add-edit/permit-add-edit.component.html
@@ -70,6 +70,7 @@ Legislation
[formArray]="this.myForm.controls.legislations"
[sourceSystemRef]="this.currentRecord && this.currentRecord.sourceSystemRef"
[hasOffence]="false"
+ [recordType]="'Permit'"
>
diff --git a/angular/projects/admin-nrpti/src/app/records/reports/report-add-edit/report-add-edit.component.html b/angular/projects/admin-nrpti/src/app/records/reports/report-add-edit/report-add-edit.component.html
index 8a1599ff0..637c5ae6b 100644
--- a/angular/projects/admin-nrpti/src/app/records/reports/report-add-edit/report-add-edit.component.html
+++ b/angular/projects/admin-nrpti/src/app/records/reports/report-add-edit/report-add-edit.component.html
@@ -68,6 +68,7 @@ Legislation
[formArray]="this.myForm.controls.legislations"
[sourceSystemRef]="this.currentRecord && this.currentRecord.sourceSystemRef"
[hasOffence]="false"
+ [recordType]="'Report'"
>
diff --git a/angular/projects/admin-nrpti/src/app/records/restorative-justices/restorative-justice-add-edit/restorative-justice-add-edit.component.html b/angular/projects/admin-nrpti/src/app/records/restorative-justices/restorative-justice-add-edit/restorative-justice-add-edit.component.html
index ee811fc2f..64cc31dc2 100644
--- a/angular/projects/admin-nrpti/src/app/records/restorative-justices/restorative-justice-add-edit/restorative-justice-add-edit.component.html
+++ b/angular/projects/admin-nrpti/src/app/records/restorative-justices/restorative-justice-add-edit/restorative-justice-add-edit.component.html
@@ -80,6 +80,7 @@ Contravention
[formArray]="this.myForm.controls.legislations"
[sourceSystemRef]="this.currentRecord && this.currentRecord.sourceSystemRef"
[hasOffence]="true"
+ [recordType]="'RestorativeJustice'"
>
diff --git a/angular/projects/admin-nrpti/src/app/records/self-reports/self-report-add-edit/self-report-add-edit.component.html b/angular/projects/admin-nrpti/src/app/records/self-reports/self-report-add-edit/self-report-add-edit.component.html
index 7e31fefc2..bd0aacd77 100644
--- a/angular/projects/admin-nrpti/src/app/records/self-reports/self-report-add-edit/self-report-add-edit.component.html
+++ b/angular/projects/admin-nrpti/src/app/records/self-reports/self-report-add-edit/self-report-add-edit.component.html
@@ -80,6 +80,7 @@ Legislation
[formArray]="this.myForm.controls.legislations"
[sourceSystemRef]="this.currentRecord && this.currentRecord.sourceSystemRef"
[hasOffence]="false"
+ [recordType]="'SelfReport'"
>
diff --git a/angular/projects/admin-nrpti/src/app/records/tickets/ticket-add-edit/ticket-add-edit.component.html b/angular/projects/admin-nrpti/src/app/records/tickets/ticket-add-edit/ticket-add-edit.component.html
index cfa389f31..23f67c7d9 100644
--- a/angular/projects/admin-nrpti/src/app/records/tickets/ticket-add-edit/ticket-add-edit.component.html
+++ b/angular/projects/admin-nrpti/src/app/records/tickets/ticket-add-edit/ticket-add-edit.component.html
@@ -74,6 +74,7 @@ Contravention
[formArray]="this.myForm.controls.legislations"
[sourceSystemRef]="this.currentRecord && this.currentRecord.sourceSystemRef"
[hasOffence]="true"
+ [recordType]="'Ticket'"
>
diff --git a/angular/projects/admin-nrpti/src/app/records/warnings/warning-add-edit/warning-add-edit.component.html b/angular/projects/admin-nrpti/src/app/records/warnings/warning-add-edit/warning-add-edit.component.html
index 14b3212cb..517007a25 100644
--- a/angular/projects/admin-nrpti/src/app/records/warnings/warning-add-edit/warning-add-edit.component.html
+++ b/angular/projects/admin-nrpti/src/app/records/warnings/warning-add-edit/warning-add-edit.component.html
@@ -74,6 +74,7 @@ Legislation
[formArray]="this.myForm.controls.legislations"
[sourceSystemRef]="this.currentRecord && this.currentRecord.sourceSystemRef"
[hasOffence]="false"
+ [recordType]="'Warning'"
>
diff --git a/angular/projects/common/src/app/legislation/legislation-add-edit/legislation-add-edit.component.ts b/angular/projects/common/src/app/legislation/legislation-add-edit/legislation-add-edit.component.ts
index 095ee2066..61bacd3d4 100644
--- a/angular/projects/common/src/app/legislation/legislation-add-edit/legislation-add-edit.component.ts
+++ b/angular/projects/common/src/app/legislation/legislation-add-edit/legislation-add-edit.component.ts
@@ -14,6 +14,7 @@ import { Utils } from 'nrpti-angular-components';
export class LegislationAddEditComponent implements OnInit {
@Input() formGroup: FormGroup;
@Input() hasOffence: boolean;
+ @Input() recordType: string;
@Input() hideSection = false;
@Input() hideSubSection = false;
@@ -43,7 +44,7 @@ export class LegislationAddEditComponent implements OnInit {
constructor(
public utils: Utils,
protected _changeDetectionRef: ChangeDetectorRef
- ) {}
+ ) { }
ngOnInit(): void {
if (this.formGroup.controls.act.value && this.formGroup.controls.regulation.value) {
@@ -94,14 +95,14 @@ export class LegislationAddEditComponent implements OnInit {
paragraph: this.formGroup.get('paragraph').value
});
- if ( this.hasOffence ) {
+ if (this.hasOffence) {
this.formGroup.get('offence').setValue(
- Picklists.getLegislationDescription('AdministrativePenalty', legislation)
+ Picklists.getLegislationDescription(this.recordType, legislation)
);
this.formGroup.get('offence').markAsDirty();
} else {
this.formGroup.get('legislationDescription').setValue(
- Picklists.getLegislationDescription('AdministrativePenalty', legislation)
+ Picklists.getLegislationDescription(this.recordType, legislation)
);
this.formGroup.get('legislationDescription').markAsDirty();
}
diff --git a/angular/projects/common/src/app/legislation/legislation-list-add-edit/legislation-list-add-edit.component.html b/angular/projects/common/src/app/legislation/legislation-list-add-edit/legislation-list-add-edit.component.html
index eed167499..b53ab60d3 100644
--- a/angular/projects/common/src/app/legislation/legislation-list-add-edit/legislation-list-add-edit.component.html
+++ b/angular/projects/common/src/app/legislation/legislation-list-add-edit/legislation-list-add-edit.component.html
@@ -12,6 +12,7 @@