From b35206fe46394f11305cc97b46395d7fa13c19ad Mon Sep 17 00:00:00 2001 From: sp90 Date: Tue, 5 Nov 2024 11:34:52 +0100 Subject: [PATCH] Be able to remove advanced fields from destinations --- src/app/backup/backup.state.ts | 28 ++ .../destination/destination.component.html | 400 +++++++++--------- .../destination/destination.component.scss | 11 + .../destination/destination.component.ts | 16 +- .../toggle-card/toggle-card.component.scss | 4 + 5 files changed, 251 insertions(+), 208 deletions(-) diff --git a/src/app/backup/backup.state.ts b/src/app/backup/backup.state.ts index accda3d..2a58f3e 100644 --- a/src/app/backup/backup.state.ts +++ b/src/app/backup/backup.state.ts @@ -99,6 +99,34 @@ export class BackupState { .filter((x) => this.selectedAdvancedOptions()?.findIndex((y) => y.name === x.Name) === -1); }); + addAdvancedFormPair(item: FormView) { + this.selectedAdvancedFormPair.update((y) => { + y.push(item); + + return y; + }); + + this.notSelectedAdvancedFormPair.update((y) => { + y = y.filter((x) => x.name !== item.name); + + return y; + }); + } + + removeAdvancedFormPair(item: FormView) { + this.notSelectedAdvancedFormPair.update((y) => { + y.push(item); + + return y; + }); + + this.selectedAdvancedFormPair.update((y) => { + y = y.filter((x) => x.name !== item.name); + + return y; + }); + } + init(id: 'new' | 'string' = 'new', isDraft = false) { this.backupId.set(id); diff --git a/src/app/backup/destination/destination.component.html b/src/app/backup/destination/destination.component.html index 66a193c..364c81a 100644 --- a/src/app/backup/destination/destination.component.html +++ b/src/app/backup/destination/destination.component.html @@ -150,212 +150,220 @@

Google Drive

} - - @if (item.destination.type === 'file-tree') { - - - - - } @else if (item.destination.type === 'String' || item.destination.type === 'Path') { - - - - - - @if (item.destination.type === 'Path') { - link - } @else { - textbox - } - - } @else if (item.destination.type === 'Password') { - - - - - @if (item.oauthField === item.destination.name) { - AuthID - } @else { - password - } - @if ($any(item.destination).showPassword) { - - eye - - } @else { - - eye-slash - - } - - } @else if (item.destination.type === 'Enumeration') { - -