Skip to content

Commit

Permalink
update condition pill instantly when updating or deleting dates
Browse files Browse the repository at this point in the history
  • Loading branch information
Abradat committed Dec 18, 2024
1 parent 0f509af commit d174e0b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export class ConditionComponent implements OnInit, AfterViewInit {
constructor(
private conditionService: ApplicationDecisionConditionService,
private conditionLotService: ApplicationDecisionComponentToConditionLotService,
private decisionService: ApplicationDecisionV2Service,
) {}

async ngOnInit() {
Expand Down Expand Up @@ -290,6 +291,9 @@ export class ConditionComponent implements OnInit, AfterViewInit {
this.dataSource = new MatTableDataSource<ApplicationDecisionConditionDateWithIndex>(
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');
}
Expand All @@ -305,6 +309,9 @@ export class ConditionComponent implements OnInit, AfterViewInit {
this.dataSource = new MatTableDataSource<ApplicationDecisionConditionDateWithIndex>(
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);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ export class ConditionComponent implements OnInit, AfterViewInit {
dataSource: MatTableDataSource<NoticeOfIntentDecisionConditionDateWithIndex> =
new MatTableDataSource<NoticeOfIntentDecisionConditionDateWithIndex>();

constructor(private conditionService: NoticeOfIntentDecisionConditionService) {}
constructor(
private conditionService: NoticeOfIntentDecisionConditionService,
private decisionService: NoticeOfIntentDecisionV2Service,
) {}

async ngOnInit() {
this.stringIndex = countToString(this.index);
Expand Down Expand Up @@ -206,6 +209,10 @@ export class ConditionComponent implements OnInit, AfterViewInit {
this.dataSource = new MatTableDataSource<NoticeOfIntentDecisionConditionDateWithIndex>(
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');
}
Expand All @@ -221,6 +228,10 @@ export class ConditionComponent implements OnInit, AfterViewInit {
this.dataSource = new MatTableDataSource<NoticeOfIntentDecisionConditionDateWithIndex>(
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);
}
}
}
Expand Down

0 comments on commit d174e0b

Please sign in to comment.