From 59ebd9c8eac578ae058f9961b736456157eb206a Mon Sep 17 00:00:00 2001 From: Armin Isenring Date: Wed, 22 Feb 2023 15:14:45 +0100 Subject: [PATCH] button enable/disable fixed, version updated --- package.json | 2 +- src/app/cache-reset/cache-reset.component.html | 2 +- src/app/cache-reset/cache-reset.component.ts | 7 +++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 3c21311..d7c3c10 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "title": "cc-management-ui", "name": "cc-management-ui", - "version": "4.11.2", + "version": "4.11.4", "scripts": { "start": "ng serve", "build": "ng build", diff --git a/src/app/cache-reset/cache-reset.component.html b/src/app/cache-reset/cache-reset.component.html index cc159cf..ac4b80a 100644 --- a/src/app/cache-reset/cache-reset.component.html +++ b/src/app/cache-reset/cache-reset.component.html @@ -9,7 +9,7 @@

{{ "cache.reset.title" | translate }}

{{ item.value }} - diff --git a/src/app/cache-reset/cache-reset.component.ts b/src/app/cache-reset/cache-reset.component.ts index 5a9343b..9802a91 100644 --- a/src/app/cache-reset/cache-reset.component.ts +++ b/src/app/cache-reset/cache-reset.component.ts @@ -11,11 +11,13 @@ type Checklist = {value: Caches; isSelected: boolean}[]; export class CacheResetComponent { masterSelected: boolean; indeterminate: boolean; + allUnselected: boolean; checklist: Checklist; constructor(private readonly cacheResetService: CacheResetService) { this.masterSelected = false; this.indeterminate = false; + this.allUnselected = true; this.checklist = [ {value: Caches.KeyIdentifier, isSelected: false}, {value: Caches.SigningInformation, isSelected: false}, @@ -38,16 +40,17 @@ export class CacheResetComponent { for (const value of this.checklist) { value.isSelected = this.masterSelected; } + this.allUnselected = !this.masterSelected; this.indeterminate = false; } isAllSelected() { - const allUnselected = this.checklist.every(item => !item.isSelected); + this.allUnselected = this.checklist.every(item => !item.isSelected); const allSelected = this.checklist.every(item => item.isSelected); if (allSelected) { this.masterSelected = true; this.indeterminate = false; - } else if (allUnselected) { + } else if (this.allUnselected) { this.masterSelected = false; this.indeterminate = false; } else {