From d11aa91167522976bea89d32c2dab93a59d06f3d Mon Sep 17 00:00:00 2001 From: Sofia Papacharalampous Date: Fri, 21 Jun 2024 12:39:42 +0300 Subject: [PATCH] 1. translations sync 2. bug fix on description edtor toc-error-indication 3. fixed translations on multiplicity fields "add more" 4. fixed checkbox field error validation --- .../components/form-field-set/form-field-set.component.html | 5 ++++- .../components/form-field/form-field.component.html | 3 ++- .../components/form-field/form-field.component.ts | 5 +++++ .../form-progress-indication.component.html | 2 +- .../form-progress-indication.component.ts | 2 ++ .../table-of-contents-internal.ts | 6 +++--- dmp-frontend/src/assets/i18n/baq.json | 6 +++++- dmp-frontend/src/assets/i18n/de.json | 6 +++++- dmp-frontend/src/assets/i18n/en.json | 1 + dmp-frontend/src/assets/i18n/es.json | 6 +++++- dmp-frontend/src/assets/i18n/gr.json | 6 +++++- dmp-frontend/src/assets/i18n/hr.json | 6 +++++- dmp-frontend/src/assets/i18n/pl.json | 6 +++++- dmp-frontend/src/assets/i18n/pt.json | 6 +++++- dmp-frontend/src/assets/i18n/sk.json | 6 +++++- dmp-frontend/src/assets/i18n/sr.json | 6 +++++- dmp-frontend/src/assets/i18n/tr.json | 6 +++++- 17 files changed, 68 insertions(+), 16 deletions(-) diff --git a/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field-set/form-field-set.component.html b/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field-set/form-field-set.component.html index bcf9bb69f..7d94b1b7f 100644 --- a/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field-set/form-field-set.component.html +++ b/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field-set/form-field-set.component.html @@ -40,7 +40,10 @@ add_circle {{fieldSet.multiplicity.placeholder}} - {{('DESCRIPTION-EDITOR.ACTIONS.MULTIPLICITY-ADD-ONE-FIELD' + (fieldSet.multiplicity?.tableView?'-TABLEVIEW':'')) | translate}} + {{'DESCRIPTION-EDITOR.ACTIONS.MULTIPLICITY-ADD-ONE-FIELD' | translate}} + + {{'DESCRIPTION-EDITOR.ACTIONS.MULTIPLICITY-ADD-ONE-FIELD-TABLEVIEW' | translate}} + diff --git a/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field/form-field.component.html b/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field/form-field.component.html index 99ba45ec7..37efc9233 100644 --- a/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field/form-field.component.html +++ b/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field/form-field.component.html @@ -101,9 +101,10 @@
- + {{field.data.label}} {{propertiesFormGroup?.get(field.id).get('booleanValue').getError('backendError').message}} + {{'GENERAL.VALIDATION.REQUIRED' | translate}}
diff --git a/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field/form-field.component.ts b/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field/form-field.component.ts index 663c8d679..0099317e7 100644 --- a/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field/form-field.component.ts +++ b/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field/form-field.component.ts @@ -27,6 +27,7 @@ import { Observable } from 'rxjs'; import { distinctUntilChanged, takeUntil } from 'rxjs/operators'; import { nameof } from 'ts-simple-nameof'; import { DescriptionFormService } from '../services/description-form.service'; +import { MatCheckboxChange } from '@angular/material/checkbox'; @Component({ selector: 'app-description-form-field', @@ -268,6 +269,10 @@ export class DescriptionFormFieldComponent extends BaseComponent implements OnIn } } + checkboxChangeEvent(event: MatCheckboxChange, fieldId: string) { + if (!(event?.checked ?? true)) this.propertiesFormGroup?.get(fieldId)?.get('booleanValue')?.reset(); + } + onRemove(makeFilesNull: boolean = true) { this.makeFilesNull() this.cdr.detectChanges(); diff --git a/dmp-frontend/src/app/ui/description/editor/form-progress-indication/form-progress-indication.component.html b/dmp-frontend/src/app/ui/description/editor/form-progress-indication/form-progress-indication.component.html index 0befa13a7..666a761a2 100644 --- a/dmp-frontend/src/app/ui/description/editor/form-progress-indication/form-progress-indication.component.html +++ b/dmp-frontend/src/app/ui/description/editor/form-progress-indication/form-progress-indication.component.html @@ -1,4 +1,4 @@ -
+
{{progressSoFar}} {{'GENERAL.PREPOSITIONS.OF' | translate}} {{total}} 
diff --git a/dmp-frontend/src/app/ui/description/editor/form-progress-indication/form-progress-indication.component.ts b/dmp-frontend/src/app/ui/description/editor/form-progress-indication/form-progress-indication.component.ts index 5bf8d0374..41d2807c7 100644 --- a/dmp-frontend/src/app/ui/description/editor/form-progress-indication/form-progress-indication.component.ts +++ b/dmp-frontend/src/app/ui/description/editor/form-progress-indication/form-progress-indication.component.ts @@ -46,6 +46,8 @@ export class FormProgressIndicationComponent extends BaseComponent implements On } calculateValueForProgressbar() { + if (this.formGroup.disabled) return; + this.progressSoFar = this.countCompletedRequiredBaseFields(this.formGroup) + this.countRequiredFields(this.formGroup.get('properties'), this.checkVisibility, true); this.total = 2 + this.countRequiredFields(this.formGroup.get('properties'), this.checkVisibility); // main info contains two required fields: label and descriptionTemplateId this.percent = (this.progressSoFar / this.total) * 100; diff --git a/dmp-frontend/src/app/ui/description/editor/table-of-contents/table-of-contents-internal/table-of-contents-internal.ts b/dmp-frontend/src/app/ui/description/editor/table-of-contents/table-of-contents-internal/table-of-contents-internal.ts index 925ab96c9..6954ebab7 100644 --- a/dmp-frontend/src/app/ui/description/editor/table-of-contents/table-of-contents-internal/table-of-contents-internal.ts +++ b/dmp-frontend/src/app/ui/description/editor/table-of-contents/table-of-contents-internal/table-of-contents-internal.ts @@ -86,9 +86,9 @@ export class TableOfContentsInternal extends BaseComponent implements OnInit, On } isTocEntryValid(entry: ToCEntry): boolean { - if (entry == null) { - return true; - } + if (entry == null) return true; + + if (entry.validityAbstractControl && !entry.validityAbstractControl.touched) return true; let currentValidity = entry.validityAbstractControl?.valid ?? true; if (!currentValidity) return currentValidity; diff --git a/dmp-frontend/src/assets/i18n/baq.json b/dmp-frontend/src/assets/i18n/baq.json index 27fdf798e..2d4e7f1ab 100644 --- a/dmp-frontend/src/assets/i18n/baq.json +++ b/dmp-frontend/src/assets/i18n/baq.json @@ -946,6 +946,7 @@ "CONFIRM": "Yes", "REJECT": "No", "MULTIPLICITY-ADD-ONE-FIELD": "Add more", + "MULTIPLICITY-ADD-ONE-FIELD-TABLEVIEW": "Add row", "VIEW-MORE": "View more", "VIEW-LESS": "View less" }, @@ -1596,6 +1597,10 @@ "DISCARD-EDITED-CONFIRM": "Yes, revert changes.", "DISCARD-EDITED-DENY": "No." }, + "FINALIZE": { + "FINALIZE": "Finalize", + "CAN-NOT-FINALIZE": "Save your changes first" + }, "SAVE": "Gorde", "DELETE": "Ezabatu", "ADD-DESCRIPTION-IN-SECTION": "Add Description", @@ -1609,7 +1614,6 @@ "EXPORT": "Export", "SAVE-AND-CLOSE": "Save & Close", "SAVE-AND-CONTINUE": "Save & Continue", - "FINALIZE": "Finalize", "REVERSE": "Undo Finalization", "LOCKED": "Locked" }, diff --git a/dmp-frontend/src/assets/i18n/de.json b/dmp-frontend/src/assets/i18n/de.json index 001c46404..5566b4d08 100644 --- a/dmp-frontend/src/assets/i18n/de.json +++ b/dmp-frontend/src/assets/i18n/de.json @@ -946,6 +946,7 @@ "CONFIRM": "Yes", "REJECT": "No", "MULTIPLICITY-ADD-ONE-FIELD": "Add more", + "MULTIPLICITY-ADD-ONE-FIELD-TABLEVIEW": "Add row", "VIEW-MORE": "View more", "VIEW-LESS": "View less" }, @@ -1596,6 +1597,10 @@ "DISCARD-EDITED-CONFIRM": "Yes, revert changes.", "DISCARD-EDITED-DENY": "No." }, + "FINALIZE": { + "FINALIZE": "Finalize", + "CAN-NOT-FINALIZE": "Save your changes first" + }, "SAVE": "Speichern", "DELETE": "Löschen", "ADD-DESCRIPTION-IN-SECTION": "Add Description", @@ -1609,7 +1614,6 @@ "EXPORT": "Export", "SAVE-AND-CLOSE": "Save & Close", "SAVE-AND-CONTINUE": "Save & Continue", - "FINALIZE": "Finalize", "REVERSE": "Undo Finalization", "LOCKED": "Locked" }, diff --git a/dmp-frontend/src/assets/i18n/en.json b/dmp-frontend/src/assets/i18n/en.json index 3bf36259a..c40085378 100644 --- a/dmp-frontend/src/assets/i18n/en.json +++ b/dmp-frontend/src/assets/i18n/en.json @@ -946,6 +946,7 @@ "CONFIRM": "Yes", "REJECT": "No", "MULTIPLICITY-ADD-ONE-FIELD": "Add more", + "MULTIPLICITY-ADD-ONE-FIELD-TABLEVIEW": "Add row", "VIEW-MORE": "View more", "VIEW-LESS": "View less" }, diff --git a/dmp-frontend/src/assets/i18n/es.json b/dmp-frontend/src/assets/i18n/es.json index d94767f03..b330145fc 100644 --- a/dmp-frontend/src/assets/i18n/es.json +++ b/dmp-frontend/src/assets/i18n/es.json @@ -946,6 +946,7 @@ "CONFIRM": "Yes", "REJECT": "No", "MULTIPLICITY-ADD-ONE-FIELD": "Add more", + "MULTIPLICITY-ADD-ONE-FIELD-TABLEVIEW": "Add row", "VIEW-MORE": "View more", "VIEW-LESS": "View less" }, @@ -1596,6 +1597,10 @@ "DISCARD-EDITED-CONFIRM": "Yes, revert changes.", "DISCARD-EDITED-DENY": "No." }, + "FINALIZE": { + "FINALIZE": "Finalize", + "CAN-NOT-FINALIZE": "Save your changes first" + }, "SAVE": "Grabar", "DELETE": "Borrar", "ADD-DESCRIPTION-IN-SECTION": "Add Description", @@ -1609,7 +1614,6 @@ "EXPORT": "Export", "SAVE-AND-CLOSE": "Save & Close", "SAVE-AND-CONTINUE": "Save & Continue", - "FINALIZE": "Finalize", "REVERSE": "Undo Finalization", "LOCKED": "Locked" }, diff --git a/dmp-frontend/src/assets/i18n/gr.json b/dmp-frontend/src/assets/i18n/gr.json index 852664f14..d9d9eccce 100644 --- a/dmp-frontend/src/assets/i18n/gr.json +++ b/dmp-frontend/src/assets/i18n/gr.json @@ -946,6 +946,7 @@ "CONFIRM": "Yes", "REJECT": "No", "MULTIPLICITY-ADD-ONE-FIELD": "Add more", + "MULTIPLICITY-ADD-ONE-FIELD-TABLEVIEW": "Add row", "VIEW-MORE": "View more", "VIEW-LESS": "View less" }, @@ -1596,6 +1597,10 @@ "DISCARD-EDITED-CONFIRM": "Yes, revert changes.", "DISCARD-EDITED-DENY": "No." }, + "FINALIZE": { + "FINALIZE": "Finalize", + "CAN-NOT-FINALIZE": "Save your changes first" + }, "SAVE": "Αποθήκευση", "DELETE": "Διαγραφή", "ADD-DESCRIPTION-IN-SECTION": "Add Description", @@ -1609,7 +1614,6 @@ "EXPORT": "Export", "SAVE-AND-CLOSE": "Save & Close", "SAVE-AND-CONTINUE": "Save & Continue", - "FINALIZE": "Finalize", "REVERSE": "Undo Finalization", "LOCKED": "Locked" }, diff --git a/dmp-frontend/src/assets/i18n/hr.json b/dmp-frontend/src/assets/i18n/hr.json index ebefd4ca7..c0d1e8e4a 100644 --- a/dmp-frontend/src/assets/i18n/hr.json +++ b/dmp-frontend/src/assets/i18n/hr.json @@ -946,6 +946,7 @@ "CONFIRM": "Yes", "REJECT": "No", "MULTIPLICITY-ADD-ONE-FIELD": "Add more", + "MULTIPLICITY-ADD-ONE-FIELD-TABLEVIEW": "Add row", "VIEW-MORE": "View more", "VIEW-LESS": "View less" }, @@ -1596,6 +1597,10 @@ "DISCARD-EDITED-CONFIRM": "Yes, revert changes.", "DISCARD-EDITED-DENY": "No." }, + "FINALIZE": { + "FINALIZE": "Finalize", + "CAN-NOT-FINALIZE": "Save your changes first" + }, "SAVE": "Spremi", "DELETE": "Obriši", "ADD-DESCRIPTION-IN-SECTION": "Add Description", @@ -1609,7 +1614,6 @@ "EXPORT": "Export", "SAVE-AND-CLOSE": "Save & Close", "SAVE-AND-CONTINUE": "Save & Continue", - "FINALIZE": "Finalize", "REVERSE": "Undo Finalization", "LOCKED": "Locked" }, diff --git a/dmp-frontend/src/assets/i18n/pl.json b/dmp-frontend/src/assets/i18n/pl.json index 56ba39eda..e44dea965 100644 --- a/dmp-frontend/src/assets/i18n/pl.json +++ b/dmp-frontend/src/assets/i18n/pl.json @@ -946,6 +946,7 @@ "CONFIRM": "Yes", "REJECT": "No", "MULTIPLICITY-ADD-ONE-FIELD": "Add more", + "MULTIPLICITY-ADD-ONE-FIELD-TABLEVIEW": "Add row", "VIEW-MORE": "View more", "VIEW-LESS": "View less" }, @@ -1596,6 +1597,10 @@ "DISCARD-EDITED-CONFIRM": "Yes, revert changes.", "DISCARD-EDITED-DENY": "No." }, + "FINALIZE": { + "FINALIZE": "Finalize", + "CAN-NOT-FINALIZE": "Save your changes first" + }, "SAVE": "Zapisz", "DELETE": "Usuń", "ADD-DESCRIPTION-IN-SECTION": "Add Description", @@ -1609,7 +1614,6 @@ "EXPORT": "Export", "SAVE-AND-CLOSE": "Save & Close", "SAVE-AND-CONTINUE": "Save & Continue", - "FINALIZE": "Finalize", "REVERSE": "Undo Finalization", "LOCKED": "Locked" }, diff --git a/dmp-frontend/src/assets/i18n/pt.json b/dmp-frontend/src/assets/i18n/pt.json index bd3f0da07..1193143f8 100644 --- a/dmp-frontend/src/assets/i18n/pt.json +++ b/dmp-frontend/src/assets/i18n/pt.json @@ -946,6 +946,7 @@ "CONFIRM": "Yes", "REJECT": "No", "MULTIPLICITY-ADD-ONE-FIELD": "Add more", + "MULTIPLICITY-ADD-ONE-FIELD-TABLEVIEW": "Add row", "VIEW-MORE": "View more", "VIEW-LESS": "View less" }, @@ -1596,6 +1597,10 @@ "DISCARD-EDITED-CONFIRM": "Yes, revert changes.", "DISCARD-EDITED-DENY": "No." }, + "FINALIZE": { + "FINALIZE": "Finalize", + "CAN-NOT-FINALIZE": "Save your changes first" + }, "SAVE": "Guardar", "DELETE": "Eliminar", "ADD-DESCRIPTION-IN-SECTION": "Add Description", @@ -1609,7 +1614,6 @@ "EXPORT": "Export", "SAVE-AND-CLOSE": "Save & Close", "SAVE-AND-CONTINUE": "Save & Continue", - "FINALIZE": "Finalize", "REVERSE": "Undo Finalization", "LOCKED": "Locked" }, diff --git a/dmp-frontend/src/assets/i18n/sk.json b/dmp-frontend/src/assets/i18n/sk.json index 0989a4595..fd11c2b77 100644 --- a/dmp-frontend/src/assets/i18n/sk.json +++ b/dmp-frontend/src/assets/i18n/sk.json @@ -946,6 +946,7 @@ "CONFIRM": "Yes", "REJECT": "No", "MULTIPLICITY-ADD-ONE-FIELD": "Add more", + "MULTIPLICITY-ADD-ONE-FIELD-TABLEVIEW": "Add row", "VIEW-MORE": "View more", "VIEW-LESS": "View less" }, @@ -1596,6 +1597,10 @@ "DISCARD-EDITED-CONFIRM": "Yes, revert changes.", "DISCARD-EDITED-DENY": "No." }, + "FINALIZE": { + "FINALIZE": "Finalize", + "CAN-NOT-FINALIZE": "Save your changes first" + }, "SAVE": "Uložiť", "DELETE": "Vymazať", "ADD-DESCRIPTION-IN-SECTION": "Add Description", @@ -1609,7 +1614,6 @@ "EXPORT": "Export", "SAVE-AND-CLOSE": "Save & Close", "SAVE-AND-CONTINUE": "Save & Continue", - "FINALIZE": "Finalize", "REVERSE": "Undo Finalization", "LOCKED": "Locked" }, diff --git a/dmp-frontend/src/assets/i18n/sr.json b/dmp-frontend/src/assets/i18n/sr.json index 7fdf11825..2667909ba 100644 --- a/dmp-frontend/src/assets/i18n/sr.json +++ b/dmp-frontend/src/assets/i18n/sr.json @@ -946,6 +946,7 @@ "CONFIRM": "Yes", "REJECT": "No", "MULTIPLICITY-ADD-ONE-FIELD": "Add more", + "MULTIPLICITY-ADD-ONE-FIELD-TABLEVIEW": "Add row", "VIEW-MORE": "View more", "VIEW-LESS": "View less" }, @@ -1596,6 +1597,10 @@ "DISCARD-EDITED-CONFIRM": "Yes, revert changes.", "DISCARD-EDITED-DENY": "No." }, + "FINALIZE": { + "FINALIZE": "Finalize", + "CAN-NOT-FINALIZE": "Save your changes first" + }, "SAVE": "Sačuvajte", "DELETE": "Obrišite", "ADD-DESCRIPTION-IN-SECTION": "Add Description", @@ -1609,7 +1614,6 @@ "EXPORT": "Export", "SAVE-AND-CLOSE": "Save & Close", "SAVE-AND-CONTINUE": "Save & Continue", - "FINALIZE": "Finalize", "REVERSE": "Undo Finalization", "LOCKED": "Locked" }, diff --git a/dmp-frontend/src/assets/i18n/tr.json b/dmp-frontend/src/assets/i18n/tr.json index 54b72e31a..b9ca66e54 100644 --- a/dmp-frontend/src/assets/i18n/tr.json +++ b/dmp-frontend/src/assets/i18n/tr.json @@ -946,6 +946,7 @@ "CONFIRM": "Yes", "REJECT": "No", "MULTIPLICITY-ADD-ONE-FIELD": "Add more", + "MULTIPLICITY-ADD-ONE-FIELD-TABLEVIEW": "Add row", "VIEW-MORE": "View more", "VIEW-LESS": "View less" }, @@ -1596,6 +1597,10 @@ "DISCARD-EDITED-CONFIRM": "Yes, revert changes.", "DISCARD-EDITED-DENY": "No." }, + "FINALIZE": { + "FINALIZE": "Finalize", + "CAN-NOT-FINALIZE": "Save your changes first" + }, "SAVE": "Kaydet", "DELETE": "Sil", "ADD-DESCRIPTION-IN-SECTION": "Add Description", @@ -1609,7 +1614,6 @@ "EXPORT": "Export", "SAVE-AND-CLOSE": "Save & Close", "SAVE-AND-CONTINUE": "Save & Continue", - "FINALIZE": "Finalize", "REVERSE": "Undo Finalization", "LOCKED": "Locked" },