Merge remote-tracking branch 'origin/dmp-refactoring' into dmp-refactoring

This commit is contained in:
amentis 2024-06-21 12:41:47 +03:00
commit 24ffc297fa
17 changed files with 68 additions and 16 deletions

View File

@ -40,7 +40,10 @@
<mat-icon>add_circle</mat-icon>
</button>
<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>
</div>
</div>

View File

@ -101,9 +101,10 @@
</div>
</div>
<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>
<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 class="col-12">

View File

@ -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();

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>
<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>

View File

@ -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;

View File

@ -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;

View File

@ -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"
},

View File

@ -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"
},

View File

@ -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"
},

View File

@ -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"
},

View File

@ -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"
},

View File

@ -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"
},

View File

@ -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"
},

View File

@ -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"
},

View File

@ -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"
},

View File

@ -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"
},

View File

@ -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"
},