From c01a3c8116dc6458594fb63afb4475a90282c803 Mon Sep 17 00:00:00 2001 From: Thomas Kleinke Date: Wed, 27 Apr 2022 12:22:27 +0200 Subject: [PATCH 1/5] Fix isValuelistChanged for fields without previously set valuelist --- .../configuration/editor/field-editor-modal.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop/src/app/components/configuration/editor/field-editor-modal.component.ts b/desktop/src/app/components/configuration/editor/field-editor-modal.component.ts index 0b5537ce72..526c2ffa9f 100644 --- a/desktop/src/app/components/configuration/editor/field-editor-modal.component.ts +++ b/desktop/src/app/components/configuration/editor/field-editor-modal.component.ts @@ -291,7 +291,7 @@ export class FieldEditorModalComponent extends ConfigurationEditorModalComponent private isValuelistChanged(): boolean { return !equal(this.getCustomFormDefinition().valuelists ?? {})(this.getClonedFormDefinition().valuelists ?? {}) - && this.field.valuelist.id !== this.getClonedFormDefinition().valuelists[this.field.name]; + && this.field.valuelist?.id !== this.getClonedFormDefinition().valuelists[this.field.name]; } From f09223c15184fb49a9ece207ff82115a133ad0d6 Mon Sep 17 00:00:00 2001 From: Thomas Kleinke Date: Wed, 27 Apr 2022 12:51:03 +0200 Subject: [PATCH 2/5] Delete valuelist entry when deleting field --- core/src/model/configuration-document.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/src/model/configuration-document.ts b/core/src/model/configuration-document.ts index 840872d154..43267fa2f1 100644 --- a/core/src/model/configuration-document.ts +++ b/core/src/model/configuration-document.ts @@ -323,5 +323,10 @@ export namespace ConfigurationDocument { if (groupDefinition.fields.length === 0) { formDefinition.groups.splice(formDefinition.groups.indexOf(groupDefinition), 1); } + + if (formDefinition.valuelists?.[fieldName]) { + delete formDefinition.valuelists[fieldName]; + if (isEmpty(formDefinition.valuelists)) delete formDefinition.valuelists; + } } } From 008dc787120311632c7d45cec6b478e29f995f82 Mon Sep 17 00:00:00 2001 From: Thomas Kleinke Date: Wed, 27 Apr 2022 14:32:22 +0200 Subject: [PATCH 3/5] Do not try to download files if no file variants are selected --- .../project/download-project.component.ts | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/desktop/src/app/components/project/download-project.component.ts b/desktop/src/app/components/project/download-project.component.ts index ef5c602fe7..4a488a5c15 100644 --- a/desktop/src/app/components/project/download-project.component.ts +++ b/desktop/src/app/components/project/download-project.component.ts @@ -77,17 +77,19 @@ export class DownloadProjectComponent { const destroyExisting: boolean = !this.settingsProvider.getSettings().dbs.includes(this.projectName); try { - const databaseSteps = await this.getUpdateSequence(); + const databaseSteps: number = await this.getUpdateSequence(); + const variants: Array = this.getSelectedFileSync(); - const fileList = await this.remoteImageStore.getFileInfosUsingCredentials( - this.url, - this.password, - this.projectName, - this.getSelectedFileSync() - ); + const fileList = variants.length > 0 + ? await this.remoteImageStore.getFileInfosUsingCredentials( + this.url, + this.password, + this.projectName, + variants + ) : undefined; await this.syncDatabase(progressModalRef, databaseSteps, destroyExisting); - await this.syncFiles(progressModalRef, fileList); + if (fileList) await this.syncFiles(progressModalRef, fileList); this.settingsService.addProject( this.projectName, @@ -95,7 +97,7 @@ export class DownloadProjectComponent { isSyncActive: true, address: this.url, password: this.password, - activeFileSync: this.getSelectedFileSync() + activeFileSync: variants } ).then(() => { reloadAndSwitchToHomeRoute(); From fd320dd85e0b8b419602fc4fe9d38b47f18dbce9 Mon Sep 17 00:00:00 2001 From: Thomas Kleinke Date: Wed, 27 Apr 2022 14:33:26 +0200 Subject: [PATCH 4/5] Adjust spinner position in download project progress modal --- .../app/components/project/download-project-progress-modal.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop/src/app/components/project/download-project-progress-modal.scss b/desktop/src/app/components/project/download-project-progress-modal.scss index f5290ddf87..aa1a47b211 100644 --- a/desktop/src/app/components/project/download-project-progress-modal.scss +++ b/desktop/src/app/components/project/download-project-progress-modal.scss @@ -4,7 +4,7 @@ .spinner { position: relative; - left: 5px; + left: 7px; } .replication-progress { From ce0ff64c177681dd6d4589c3100c83b82429b18d Mon Sep 17 00:00:00 2001 From: Thomas Kleinke Date: Wed, 27 Apr 2022 15:10:23 +0200 Subject: [PATCH 5/5] Add field imageRights to Image category & form Image:default --- core/config/Config-Ayamonte.json | 6 ------ core/config/Language-Ayamonte.de.json | 6 ------ core/config/Language-Ayamonte.en.json | 6 ------ core/config/Language-Ayamonte.es.json | 6 ------ core/config/Library/Forms.json | 2 +- core/config/Library/Language.de.json | 3 +++ core/config/Library/Language.en.json | 3 +++ core/config/Library/Language.es.json | 7 +++++++ core/src/configuration/built-in-configuration.ts | 3 +++ 9 files changed, 17 insertions(+), 25 deletions(-) diff --git a/core/config/Config-Ayamonte.json b/core/config/Config-Ayamonte.json index 5287bf5e3b..fb867eb618 100644 --- a/core/config/Config-Ayamonte.json +++ b/core/config/Config-Ayamonte.json @@ -1796,9 +1796,6 @@ "imageObject": { "inputType": "input" }, - "imageRights": { - "inputType": "input" - }, "imageContent": { "inputType": "input" } @@ -1833,9 +1830,6 @@ "Drawing:default": { "hidden": [], "fields": { - "imageRights": { - "inputType": "input" - }, "representedObject": { "inputType": "input" } diff --git a/core/config/Language-Ayamonte.de.json b/core/config/Language-Ayamonte.de.json index 09f92caa7a..d5a39169de 100644 --- a/core/config/Language-Ayamonte.de.json +++ b/core/config/Language-Ayamonte.de.json @@ -36,9 +36,6 @@ }, "Drawing": { "fields": { - "imageRights": { - "label": "Bildrechte" - }, "representedObject": { "label": "Darstellungsgegenstand" } @@ -232,9 +229,6 @@ "imageObject": { "label": "Bildgegenstand" }, - "imageRights": { - "label": "Bildrechte" - }, "imageContent": { "label": "Bildinhalt" } diff --git a/core/config/Language-Ayamonte.en.json b/core/config/Language-Ayamonte.en.json index 7a99ed3292..0c4a120f20 100644 --- a/core/config/Language-Ayamonte.en.json +++ b/core/config/Language-Ayamonte.en.json @@ -35,9 +35,6 @@ }, "Drawing": { "fields": { - "imageRights": { - "label": "Image Rights" - }, "representedObject": { "label": "Represented object" } @@ -237,9 +234,6 @@ "imageObject": { "label": "Depicted object" }, - "imageRights": { - "label": "Image rights" - }, "imageContent": { "label": "Content of the image" } diff --git a/core/config/Language-Ayamonte.es.json b/core/config/Language-Ayamonte.es.json index 6779d06ec0..d80b6856a0 100644 --- a/core/config/Language-Ayamonte.es.json +++ b/core/config/Language-Ayamonte.es.json @@ -43,9 +43,6 @@ }, "Drawing": { "fields": { - "imageRights": { - "label": "Derechos de autor de la imagen" - }, "representedObject": { "label": "Objeto representado" } @@ -239,9 +236,6 @@ "imageObject": { "label": "Objeto representado" }, - "imageRights": { - "label": "Derechos de autor de la imagen" - }, "imageContent": { "label": "Contenido de la imagen" } diff --git a/core/config/Library/Forms.json b/core/config/Library/Forms.json index cf22deeb4c..39d23f0a7d 100644 --- a/core/config/Library/Forms.json +++ b/core/config/Library/Forms.json @@ -385,7 +385,7 @@ }, { "name": "properties", - "fields": ["description", "height", "width", "literature"] + "fields": ["description", "height", "width", "literature", "imageRights"] } ] }, diff --git a/core/config/Library/Language.de.json b/core/config/Library/Language.de.json index 408f2c8c71..ade90c96e7 100644 --- a/core/config/Library/Language.de.json +++ b/core/config/Library/Language.de.json @@ -751,6 +751,9 @@ }, "processor": { "label": "Bearbeiterin/Bearbeiter" + }, + "imageRights": { + "label": "Bildrechte" } } }, diff --git a/core/config/Library/Language.en.json b/core/config/Library/Language.en.json index b63d458246..27d3c964d5 100644 --- a/core/config/Library/Language.en.json +++ b/core/config/Library/Language.en.json @@ -668,6 +668,9 @@ "processor": { "label": "Processor", "description": "Processor of the image in case of changes after the creation of the image" + }, + "imageRights": { + "label": "Image rights" } } }, diff --git a/core/config/Library/Language.es.json b/core/config/Library/Language.es.json index e3e87ca80d..8958da681d 100644 --- a/core/config/Library/Language.es.json +++ b/core/config/Library/Language.es.json @@ -312,6 +312,13 @@ "PlasterFragment": { "label": "Fragmento de enfoscado" }, + "Image": { + "fields": { + "imageRights": { + "label": "Derechos de autor de la imagen" + } + } + }, "Photo": { "label": "FotografĂ­a" }, diff --git a/core/src/configuration/built-in-configuration.ts b/core/src/configuration/built-in-configuration.ts index 5f30e5d970..f6c63fefba 100644 --- a/core/src/configuration/built-in-configuration.ts +++ b/core/src/configuration/built-in-configuration.ts @@ -539,6 +539,9 @@ export class BuiltInConfiguration { inputType: Field.InputType.CHECKBOXES, valuelistFromProjectField: 'staff', constraintIndexed: true + }, + imageRights: { + inputType: Field.InputType.INPUT } }, minimalForm: {