From 06825c3652c36d7ef2d9198badab368ecc27caf0 Mon Sep 17 00:00:00 2001 From: JustinMacaulay Date: Fri, 20 Dec 2024 11:45:26 -0800 Subject: [PATCH] added some logic to look at the amendment stage to conditionally show fields --- .../dfa-project-amendment.component.html | 550 +++++++++--------- .../dfa-project-amendment.component.ts | 20 +- .../embc-dfa/src/app/models/decision.enum.ts | 4 +- 3 files changed, 299 insertions(+), 275 deletions(-) diff --git a/dfa-public/src/UI/embc-dfa/src/app/feature-components/dfa-project-amendment/dfa-project-amendment.component.html b/dfa-public/src/UI/embc-dfa/src/app/feature-components/dfa-project-amendment/dfa-project-amendment.component.html index ff9fe3c95..33adab947 100644 --- a/dfa-public/src/UI/embc-dfa/src/app/feature-components/dfa-project-amendment/dfa-project-amendment.component.html +++ b/dfa-public/src/UI/embc-dfa/src/app/feature-components/dfa-project-amendment/dfa-project-amendment.component.html @@ -1,297 +1,319 @@
-
-
-
-
+
+
+
+
- {{projectName}} - -
-
- + {{ projectName }} + +
+
+ sync -
-
- - Select Project Amendment - - - {{ option.amendmentNumber }} - - - - +
+
+ + Select Project Amendment + + + {{ option.amendmentNumber }} + + + + +
-
-
-
-
- Error in displaying status
-
- - - +
+
+
+ Error in displaying status
+
+
- {{item.status}} -
+ + - - - + + - -
+ {{ item.status }} +
- -
- +
+ +
+ {{ item.stage == 'Ineligible' || item.stage == 'Withdrawn' ? 'cancel' : 'check_circle' }} - - {{ item.status == 'Decision Made' && (stage == 'Ineligible' || stage == 'Withdrawn') ? 'cancel' : 'check_circle' }} + + {{ item.status == 'Decision Made' && (stage == 'Ineligible' || stage == 'Withdrawn') ? 'cancel' : 'check_circle' }} - - {{item.stage}} + + {{ item.stage }} - + {{ item.status == 'Draft' ? 'check_circle' : 'circle' }} - + circle - + circle -
- -
-
+
+ +
+ + + +
-
-
-
-
Case Number - {{caseNumber}}
-
Date of Damage (From) - {{dateOfDamageFrom | date : 'MM/dd/yyyy'}}
-
-
-
Cause of Damage - {{causeOfDamage}}
-
Date of Damage (To) - {{dateOfDamageTo | date : 'MM/dd/yyyy'}}
-
-
-
- - -
- +
-
-

- Amendment Number -

- - - -
-
-

- Amendment Received Date -

- - - MM/DD/YYYY - - - -
+
Case Number - {{ caseNumber }}
+
Date of Damage (From) - {{ dateOfDamageFrom | date : 'MM/dd/yyyy' }}
-
-
-

- Amendment Reason -

- - - -
+
Cause of Damage - {{ causeOfDamage }}
+
Date of Damage (To) - {{ dateOfDamageTo | date : 'MM/dd/yyyy' }}
+
+
+
+ + +
+ +
+
+

+ Amendment Number +

+ + + +
+
+

+ Amendment Received Date +

+ + -
-

- Amendment Approved Date -

- - - MM/DD/YYYY - - - -
-
-
-
-
-

- EMCR Decision Comments -

- + > + MM/DD/YYYY + + + +
+
+ +
+
+

+ Amendment Reason +

+ - -
-
-
-
Project Extension

-
-
-

- Request for Project Deadline Extention -

- - - -
-
-

- Amended Project Deadline Date -

- - - MM/DD/YYYY - - - -
-
-

- Deadline Extension Approved -

- - - -
-
-

- Amended 18 Month Deadline -

- - - MM/DD/YYYY - - - -
-
+ formControlName="amendmentReason" + style="resize:none" + cdkTextareaAutosize + #autosize="cdkTextareaAutosize" + cdkAutosizeMinRows="3" + cdkAutosizeMaxRows="5"> + +
+
+ @if (option.stage == DecisionEnum.Approved || option.stage == DecisionEnum.ApprovedWithExclusions) { +
+
+

+ Amendment Approved Date +

+ + + MM/DD/YYYY + + + +
+
+
+
+
+

+ EMCR Decision Comments +

+ + + +
+
+ } +
+
Project Extension
+
+
+
+

+ Request for Project Deadline Extention +

+ + + +
+
+

+ Amended Project Deadline Date +

+ + + MM/DD/YYYY + + + +
+ @if (option.stage == DecisionEnum.Approved || option.stage == DecisionEnum.ApprovedWithExclusions) { +
+

+ Deadline Extension Approved +

+ + + +
+
+

+ Amended 18 Month Deadline +

+ + -
Additional Costs

-
-
-

- Request for Additional Project Cost -

- - - -
-
-

- Estimated Additional Project Cost -

- - -
- - CA$ + > + MM/DD/YYYY + + + +
+ } +
+ +
+
Additional Costs
+
+
+
+

+ Request for Additional Project Cost +

+ + +
- - -
-
-

- Additional Project Cost Decision -

- - - -
-
-

- Approved Additional Project Cost -

- - -
- - CA$ +
+

+ Estimated Additional Project Cost +

+ + +
+ + CA$ +
+ +
- - -
-
+ @if (option.stage == DecisionEnum.Approved || option.stage == DecisionEnum.ApprovedWithExclusions) { +
+

+ Additional Project Cost Decision +

+ + + +
+
+

+ Approved Additional Project Cost +

+ + +
+ + CA$ +
+
+
+ } +
+ +
+ +
-
-
- +
diff --git a/dfa-public/src/UI/embc-dfa/src/app/feature-components/dfa-project-amendment/dfa-project-amendment.component.ts b/dfa-public/src/UI/embc-dfa/src/app/feature-components/dfa-project-amendment/dfa-project-amendment.component.ts index 1a96c04ed..cf28751f0 100644 --- a/dfa-public/src/UI/embc-dfa/src/app/feature-components/dfa-project-amendment/dfa-project-amendment.component.ts +++ b/dfa-public/src/UI/embc-dfa/src/app/feature-components/dfa-project-amendment/dfa-project-amendment.component.ts @@ -45,6 +45,7 @@ import { MatTooltipModule } from '@angular/material/tooltip'; import { DFAProjectMainMappingService } from '../dfa-project-main/dfa-project-main-mapping.service'; import { ProjectAmendment } from '../../core/model/dfa-project-main.model'; import { DFAGeneralInfoDialogComponent } from '../../core/components/dialog-components/dfa-general-info-dialog/dfa-general-info-dialog.component'; +import { Decision } from 'src/app/models/decision.enum'; @Component({ @@ -93,6 +94,7 @@ export class DFAProjectAmendmentComponent statusBar?: null | Array; isErrorInStatus?: null | boolean; projectName = ''; + DecisionEnum = Decision; constructor( //@Inject('formBuilder') formBuilder: UntypedFormBuilder, @@ -115,21 +117,21 @@ export class DFAProjectAmendmentComponent } ngOnInit(): void { - + this.projectAmendmentForm$ = this.formCreationService .getProjectAmendmentForm() .subscribe((projectAmendment) => { this.projectAmendmentForm = projectAmendment; }); - + this.appId = this.dfaProjectMainDataService.getApplicationId(); //this.route.snapshot.paramMap.get('id'); this.projectId = this.dfaProjectMainDataService.getProjectId(); this.applicationNumber = 'Application'; this.getApplicationDetials(this.appId); this.getRecoveryPlan(this.projectId); this.getAmendmentDetials(this.projectId); - + this.dfaProjectMainDataService.setApplicationId(this.appId); this.disableFormfields(); } @@ -149,7 +151,7 @@ export class DFAProjectAmendmentComponent this.projectAmendmentForm.controls.additionalProjectCostDecision.disable(); this.projectAmendmentForm.controls.approvedAdditionalProjectCost.disable(); } - + getApplicationDetials(applicationId: string) { if (applicationId) { this.applicationService.applicationGetApplicationDetailsForProject({ applicationId: applicationId }).subscribe({ @@ -243,7 +245,7 @@ export class DFAProjectAmendmentComponent if (dfaAmendment) { var amendmentId = this.projectAmendmentForm.controls.amendmentId.value; this.ProjectAmendments = dfaAmendment; - + if (dfaAmendment && dfaAmendment.length > 0) { var selectedAmendment = dfaAmendment.filter(m => m.amendmentId == amendmentId); if (selectedAmendment.length > 0) { @@ -256,13 +258,13 @@ export class DFAProjectAmendmentComponent else { let noAmendment = 'No amendment found for the project!
Click \'Close\' button to go back to Project Dashboard'; this.ConfirmAndGoBack(noAmendment); - + } } else { let noAmendment = 'No amendment found for the project!
Click \'Close\' button to go back to Project Dashboard'; this.ConfirmAndGoBack(noAmendment); - + } }, @@ -357,7 +359,7 @@ export class DFAProjectAmendmentComponent else { this.isErrorInStatus = true; } - + //this.mapData(lstDataModified); @@ -374,7 +376,7 @@ export class DFAProjectAmendmentComponent } ngAfterViewInit(): void { - + } } diff --git a/dfa-public/src/UI/embc-dfa/src/app/models/decision.enum.ts b/dfa-public/src/UI/embc-dfa/src/app/models/decision.enum.ts index 2453cf0fd..f63f6dca4 100644 --- a/dfa-public/src/UI/embc-dfa/src/app/models/decision.enum.ts +++ b/dfa-public/src/UI/embc-dfa/src/app/models/decision.enum.ts @@ -1,6 +1,6 @@ export enum Decision { Approved = 'Approved', - ApprovedwithExclusions = 'Approved with Exclusions', + ApprovedWithExclusions = 'Approved with Exclusions', Ineligible = 'Ineligible', Withdrawn = 'Withdrawn', -} \ No newline at end of file +}