more ui changes

This commit is contained in:
Diamantis Tziotzios 2024-01-31 12:53:30 +02:00
parent 078ca9e0cb
commit 2ba9e146e5
4 changed files with 30 additions and 33 deletions

View File

@ -75,9 +75,6 @@ public class DmpPropertiesPersist {
.over(item.getDmpBlueprintValues())
.mapKey((k) -> ((UUID)k).toString())
.using((itm) -> this.validatorFactory.validator(DmpBlueprintValuePersist.DmpBlueprintValuePersistValidator.class)),
this.spec()
.must(() -> !this.isListNullOrEmpty(item.getContacts()))
.failOn(DmpPropertiesPersist._contacts).failWith(messageSource.getMessage("Validation_Required", new Object[]{DmpPropertiesPersist._contacts}, LocaleContextHolder.getLocale())),
this.navSpec()
.iff(() -> !this.isListNullOrEmpty(item.getContacts()))
.on(DmpPropertiesPersist._contacts)

View File

@ -1,6 +1,6 @@
export enum DmpBlueprintExtraFieldDataType {
Text = 0,
RichTex = 1,
RichText = 1,
Date = 2,
Number = 3
}

View File

@ -148,7 +148,7 @@ export class EnumUtils {
toDmpBlueprintExtraFieldDataTypeString(status: DmpBlueprintExtraFieldDataType): string {
switch (status) {
case DmpBlueprintExtraFieldDataType.Text: return this.language.instant('TYPES.DMP-PROFILE-FIELD.DATA-TYPE.TEXT');
case DmpBlueprintExtraFieldDataType.RichTex: return this.language.instant('TYPES.DMP-PROFILE-FIELD.DATA-TYPE.RICH-TEXT');
case DmpBlueprintExtraFieldDataType.RichText: return this.language.instant('TYPES.DMP-PROFILE-FIELD.DATA-TYPE.RICH-TEXT');
case DmpBlueprintExtraFieldDataType.Date: return this.language.instant('TYPES.DMP-PROFILE-FIELD.DATA-TYPE.DATE');
case DmpBlueprintExtraFieldDataType.Number: return this.language.instant('TYPES.DMP-PROFILE-FIELD.DATA-TYPE.NUMBER');
}

View File

@ -258,34 +258,34 @@
<mat-error *ngIf="formGroup.get('accessType').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field>
</div>
<div *ngIf="field.category === dmpBlueprintSectionFieldCategoryEnum.EXTRA">
<div *ngIf="field.dataType === dmpBlueprintExtraFieldDataTypeEnum.TEXT">
<mat-form-field class="w-100">
<input matInput placeholder="{{field.placeholder}}" type="text" name="value" [formControl]="formGroup.get('extraFields').get(getExtraFieldIndex(field.id)).get('value')" [required]="field.required">
</mat-form-field>
</div>
<div *ngIf="field.dataType === dmpBlueprintExtraFieldDataTypeEnum.RICH_TEXT">
<ng-container formArrayName="extraFields">
<ng-container *ngFor="let control of extraFieldsArray().controls; let extraFieldIndex = index;">
<ng-container [formGroupName]="extraFieldIndex">
<ng-container *ngIf="control.get('id').value === field.id">
<rich-text-editor-component [form]="control.get('value')" [placeholder]="field.placeholder" [required]="field.required">
</rich-text-editor-component>
</ng-container>
</ng-container>
</ng-container>
</ng-container>
</div>
<div *ngIf="field.dataType === dmpBlueprintExtraFieldDataTypeEnum.DATE">
<mat-form-field class="w-100">
<input matInput placeholder="{{field.placeholder}}" type="date" name="value" [formControl]="formGroup.get('extraFields').get(getExtraFieldIndex(field.id)).get('value')" [required]="field.required">
</mat-form-field>
</div>
<div *ngIf="field.dataType === dmpBlueprintExtraFieldDataTypeEnum.NUMBER">
<mat-form-field class="w-100">
<input matInput placeholder="{{field.placeholder}}" type="number" name="value" [formControl]="formGroup.get('extraFields').get(getExtraFieldIndex(field.id)).get('value')" [required]="field.required">
</mat-form-field>
</div>
</div>
<div *ngIf="field.category === dmpBlueprintSectionFieldCategoryEnum.EXTRA">
<div *ngIf="field.dataType === dmpBlueprintExtraFieldDataTypeEnum.Text">
<mat-form-field class="w-100">
<mat-label>{{field.label}}</mat-label>
<input matInput placeholder="{{field.placeholder ?? field.label}}" type="text" name="value" [formControl]="formGroup.get('properties').get('dmpBlueprintValues').get(field.id).get('fieldValue')" [required]="field.required">
<mat-error *ngIf="formGroup.get('properties').get('dmpBlueprintValues').get(field.id).get('fieldValue').hasError('backendError')">{{formGroup.get('properties').get('dmpBlueprintValues').get(field.id).get('fieldValue').getError('backendError').message}}</mat-error>
<mat-error *ngIf="formGroup.get('properties').get('dmpBlueprintValues').get(field.id).get('fieldValue').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field>
</div>
<div *ngIf="field.dataType === dmpBlueprintExtraFieldDataTypeEnum.RichText">
<rich-text-editor-component [form]="formGroup.get('properties').get('dmpBlueprintValues').get(field.id).get('fieldValue')" placeholder="{{field.placeholder ?? field.label}}" [required]="field.required"></rich-text-editor-component>
</div>
<div *ngIf="field.dataType === dmpBlueprintExtraFieldDataTypeEnum.Date">
<mat-form-field class="w-100">
<mat-label>{{field.label}}</mat-label>
<input matInput placeholder="{{field.placeholder ?? field.label}}" type="date" name="value" [formControl]="formGroup.get('properties').get('dmpBlueprintValues').get(field.id).get('fieldValue')" [required]="field.required">
<mat-error *ngIf="formGroup.get('properties').get('dmpBlueprintValues').get(field.id).get('fieldValue').hasError('backendError')">{{formGroup.get('properties').get('dmpBlueprintValues').get(field.id).get('fieldValue').getError('backendError').message}}</mat-error>
<mat-error *ngIf="formGroup.get('properties').get('dmpBlueprintValues').get(field.id).get('fieldValue').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field>
</div>
<div *ngIf="field.dataType === dmpBlueprintExtraFieldDataTypeEnum.Number">
<mat-form-field class="w-100">
<mat-label>{{field.label}}</mat-label>
<input matInput placeholder="{{field.placeholder ?? field.label}}" type="number" name="value" [formControl]="formGroup.get('properties').get('dmpBlueprintValues').get(field.id).get('fieldValue')" [required]="field.required">
<mat-error *ngIf="formGroup.get('properties').get('dmpBlueprintValues').get(field.id).get('fieldValue').hasError('backendError')">{{formGroup.get('properties').get('dmpBlueprintValues').get(field.id).get('fieldValue').getError('backendError').message}}</mat-error>
<mat-error *ngIf="formGroup.get('properties').get('dmpBlueprintValues').get(field.id).get('fieldValue').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field>
</div>
</div>
</div>