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
This commit is contained in:
Sofia Papacharalampous 2024-06-21 12:39:42 +03:00
parent 342ddcbfbe
commit d11aa91167
17 changed files with 68 additions and 16 deletions

View File

@ -40,7 +40,10 @@
<mat-icon>add_circle</mat-icon> <mat-icon>add_circle</mat-icon>
</button> </button>
<span class="mt-1" *ngIf="fieldSet?.multiplicity?.placeholder">{{fieldSet.multiplicity.placeholder}}</span> <span class="mt-1" *ngIf="fieldSet?.multiplicity?.placeholder">{{fieldSet.multiplicity.placeholder}}</span>
<span class="mt-1" *ngIf="!fieldSet?.multiplicity?.placeholder">{{('DESCRIPTION-EDITOR.ACTIONS.MULTIPLICITY-ADD-ONE-FIELD' + (fieldSet.multiplicity?.tableView?'-TABLEVIEW':'')) | translate}}</span> <span class="mt-1" *ngIf="!fieldSet?.multiplicity?.placeholder && !fieldSet.multiplicity?.tableView else addTableView">{{'DESCRIPTION-EDITOR.ACTIONS.MULTIPLICITY-ADD-ONE-FIELD' | translate}}</span>
<ng-template #addTableView>
<span class="mt-1">{{'DESCRIPTION-EDITOR.ACTIONS.MULTIPLICITY-ADD-ONE-FIELD-TABLEVIEW' | translate}}</span>
</ng-template>
</span> </span>
</div> </div>
</div> </div>

View File

@ -101,9 +101,10 @@
</div> </div>
</div> </div>
<div *ngSwitchCase="descriptionTemplateFieldTypeEnum.CHECK_BOX" class="col-12"> <div *ngSwitchCase="descriptionTemplateFieldTypeEnum.CHECK_BOX" class="col-12">
<mat-checkbox [formControl]="propertiesFormGroup?.get(field.id).get('booleanValue')"> <mat-checkbox [formControl]="propertiesFormGroup?.get(field.id).get('booleanValue')" (change)="checkboxChangeEvent($event, field.id)">
{{field.data.label}}</mat-checkbox> {{field.data.label}}</mat-checkbox>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('booleanValue').hasError('backendError')">{{propertiesFormGroup?.get(field.id).get('booleanValue').getError('backendError').message}}</mat-error> <mat-error *ngIf="propertiesFormGroup?.get(field.id).get('booleanValue').hasError('backendError')">{{propertiesFormGroup?.get(field.id).get('booleanValue').getError('backendError').message}}</mat-error>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('booleanValue').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</div> </div>
<div class="col-12"> <div class="col-12">

View File

@ -27,6 +27,7 @@ import { Observable } from 'rxjs';
import { distinctUntilChanged, takeUntil } from 'rxjs/operators'; import { distinctUntilChanged, takeUntil } from 'rxjs/operators';
import { nameof } from 'ts-simple-nameof'; import { nameof } from 'ts-simple-nameof';
import { DescriptionFormService } from '../services/description-form.service'; import { DescriptionFormService } from '../services/description-form.service';
import { MatCheckboxChange } from '@angular/material/checkbox';
@Component({ @Component({
selector: 'app-description-form-field', 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) { onRemove(makeFilesNull: boolean = true) {
this.makeFilesNull() this.makeFilesNull()
this.cdr.detectChanges(); this.cdr.detectChanges();

View File

@ -1,4 +1,4 @@
<div class="demo-progress-bar-container"> <div class="demo-progress-bar-container" *ngIf="!formGroup.disabled">
<div class="percentage d-flex justify-content-center"><span *ngIf="total>0">{{progressSoFar}} {{'GENERAL.PREPOSITIONS.OF' | translate}} {{total}}</span>&nbsp;</div> <div class="percentage d-flex justify-content-center"><span *ngIf="total>0">{{progressSoFar}} {{'GENERAL.PREPOSITIONS.OF' | translate}} {{total}}</span>&nbsp;</div>
<mat-progress-bar *ngIf="value" class="form-progress-bar" [ngClass]="{'progress-bar': true}" mode="determinate" [value]="value"></mat-progress-bar> <mat-progress-bar *ngIf="value" class="form-progress-bar" [ngClass]="{'progress-bar': true}" mode="determinate" [value]="value"></mat-progress-bar>
<mat-progress-bar *ngIf="!value" class="form-progress-bar" [ngClass]="{'progress-bar': true}" mode="determinate" [value]="0"></mat-progress-bar> <mat-progress-bar *ngIf="!value" class="form-progress-bar" [ngClass]="{'progress-bar': true}" mode="determinate" [value]="0"></mat-progress-bar>

View File

@ -46,6 +46,8 @@ export class FormProgressIndicationComponent extends BaseComponent implements On
} }
calculateValueForProgressbar() { calculateValueForProgressbar() {
if (this.formGroup.disabled) return;
this.progressSoFar = this.countCompletedRequiredBaseFields(this.formGroup) + this.countRequiredFields(this.formGroup.get('properties'), this.checkVisibility, true); 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.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; this.percent = (this.progressSoFar / this.total) * 100;

View File

@ -86,9 +86,9 @@ export class TableOfContentsInternal extends BaseComponent implements OnInit, On
} }
isTocEntryValid(entry: ToCEntry): boolean { isTocEntryValid(entry: ToCEntry): boolean {
if (entry == null) { if (entry == null) return true;
return true;
} if (entry.validityAbstractControl && !entry.validityAbstractControl.touched) return true;
let currentValidity = entry.validityAbstractControl?.valid ?? true; let currentValidity = entry.validityAbstractControl?.valid ?? true;
if (!currentValidity) return currentValidity; if (!currentValidity) return currentValidity;

View File

@ -946,6 +946,7 @@
"CONFIRM": "Yes", "CONFIRM": "Yes",
"REJECT": "No", "REJECT": "No",
"MULTIPLICITY-ADD-ONE-FIELD": "Add more", "MULTIPLICITY-ADD-ONE-FIELD": "Add more",
"MULTIPLICITY-ADD-ONE-FIELD-TABLEVIEW": "Add row",
"VIEW-MORE": "View more", "VIEW-MORE": "View more",
"VIEW-LESS": "View less" "VIEW-LESS": "View less"
}, },
@ -1596,6 +1597,10 @@
"DISCARD-EDITED-CONFIRM": "Yes, revert changes.", "DISCARD-EDITED-CONFIRM": "Yes, revert changes.",
"DISCARD-EDITED-DENY": "No." "DISCARD-EDITED-DENY": "No."
}, },
"FINALIZE": {
"FINALIZE": "Finalize",
"CAN-NOT-FINALIZE": "Save your changes first"
},
"SAVE": "Gorde", "SAVE": "Gorde",
"DELETE": "Ezabatu", "DELETE": "Ezabatu",
"ADD-DESCRIPTION-IN-SECTION": "Add Description", "ADD-DESCRIPTION-IN-SECTION": "Add Description",
@ -1609,7 +1614,6 @@
"EXPORT": "Export", "EXPORT": "Export",
"SAVE-AND-CLOSE": "Save & Close", "SAVE-AND-CLOSE": "Save & Close",
"SAVE-AND-CONTINUE": "Save & Continue", "SAVE-AND-CONTINUE": "Save & Continue",
"FINALIZE": "Finalize",
"REVERSE": "Undo Finalization", "REVERSE": "Undo Finalization",
"LOCKED": "Locked" "LOCKED": "Locked"
}, },

View File

@ -946,6 +946,7 @@
"CONFIRM": "Yes", "CONFIRM": "Yes",
"REJECT": "No", "REJECT": "No",
"MULTIPLICITY-ADD-ONE-FIELD": "Add more", "MULTIPLICITY-ADD-ONE-FIELD": "Add more",
"MULTIPLICITY-ADD-ONE-FIELD-TABLEVIEW": "Add row",
"VIEW-MORE": "View more", "VIEW-MORE": "View more",
"VIEW-LESS": "View less" "VIEW-LESS": "View less"
}, },
@ -1596,6 +1597,10 @@
"DISCARD-EDITED-CONFIRM": "Yes, revert changes.", "DISCARD-EDITED-CONFIRM": "Yes, revert changes.",
"DISCARD-EDITED-DENY": "No." "DISCARD-EDITED-DENY": "No."
}, },
"FINALIZE": {
"FINALIZE": "Finalize",
"CAN-NOT-FINALIZE": "Save your changes first"
},
"SAVE": "Speichern", "SAVE": "Speichern",
"DELETE": "Löschen", "DELETE": "Löschen",
"ADD-DESCRIPTION-IN-SECTION": "Add Description", "ADD-DESCRIPTION-IN-SECTION": "Add Description",
@ -1609,7 +1614,6 @@
"EXPORT": "Export", "EXPORT": "Export",
"SAVE-AND-CLOSE": "Save & Close", "SAVE-AND-CLOSE": "Save & Close",
"SAVE-AND-CONTINUE": "Save & Continue", "SAVE-AND-CONTINUE": "Save & Continue",
"FINALIZE": "Finalize",
"REVERSE": "Undo Finalization", "REVERSE": "Undo Finalization",
"LOCKED": "Locked" "LOCKED": "Locked"
}, },

View File

@ -946,6 +946,7 @@
"CONFIRM": "Yes", "CONFIRM": "Yes",
"REJECT": "No", "REJECT": "No",
"MULTIPLICITY-ADD-ONE-FIELD": "Add more", "MULTIPLICITY-ADD-ONE-FIELD": "Add more",
"MULTIPLICITY-ADD-ONE-FIELD-TABLEVIEW": "Add row",
"VIEW-MORE": "View more", "VIEW-MORE": "View more",
"VIEW-LESS": "View less" "VIEW-LESS": "View less"
}, },

View File

@ -946,6 +946,7 @@
"CONFIRM": "Yes", "CONFIRM": "Yes",
"REJECT": "No", "REJECT": "No",
"MULTIPLICITY-ADD-ONE-FIELD": "Add more", "MULTIPLICITY-ADD-ONE-FIELD": "Add more",
"MULTIPLICITY-ADD-ONE-FIELD-TABLEVIEW": "Add row",
"VIEW-MORE": "View more", "VIEW-MORE": "View more",
"VIEW-LESS": "View less" "VIEW-LESS": "View less"
}, },
@ -1596,6 +1597,10 @@
"DISCARD-EDITED-CONFIRM": "Yes, revert changes.", "DISCARD-EDITED-CONFIRM": "Yes, revert changes.",
"DISCARD-EDITED-DENY": "No." "DISCARD-EDITED-DENY": "No."
}, },
"FINALIZE": {
"FINALIZE": "Finalize",
"CAN-NOT-FINALIZE": "Save your changes first"
},
"SAVE": "Grabar", "SAVE": "Grabar",
"DELETE": "Borrar", "DELETE": "Borrar",
"ADD-DESCRIPTION-IN-SECTION": "Add Description", "ADD-DESCRIPTION-IN-SECTION": "Add Description",
@ -1609,7 +1614,6 @@
"EXPORT": "Export", "EXPORT": "Export",
"SAVE-AND-CLOSE": "Save & Close", "SAVE-AND-CLOSE": "Save & Close",
"SAVE-AND-CONTINUE": "Save & Continue", "SAVE-AND-CONTINUE": "Save & Continue",
"FINALIZE": "Finalize",
"REVERSE": "Undo Finalization", "REVERSE": "Undo Finalization",
"LOCKED": "Locked" "LOCKED": "Locked"
}, },

View File

@ -946,6 +946,7 @@
"CONFIRM": "Yes", "CONFIRM": "Yes",
"REJECT": "No", "REJECT": "No",
"MULTIPLICITY-ADD-ONE-FIELD": "Add more", "MULTIPLICITY-ADD-ONE-FIELD": "Add more",
"MULTIPLICITY-ADD-ONE-FIELD-TABLEVIEW": "Add row",
"VIEW-MORE": "View more", "VIEW-MORE": "View more",
"VIEW-LESS": "View less" "VIEW-LESS": "View less"
}, },
@ -1596,6 +1597,10 @@
"DISCARD-EDITED-CONFIRM": "Yes, revert changes.", "DISCARD-EDITED-CONFIRM": "Yes, revert changes.",
"DISCARD-EDITED-DENY": "No." "DISCARD-EDITED-DENY": "No."
}, },
"FINALIZE": {
"FINALIZE": "Finalize",
"CAN-NOT-FINALIZE": "Save your changes first"
},
"SAVE": "Αποθήκευση", "SAVE": "Αποθήκευση",
"DELETE": "Διαγραφή", "DELETE": "Διαγραφή",
"ADD-DESCRIPTION-IN-SECTION": "Add Description", "ADD-DESCRIPTION-IN-SECTION": "Add Description",
@ -1609,7 +1614,6 @@
"EXPORT": "Export", "EXPORT": "Export",
"SAVE-AND-CLOSE": "Save & Close", "SAVE-AND-CLOSE": "Save & Close",
"SAVE-AND-CONTINUE": "Save & Continue", "SAVE-AND-CONTINUE": "Save & Continue",
"FINALIZE": "Finalize",
"REVERSE": "Undo Finalization", "REVERSE": "Undo Finalization",
"LOCKED": "Locked" "LOCKED": "Locked"
}, },

View File

@ -946,6 +946,7 @@
"CONFIRM": "Yes", "CONFIRM": "Yes",
"REJECT": "No", "REJECT": "No",
"MULTIPLICITY-ADD-ONE-FIELD": "Add more", "MULTIPLICITY-ADD-ONE-FIELD": "Add more",
"MULTIPLICITY-ADD-ONE-FIELD-TABLEVIEW": "Add row",
"VIEW-MORE": "View more", "VIEW-MORE": "View more",
"VIEW-LESS": "View less" "VIEW-LESS": "View less"
}, },
@ -1596,6 +1597,10 @@
"DISCARD-EDITED-CONFIRM": "Yes, revert changes.", "DISCARD-EDITED-CONFIRM": "Yes, revert changes.",
"DISCARD-EDITED-DENY": "No." "DISCARD-EDITED-DENY": "No."
}, },
"FINALIZE": {
"FINALIZE": "Finalize",
"CAN-NOT-FINALIZE": "Save your changes first"
},
"SAVE": "Spremi", "SAVE": "Spremi",
"DELETE": "Obriši", "DELETE": "Obriši",
"ADD-DESCRIPTION-IN-SECTION": "Add Description", "ADD-DESCRIPTION-IN-SECTION": "Add Description",
@ -1609,7 +1614,6 @@
"EXPORT": "Export", "EXPORT": "Export",
"SAVE-AND-CLOSE": "Save & Close", "SAVE-AND-CLOSE": "Save & Close",
"SAVE-AND-CONTINUE": "Save & Continue", "SAVE-AND-CONTINUE": "Save & Continue",
"FINALIZE": "Finalize",
"REVERSE": "Undo Finalization", "REVERSE": "Undo Finalization",
"LOCKED": "Locked" "LOCKED": "Locked"
}, },

View File

@ -946,6 +946,7 @@
"CONFIRM": "Yes", "CONFIRM": "Yes",
"REJECT": "No", "REJECT": "No",
"MULTIPLICITY-ADD-ONE-FIELD": "Add more", "MULTIPLICITY-ADD-ONE-FIELD": "Add more",
"MULTIPLICITY-ADD-ONE-FIELD-TABLEVIEW": "Add row",
"VIEW-MORE": "View more", "VIEW-MORE": "View more",
"VIEW-LESS": "View less" "VIEW-LESS": "View less"
}, },
@ -1596,6 +1597,10 @@
"DISCARD-EDITED-CONFIRM": "Yes, revert changes.", "DISCARD-EDITED-CONFIRM": "Yes, revert changes.",
"DISCARD-EDITED-DENY": "No." "DISCARD-EDITED-DENY": "No."
}, },
"FINALIZE": {
"FINALIZE": "Finalize",
"CAN-NOT-FINALIZE": "Save your changes first"
},
"SAVE": "Zapisz", "SAVE": "Zapisz",
"DELETE": "Usuń", "DELETE": "Usuń",
"ADD-DESCRIPTION-IN-SECTION": "Add Description", "ADD-DESCRIPTION-IN-SECTION": "Add Description",
@ -1609,7 +1614,6 @@
"EXPORT": "Export", "EXPORT": "Export",
"SAVE-AND-CLOSE": "Save & Close", "SAVE-AND-CLOSE": "Save & Close",
"SAVE-AND-CONTINUE": "Save & Continue", "SAVE-AND-CONTINUE": "Save & Continue",
"FINALIZE": "Finalize",
"REVERSE": "Undo Finalization", "REVERSE": "Undo Finalization",
"LOCKED": "Locked" "LOCKED": "Locked"
}, },

View File

@ -946,6 +946,7 @@
"CONFIRM": "Yes", "CONFIRM": "Yes",
"REJECT": "No", "REJECT": "No",
"MULTIPLICITY-ADD-ONE-FIELD": "Add more", "MULTIPLICITY-ADD-ONE-FIELD": "Add more",
"MULTIPLICITY-ADD-ONE-FIELD-TABLEVIEW": "Add row",
"VIEW-MORE": "View more", "VIEW-MORE": "View more",
"VIEW-LESS": "View less" "VIEW-LESS": "View less"
}, },
@ -1596,6 +1597,10 @@
"DISCARD-EDITED-CONFIRM": "Yes, revert changes.", "DISCARD-EDITED-CONFIRM": "Yes, revert changes.",
"DISCARD-EDITED-DENY": "No." "DISCARD-EDITED-DENY": "No."
}, },
"FINALIZE": {
"FINALIZE": "Finalize",
"CAN-NOT-FINALIZE": "Save your changes first"
},
"SAVE": "Guardar", "SAVE": "Guardar",
"DELETE": "Eliminar", "DELETE": "Eliminar",
"ADD-DESCRIPTION-IN-SECTION": "Add Description", "ADD-DESCRIPTION-IN-SECTION": "Add Description",
@ -1609,7 +1614,6 @@
"EXPORT": "Export", "EXPORT": "Export",
"SAVE-AND-CLOSE": "Save & Close", "SAVE-AND-CLOSE": "Save & Close",
"SAVE-AND-CONTINUE": "Save & Continue", "SAVE-AND-CONTINUE": "Save & Continue",
"FINALIZE": "Finalize",
"REVERSE": "Undo Finalization", "REVERSE": "Undo Finalization",
"LOCKED": "Locked" "LOCKED": "Locked"
}, },

View File

@ -946,6 +946,7 @@
"CONFIRM": "Yes", "CONFIRM": "Yes",
"REJECT": "No", "REJECT": "No",
"MULTIPLICITY-ADD-ONE-FIELD": "Add more", "MULTIPLICITY-ADD-ONE-FIELD": "Add more",
"MULTIPLICITY-ADD-ONE-FIELD-TABLEVIEW": "Add row",
"VIEW-MORE": "View more", "VIEW-MORE": "View more",
"VIEW-LESS": "View less" "VIEW-LESS": "View less"
}, },
@ -1596,6 +1597,10 @@
"DISCARD-EDITED-CONFIRM": "Yes, revert changes.", "DISCARD-EDITED-CONFIRM": "Yes, revert changes.",
"DISCARD-EDITED-DENY": "No." "DISCARD-EDITED-DENY": "No."
}, },
"FINALIZE": {
"FINALIZE": "Finalize",
"CAN-NOT-FINALIZE": "Save your changes first"
},
"SAVE": "Uložiť", "SAVE": "Uložiť",
"DELETE": "Vymazať", "DELETE": "Vymazať",
"ADD-DESCRIPTION-IN-SECTION": "Add Description", "ADD-DESCRIPTION-IN-SECTION": "Add Description",
@ -1609,7 +1614,6 @@
"EXPORT": "Export", "EXPORT": "Export",
"SAVE-AND-CLOSE": "Save & Close", "SAVE-AND-CLOSE": "Save & Close",
"SAVE-AND-CONTINUE": "Save & Continue", "SAVE-AND-CONTINUE": "Save & Continue",
"FINALIZE": "Finalize",
"REVERSE": "Undo Finalization", "REVERSE": "Undo Finalization",
"LOCKED": "Locked" "LOCKED": "Locked"
}, },

View File

@ -946,6 +946,7 @@
"CONFIRM": "Yes", "CONFIRM": "Yes",
"REJECT": "No", "REJECT": "No",
"MULTIPLICITY-ADD-ONE-FIELD": "Add more", "MULTIPLICITY-ADD-ONE-FIELD": "Add more",
"MULTIPLICITY-ADD-ONE-FIELD-TABLEVIEW": "Add row",
"VIEW-MORE": "View more", "VIEW-MORE": "View more",
"VIEW-LESS": "View less" "VIEW-LESS": "View less"
}, },
@ -1596,6 +1597,10 @@
"DISCARD-EDITED-CONFIRM": "Yes, revert changes.", "DISCARD-EDITED-CONFIRM": "Yes, revert changes.",
"DISCARD-EDITED-DENY": "No." "DISCARD-EDITED-DENY": "No."
}, },
"FINALIZE": {
"FINALIZE": "Finalize",
"CAN-NOT-FINALIZE": "Save your changes first"
},
"SAVE": "Sačuvajte", "SAVE": "Sačuvajte",
"DELETE": "Obrišite", "DELETE": "Obrišite",
"ADD-DESCRIPTION-IN-SECTION": "Add Description", "ADD-DESCRIPTION-IN-SECTION": "Add Description",
@ -1609,7 +1614,6 @@
"EXPORT": "Export", "EXPORT": "Export",
"SAVE-AND-CLOSE": "Save & Close", "SAVE-AND-CLOSE": "Save & Close",
"SAVE-AND-CONTINUE": "Save & Continue", "SAVE-AND-CONTINUE": "Save & Continue",
"FINALIZE": "Finalize",
"REVERSE": "Undo Finalization", "REVERSE": "Undo Finalization",
"LOCKED": "Locked" "LOCKED": "Locked"
}, },

View File

@ -946,6 +946,7 @@
"CONFIRM": "Yes", "CONFIRM": "Yes",
"REJECT": "No", "REJECT": "No",
"MULTIPLICITY-ADD-ONE-FIELD": "Add more", "MULTIPLICITY-ADD-ONE-FIELD": "Add more",
"MULTIPLICITY-ADD-ONE-FIELD-TABLEVIEW": "Add row",
"VIEW-MORE": "View more", "VIEW-MORE": "View more",
"VIEW-LESS": "View less" "VIEW-LESS": "View less"
}, },
@ -1596,6 +1597,10 @@
"DISCARD-EDITED-CONFIRM": "Yes, revert changes.", "DISCARD-EDITED-CONFIRM": "Yes, revert changes.",
"DISCARD-EDITED-DENY": "No." "DISCARD-EDITED-DENY": "No."
}, },
"FINALIZE": {
"FINALIZE": "Finalize",
"CAN-NOT-FINALIZE": "Save your changes first"
},
"SAVE": "Kaydet", "SAVE": "Kaydet",
"DELETE": "Sil", "DELETE": "Sil",
"ADD-DESCRIPTION-IN-SECTION": "Add Description", "ADD-DESCRIPTION-IN-SECTION": "Add Description",
@ -1609,7 +1614,6 @@
"EXPORT": "Export", "EXPORT": "Export",
"SAVE-AND-CLOSE": "Save & Close", "SAVE-AND-CLOSE": "Save & Close",
"SAVE-AND-CONTINUE": "Save & Continue", "SAVE-AND-CONTINUE": "Save & Continue",
"FINALIZE": "Finalize",
"REVERSE": "Undo Finalization", "REVERSE": "Undo Finalization",
"LOCKED": "Locked" "LOCKED": "Locked"
}, },