hasActiveInput(): boolean {
return this.batchAttrs.filter(attr => attr.editing).length > 0;
}
+
+ applyPendingChanges() {
+ // If a user has left any changes in the 'editing' state, this
+ // will go through and apply the values so they do not have to
+ // click Apply for every one.
+ this.batchAttrs.filter(attr => attr.editing).forEach(attr => attr.save());
+ }
}
</ng-container>
<div class="flex-1"> </div>
- <button class="btn btn-outline-dark" (click)="save()"
+ <button class="btn btn-outline-dark" (click)="save(false, true)"
[ngClass]="{'border-danger': isNotSaveable()}"
- [disabled]="isNotSaveable()" i18n>Save</button>
- <button class="btn btn-outline-dark ml-2" (click)="save(true)"
+ [disabled]="isNotSaveable()" i18n>Apply All & Save</button>
+ <button class="btn btn-outline-dark ml-2" (click)="save(true, true)"
[ngClass]="{'border-danger': isNotSaveable()}"
- [disabled]="isNotSaveable()" i18n>Save & Exit</button>
+ [disabled]="isNotSaveable()" i18n>Apply All, Save & Exit</button>
</div>
</div>
</ng-container>
save(close?: boolean): Promise<any> {
this.loading = true;
+ this.copyAttrs.applyPendingChanges();
+
// Volume update API wants volumes fleshed with copies, instead
// of the other way around, which is what we have here.
const volumes: IdlObject[] = [];