From d174e0b31cf50a81aeeadf6a3b06d9258d11a18e Mon Sep 17 00:00:00 2001 From: Shayan Khorsandi Date: Tue, 17 Dec 2024 16:22:00 -0800 Subject: [PATCH] update condition pill instantly when updating or deleting dates --- .../conditions/condition/condition.component.ts | 7 +++++++ .../conditions/condition/condition.component.ts | 13 ++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/alcs-frontend/src/app/features/application/decision/conditions/condition/condition.component.ts b/alcs-frontend/src/app/features/application/decision/conditions/condition/condition.component.ts index a45a2eccb..b982928d6 100644 --- a/alcs-frontend/src/app/features/application/decision/conditions/condition/condition.component.ts +++ b/alcs-frontend/src/app/features/application/decision/conditions/condition/condition.component.ts @@ -81,6 +81,7 @@ export class ConditionComponent implements OnInit, AfterViewInit { constructor( private conditionService: ApplicationDecisionConditionService, private conditionLotService: ApplicationDecisionComponentToConditionLotService, + private decisionService: ApplicationDecisionV2Service, ) {} async ngOnInit() { @@ -290,6 +291,9 @@ export class ConditionComponent implements OnInit, AfterViewInit { this.dataSource = new MatTableDataSource( this.addIndex(this.sortDates(this.dates)), ); + const conditionNewStatus = await this.decisionService.getStatus(this.condition.uuid); + this.condition.status = conditionNewStatus.status; + this.setPillLabel(this.condition.status); } else { console.error('Date with specified UUID not found'); } @@ -305,6 +309,9 @@ export class ConditionComponent implements OnInit, AfterViewInit { this.dataSource = new MatTableDataSource( this.addIndex(this.sortDates(this.dates)), ); + const conditionNewStatus = await this.decisionService.getStatus(this.condition.uuid); + this.condition.status = conditionNewStatus.status; + this.setPillLabel(this.condition.status); } } } diff --git a/alcs-frontend/src/app/features/notice-of-intent/decision/conditions/condition/condition.component.ts b/alcs-frontend/src/app/features/notice-of-intent/decision/conditions/condition/condition.component.ts index dc401865a..251c60c68 100644 --- a/alcs-frontend/src/app/features/notice-of-intent/decision/conditions/condition/condition.component.ts +++ b/alcs-frontend/src/app/features/notice-of-intent/decision/conditions/condition/condition.component.ts @@ -68,7 +68,10 @@ export class ConditionComponent implements OnInit, AfterViewInit { dataSource: MatTableDataSource = new MatTableDataSource(); - constructor(private conditionService: NoticeOfIntentDecisionConditionService) {} + constructor( + private conditionService: NoticeOfIntentDecisionConditionService, + private decisionService: NoticeOfIntentDecisionV2Service, + ) {} async ngOnInit() { this.stringIndex = countToString(this.index); @@ -206,6 +209,10 @@ export class ConditionComponent implements OnInit, AfterViewInit { this.dataSource = new MatTableDataSource( this.addIndex(this.sortDates(this.dates)), ); + + const conditionNewStatus = await this.decisionService.getStatus(this.condition.uuid); + this.condition.status = conditionNewStatus.status; + this.setPillLabel(this.condition.status); } else { console.error('Date with specified UUID not found'); } @@ -221,6 +228,10 @@ export class ConditionComponent implements OnInit, AfterViewInit { this.dataSource = new MatTableDataSource( this.addIndex(this.sortDates(this.dates)), ); + + const conditionNewStatus = await this.decisionService.getStatus(this.condition.uuid); + this.condition.status = conditionNewStatus.status; + this.setPillLabel(this.condition.status); } } }