Commits

Tim Donohue authored and GitHub committed 7714ef47c87 Merge
Merge pull request #1245 from 4Science/#1122

Disable community/collection delete button while the delete operation is being processed
No tags
gidlmaster

src/app/+collection-page/delete-collection-page/delete-collection-page.component.html

Modified
1 1 <div class="container">
2 2 <div class="row">
3 3 <ng-container *ngVar="(dsoRD$ | async)?.payload as dso">
4 4 <div class="col-12 pb-4">
5 5 <h2 id="header" class="border-bottom pb-2">{{ 'collection.delete.head' | translate}}</h2>
6 6 <p class="pb-2">{{ 'collection.delete.text' | translate:{ dso: dso.name } }}</p>
7 7 <div class="form-group row">
8 8 <div class="col text-right">
9 - <button class="btn btn-outline-secondary" (click)="onCancel(dso)">
9 + <button class="btn btn-outline-secondary" (click)="onCancel(dso)" [disabled]="(processing$ | async)">
10 10 <i class="fas fa-times"></i> {{'collection.delete.cancel' | translate}}
11 11 </button>
12 - <button class="btn btn-danger mr-2" (click)="onConfirm(dso)">
13 - <i class="fas fa-trash"></i> {{'collection.delete.confirm' | translate}}
12 + <button class="btn btn-danger mr-2" (click)="onConfirm(dso)" [disabled]="(processing$ | async)">
13 + <span *ngIf="processing$ | async"><i class='fas fa-circle-notch fa-spin'></i> {{'collection.delete.processing' | translate}}</span>
14 + <span *ngIf="!(processing$ | async)"><i class="fas fa-trash"></i> {{'collection.delete.confirm' | translate}}</span>
14 15 </button>
15 16 </div>
16 17 </div>
17 18 </div>
18 19 </ng-container>
19 20
20 21 </div>
21 22
22 23 </div>

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut