diff --git a/.gitignore b/.gitignore index 830e820cf..aecd72563 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ libs/js_engine/src/artifacts/ARM_JS_SNAPSHOT.bin libs/js_engine/src/artifacts/JS_SNAPSHOT.bin deploy_web.sh secrets.db +.vscode/ diff --git a/frontend/projects/ui/src/app/modals/backup-select/backup-select.page.html b/frontend/projects/ui/src/app/modals/backup-select/backup-select.page.html index 8ad5ff221..d684825fe 100644 --- a/frontend/projects/ui/src/app/modals/backup-select/backup-select.page.html +++ b/frontend/projects/ui/src/app/modals/backup-select/backup-select.page.html @@ -11,6 +11,13 @@ + + + + {{ selectAll ? 'Select All' : 'Deselect All' }} + + + diff --git a/frontend/projects/ui/src/app/modals/backup-select/backup-select.page.ts b/frontend/projects/ui/src/app/modals/backup-select/backup-select.page.ts index 78a2de8e3..7c817a4f9 100644 --- a/frontend/projects/ui/src/app/modals/backup-select/backup-select.page.ts +++ b/frontend/projects/ui/src/app/modals/backup-select/backup-select.page.ts @@ -12,6 +12,7 @@ import { PatchDbService } from 'src/app/services/patch-db/patch-db.service' export class BackupSelectPage { hasSelection = false error: string | IonicSafeString = '' + selectAll = true pkgs: { id: string title: string @@ -58,4 +59,9 @@ export class BackupSelectPage { handleChange() { this.hasSelection = this.pkgs.some(p => p.checked) } + + toggleSelectAll() { + this.pkgs.forEach(pkg => (pkg.checked = this.selectAll)) + this.selectAll = !this.selectAll + } } diff --git a/frontend/projects/ui/src/app/modals/enum-list/enum-list.page.html b/frontend/projects/ui/src/app/modals/enum-list/enum-list.page.html index e31202a87..6fb341132 100644 --- a/frontend/projects/ui/src/app/modals/enum-list/enum-list.page.html +++ b/frontend/projects/ui/src/app/modals/enum-list/enum-list.page.html @@ -11,10 +11,10 @@ - + - {{ selectAll ? 'All' : 'None' }} + {{ selectAll ? 'Select All' : 'Deselect All' }} diff --git a/frontend/projects/ui/src/app/modals/enum-list/enum-list.page.ts b/frontend/projects/ui/src/app/modals/enum-list/enum-list.page.ts index a9eba7074..4f6e0106e 100644 --- a/frontend/projects/ui/src/app/modals/enum-list/enum-list.page.ts +++ b/frontend/projects/ui/src/app/modals/enum-list/enum-list.page.ts @@ -12,7 +12,7 @@ export class EnumListPage { @Input() spec: ValueSpecListOf<'enum'> @Input() current: string[] options: { [option: string]: boolean } = {} - selectAll = true + selectAll = false constructor(private readonly modalCtrl: ModalController) {} @@ -20,6 +20,8 @@ export class EnumListPage { for (let val of this.spec.spec.values) { this.options[val] = this.current.includes(val) } + // if none are selected, set selectAll to true + this.selectAll = Object.values(this.options).some(k => !k) } dismiss() {