Skip to content

Commit eca6a76

Browse files
sarkapalkovicovaHejdaJakub
authored andcommitted
fix(admin): disable force propagation button
If a blocked service is selected, then the force propagation button is disabled.
1 parent 589744e commit eca6a76

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

apps/admin-gui/src/app/facilities/pages/facility-detail-page/facility-service-status/facility-service-status.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ <h1 class="page-subtitle">{{'FACILITY_DETAIL.SERVICES_STATUS.TITLE' | translate}
44
<button
55
*ngIf="propagationAuth"
66
(click)="forcePropagation()"
7-
[disabled]="selected.selected.length === 0 || loading"
7+
[disabled]="selected.selected.length === 0 || this.disableForcePropagationButton || loading"
88
class="me-2"
99
color="accent"
1010
mat-flat-button>

apps/admin-gui/src/app/facilities/pages/facility-detail-page/facility-service-status/facility-service-status.component.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export class FacilityServiceStatusComponent implements OnInit {
3939
disableAllowButton = true;
4040
disableBlockButton = true;
4141
disableRemoveButton = true;
42+
disableForcePropagationButton = false;
4243
taskIsNull: boolean;
4344
taskId: number;
4445

@@ -87,7 +88,7 @@ export class FacilityServiceStatusComponent implements OnInit {
8788
this.servicesManager.unblockServicesOnFacility(serviceIds, this.facility.id).subscribe({
8889
next: () => {
8990
this.notificator.showInstantSuccess('FACILITY_DETAIL.SERVICES_STATUS.SUCCESS_ALLOW');
90-
this.loading = false;
91+
this.refreshTable();
9192
},
9293
error: () => {
9394
this.loading = false;
@@ -100,7 +101,7 @@ export class FacilityServiceStatusComponent implements OnInit {
100101
this.servicesManager.blockServicesOnFacility(serviceIds, this.facility.id).subscribe({
101102
next: () => {
102103
this.notificator.showInstantSuccess('FACILITY_DETAIL.SERVICES_STATUS.SUCCESS_BLOCK');
103-
this.loading = false;
104+
this.refreshTable();
104105
},
105106
error: () => {
106107
this.loading = false;
@@ -215,6 +216,7 @@ export class FacilityServiceStatusComponent implements OnInit {
215216
this.disableBlockButton = true;
216217
this.disableAllowButton = true;
217218
this.disableRemoveButton = this.selected.selected.length !== 1;
219+
this.disableForcePropagationButton = false;
218220

219221
if (!this.disableRemoveButton) {
220222
this.taskIsNull = this.selected.selected[0].task === null;
@@ -223,6 +225,7 @@ export class FacilityServiceStatusComponent implements OnInit {
223225
for (const ss of this.selected.selected) {
224226
if (ss.blockedOnFacility) {
225227
this.disableAllowButton = false;
228+
this.disableForcePropagationButton = true;
226229
} else {
227230
this.disableBlockButton = false;
228231
}

0 commit comments

Comments
 (0)