minor fixes dmp blueprints and Dmps.

This commit is contained in:
Diamantis Tziotzios 2023-10-25 20:53:47 +03:00
parent 51cc5f4fd9
commit 129dbd163a
9 changed files with 115 additions and 95 deletions

View File

@ -74,7 +74,7 @@ public class DmpBlueprintBuilder extends BaseBuilder<DmpBlueprint, DmpBlueprintE
DefinitionEntity definition = this.xmlHandlingService.xmlSerializableFromXmlSafe(DefinitionEntity.class, d.getDefinition()); DefinitionEntity definition = this.xmlHandlingService.xmlSerializableFromXmlSafe(DefinitionEntity.class, d.getDefinition());
m.setDefinition(this.builderFactory.builder(DefinitionBuilder.class).authorize(this.authorize).build(definitionFields, definition)); m.setDefinition(this.builderFactory.builder(DefinitionBuilder.class).authorize(this.authorize).build(definitionFields, definition));
} }
if (!dmpExternalReferenceMap.isEmpty() && dmpExternalReferenceMap != null && dmpExternalReferenceMap.containsKey(d.getId())) m.setDmpExternalReferences(dmpExternalReferenceMap.get(d.getId())); if (dmpExternalReferenceMap != null && !dmpExternalReferenceMap.isEmpty() && dmpExternalReferenceMap.containsKey(d.getId())) m.setDmpExternalReferences(dmpExternalReferenceMap.get(d.getId()));
models.add(m); models.add(m);
models.add(m); models.add(m);
} }

View File

@ -1,8 +1,8 @@
package eu.eudat.model.builder.dmpblueprintdefinition; package eu.eudat.model.builder.dmpblueprintdefinition;
import eu.eudat.commons.types.dmpblueprint.ExtraFieldEntity; import eu.eudat.commons.types.dmpblueprint.SystemFieldEntity;
import eu.eudat.convention.ConventionService; import eu.eudat.convention.ConventionService;
import eu.eudat.model.dmpblueprintdefinition.ExtraField; import eu.eudat.model.dmpblueprintdefinition.SystemField;
import gr.cite.tools.fieldset.FieldSet; import gr.cite.tools.fieldset.FieldSet;
import gr.cite.tools.logging.LoggerService; import gr.cite.tools.logging.LoggerService;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -13,7 +13,7 @@ import org.springframework.stereotype.Component;
@Component @Component
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE) @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class SystemFieldBuilder extends FieldBuilder<ExtraField, ExtraFieldEntity> { public class SystemFieldBuilder extends FieldBuilder<SystemField, SystemFieldEntity> {
@Autowired @Autowired
public SystemFieldBuilder( public SystemFieldBuilder(
@ -21,12 +21,12 @@ public class SystemFieldBuilder extends FieldBuilder<ExtraField, ExtraFieldEntit
super(conventionService, new LoggerService(LoggerFactory.getLogger(SystemFieldBuilder.class))); super(conventionService, new LoggerService(LoggerFactory.getLogger(SystemFieldBuilder.class)));
} }
protected ExtraField getInstance() { protected SystemField getInstance() {
return new ExtraField(); return new SystemField();
} }
protected ExtraField buildChild(FieldSet fields, ExtraFieldEntity data, ExtraField model) { protected SystemField buildChild(FieldSet fields, SystemFieldEntity data, SystemField model) {
if (fields.hasField(this.asIndexer(ExtraField._type))) model.setType(data.getType()); if (fields.hasField(this.asIndexer(SystemField._type))) model.setType(data.getType());
return model; return model;
} }
} }

View File

@ -1,5 +1,5 @@
<div class="row multiple-auto-complete" ngForm> <div class="row multiple-auto-complete" ngForm>
<mat-chip-list #chipList ngDefaultControl style="width: 100% !important;"> <mat-chip-grid #chipList ngDefaultControl style="width: 100% !important;">
<ng-container *ngIf="value as values"> <ng-container *ngIf="value as values">
<mat-chip *ngFor="let value of values" [disabled]="disabled" [selectable]="selectable" [removable]="removable" [ngClass]="computeClass(value)"> <mat-chip *ngFor="let value of values" [disabled]="disabled" [selectable]="selectable" [removable]="removable" [ngClass]="computeClass(value)">
<ng-container *ngIf="_selectedItems.get(stringify(value)) as selectedItem"> <ng-container *ngIf="_selectedItems.get(stringify(value)) as selectedItem">
@ -23,7 +23,7 @@
<input matInput #autocompleteInput class="col" [name]="id" autocomplete="nope" #autocompleteTrigger="matAutocompleteTrigger" [placeholder]="placeholder" [matAutocomplete]="autocomplete" [value]="inputValue" (keyup)="onKeyUp($event)" (keydown)="onKeyDown($event)" [disabled]="disabled" (focus)="_onInputFocus()" (blur)="onBlur($event)" [matChipInputFor]="chipList" [matChipInputSeparatorKeyCodes]="separatorKeysCodes" [matChipInputAddOnBlur]="autoSelectFirstOptionOnBlur" (matChipInputTokenEnd)="_addItem($event)"> --> <input matInput #autocompleteInput class="col" [name]="id" autocomplete="nope" #autocompleteTrigger="matAutocompleteTrigger" [placeholder]="placeholder" [matAutocomplete]="autocomplete" [value]="inputValue" (keyup)="onKeyUp($event)" (keydown)="onKeyDown($event)" [disabled]="disabled" (focus)="_onInputFocus()" (blur)="onBlur($event)" [matChipInputFor]="chipList" [matChipInputSeparatorKeyCodes]="separatorKeysCodes" [matChipInputAddOnBlur]="autoSelectFirstOptionOnBlur" (matChipInputTokenEnd)="_addItem($event)"> -->
<mat-icon *ngIf="!disabled" class="align-arrow-right" matSuffix>arrow_drop_down</mat-icon> <mat-icon *ngIf="!disabled" class="align-arrow-right" matSuffix>arrow_drop_down</mat-icon>
<div style="height: 0 !important; width: 100% !important; visibility: hidden !important;" matAutocompleteOrigin #origin="matAutocompleteOrigin"></div> <div style="height: 0 !important; width: 100% !important; visibility: hidden !important;" matAutocompleteOrigin #origin="matAutocompleteOrigin"></div>
</mat-chip-list> </mat-chip-grid>
<mat-autocomplete #autocomplete="matAutocomplete" [displayWith]="_displayFn.bind(this)" (optionSelected)="_optionSelected($event)"> <mat-autocomplete #autocomplete="matAutocomplete" [displayWith]="_displayFn.bind(this)" (optionSelected)="_optionSelected($event)">
<span *ngIf="_groupedItems"> <span *ngIf="_groupedItems">

View File

@ -33,6 +33,56 @@
</div> </div>
</div> </div>
</div> </div>
<!-- First Step -->
<div class="row" id="editor-form" *ngIf="this.step === 0 && this.isNew">
<div class="col-12 blueprint-section">
<div class="row">
<div class="heading2 col-12">{{'DMP-EDITOR.FIELDS.NAME' | translate}} *</div>
<div class="col-12">
<mat-form-field class="w-100">
<mat-label>{{'DMP-EDITOR.FIELDS.NAME' | translate}}</mat-label>
<input matInput type="text" name="label" [formControl]="formGroup.get('label')" required>
<!-- <mat-error *ngIf="formGroup.get('label').hasError('backendError')">
{{formGroup.get('label').getError('backendError').message}}</mat-error>
<mat-error *ngIf="formGroup.get('label').hasError('required')">
{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> -->
</mat-form-field>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="heading2 col-12">{{'DMP-EDITOR.FIELDS.DESCRIPTION' | translate}} *</div>
<rich-text-editor-component [parentFormGroup]="formGroup" [controlName]="'description'" placeholder="{{'DMP-EDITOR.PLACEHOLDER.DESCRIPTION' | translate}}" [required]="true">
</rich-text-editor-component>
</div>
</div>
<div class="dmp-blueprint-form" style="margin-top: 3%;">
<div class="heading2">{{'DMP-EDITOR.FIELDS.BLUEPRINT' | translate}} *</div>
<mat-form-field class="w-100">
<mat-label>{{'DMP-EDITOR.FIELDS.BLUEPRINT' | translate}}</mat-label>
<app-single-auto-complete [required]="false" [formControl]="formGroup.get('profile')" placeholder="{{'DMP-EDITOR.PLACEHOLDER.BLUEPRINT' | translate}}" [configuration]="dmpBlueprintService.singleAutocompleteConfiguration">
</app-single-auto-complete>
</mat-form-field>
</div>
<div class="row">
<div class="col-5">
<button mat-button class="action-btn" [disabled]="selectedDmpBlueprintDefinition == null" (click)="selectBlueprint()">{{'DMP-EDITOR.STEPPER.NEXT' | translate}}</button>
</div>
<div class="col-7" *ngIf="formGroup.get('profile').value == null || (formGroup.get('profile').value && formGroup.get('profile').value.id !== defaultBlueprintId)">
<div class="row">
<div class="col-6">
<p>{{'DMP-EDITOR.ACTIONS.OR-CONTINUE-WITH' | translate}}</p>
</div>
<div class="col-6">
<button mat-button class="action-btn" style="float: right;" (click)="selectDefaultBlueprint()">{{'DMP-EDITOR.ACTIONS.DEFAULT-BLUEPRINT' | translate}}</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row"> <div class="row">
<div class="col-auto dmp-stepper" *ngIf="this.step != 0"> <div class="col-auto dmp-stepper" *ngIf="this.step != 0">
<div class="stepper-title">DMP Blueprint</div> <div class="stepper-title">DMP Blueprint</div>
@ -81,50 +131,7 @@
<app-form-progress-indication class="col-12" *ngIf="formGroup && !formGroup.disabled && !lockStatus" [formGroup]="formGroup" [isDmpEditor]="true"></app-form-progress-indication> <app-form-progress-indication class="col-12" *ngIf="formGroup && !formGroup.disabled && !lockStatus" [formGroup]="formGroup" [isDmpEditor]="true"></app-form-progress-indication>
</div> </div>
</div> </div>
<div class="col-auto formForStep0" id="editor-form" *ngIf="this.step === 0 && this.isNew">
<div class="col-12 blueprint-section" [hidden]="this.step !== 0">
<div class="input-form">
<div class="heading2">0.1 Title of DMP *</div>
<mat-form-field>
<mat-label>Title</mat-label>
<input matInput type="text" name="label" [formControl]="formGroup.get('label')" required>
<!-- <mat-error *ngIf="formGroup.get('label').hasError('backendError')">
{{formGroup.get('label').getError('backendError').message}}</mat-error>
<mat-error *ngIf="formGroup.get('label').hasError('required')">
{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> -->
</mat-form-field>
</div>
<div class="input-form">
<div class="heading2">0.2 Description of DMP *</div>
<rich-text-editor-component [parentFormGroup]="formGroup" [controlName]="'description'"
[placeholder]="'Fill with description'" [required]="true">
</rich-text-editor-component>
</div>
<div class="dmp-blueprint-form" style="margin-top: 3%;">
<div class="heading2">0.3 Blueprint of DMP *</div>
<mat-form-field>
<mat-label>Select blueprint</mat-label>
<app-single-auto-complete [required]="false" [formControl]="formGroup.get('profile')" placeholder="Select blueprint" [configuration]="dmpBlueprintService.singleAutocompleteConfiguration">
</app-single-auto-complete>
</mat-form-field>
</div>
<div class="row">
<div class="col-5">
<button mat-button class="action-btn" [disabled]="selectedDmpBlueprintDefinition == null" (click)="selectBlueprint()">Next</button>
</div>
<div class="col-7" *ngIf="formGroup.get('profile').value == null || (formGroup.get('profile').value && formGroup.get('profile').value.id !== defaultBlueprintId)">
<div class="row">
<div class="col-6">
<p>or continue with</p>
</div>
<div class="col-6">
<button mat-button class="action-btn" style="float: right;" (click)="selectDefaultBlueprint()">Default Blueprint</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-auto form" id="editor-form" *ngIf="this.step !== 0"> <div class="col-auto form" id="editor-form" *ngIf="this.step !== 0">
<div *ngIf="selectedDmpBlueprintDefinition"> <div *ngIf="selectedDmpBlueprintDefinition">
<div *ngFor="let section of selectedDmpBlueprintDefinition.sections; let i=index"> <div *ngFor="let section of selectedDmpBlueprintDefinition.sections; let i=index">
@ -139,8 +146,8 @@
<div class="heading">{{i + 1}}.{{j + 1}} {{field.label}}<span *ngIf="field.required">*</span></div> <div class="heading">{{i + 1}}.{{j + 1}} {{field.label}}<span *ngIf="field.required">*</span></div>
<div *ngIf="field.description != null && field.description.length > 0" class="hint">{{field.description}}</div> <div *ngIf="field.description != null && field.description.length > 0" class="hint">{{field.description}}</div>
<div class="input-form"> <div class="input-form">
<div *ngIf="field.category === 'SYSTEM'"> <div *ngIf="field.category === dmpBlueprintSectionFieldCategory.SYSTEM">
<div *ngIf="field.type == 0"> <div *ngIf="field.systemFieldType == dmpBlueprintSystemFieldType.TEXT">
<mat-form-field> <mat-form-field>
<input matInput placeholder="{{'DMP-EDITOR.FIELDS.NAME' | translate}}" type="text" name="label" [formControl]="formGroup.get('label')" required> <input matInput placeholder="{{'DMP-EDITOR.FIELDS.NAME' | translate}}" type="text" name="label" [formControl]="formGroup.get('label')" required>
<mat-error *ngIf="formGroup.get('label').hasError('backendError')"> <mat-error *ngIf="formGroup.get('label').hasError('backendError')">
@ -149,12 +156,11 @@
{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> {{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field> </mat-form-field>
</div> </div>
<div *ngIf="field.type == 1"> <div *ngIf="field.systemFieldType == dmpBlueprintSystemFieldType.HTML_TEXT">
<rich-text-editor-component [parentFormGroup]="formGroup" [controlName]="'description'" <rich-text-editor-component [parentFormGroup]="formGroup" [controlName]="'description'" [placeholder]="'DMP-EDITOR.PLACEHOLDER.DESCRIPTION'" [required]="field.required">
[placeholder]="'DMP-EDITOR.PLACEHOLDER.DESCRIPTION'" [required]="field.required">
</rich-text-editor-component> </rich-text-editor-component>
</div> </div>
<div *ngIf="field.type == 2"> <div *ngIf="field.systemFieldType == dmpBlueprintSystemFieldType.RESEARCHERS">
<mat-form-field> <mat-form-field>
<mat-label>{{'DMP-EDITOR.PLACEHOLDER.RESEARCHERS' | translate}}</mat-label> <mat-label>{{'DMP-EDITOR.PLACEHOLDER.RESEARCHERS' | translate}}</mat-label>
<app-multiple-auto-complete [formControl]="formGroup.get('researchers')" [configuration]="researchersAutoCompleteConfiguration"> <app-multiple-auto-complete [formControl]="formGroup.get('researchers')" [configuration]="researchersAutoCompleteConfiguration">
@ -172,7 +178,7 @@
<span *ngIf="!formGroup.get('researchers').disabled" class="insert-manually" (click)="addResearcher($event)">{{'DMP-EDITOR.ACTIONS.INSERT-MANUALLY' | translate}}</span> <span *ngIf="!formGroup.get('researchers').disabled" class="insert-manually" (click)="addResearcher($event)">{{'DMP-EDITOR.ACTIONS.INSERT-MANUALLY' | translate}}</span>
</div> </div>
</div> </div>
<div *ngIf="field.type == 3"> <div *ngIf="field.systemFieldType == dmpBlueprintSystemFieldType.ORGANIZATIONS">
<mat-form-field> <mat-form-field>
<mat-label>{{'DMP-EDITOR.PLACEHOLDER.ORGANIZATION' | translate}}</mat-label> <mat-label>{{'DMP-EDITOR.PLACEHOLDER.ORGANIZATION' | translate}}</mat-label>
<app-multiple-auto-complete [formControl]="formGroup.get('organisations')" [configuration]="organisationsAutoCompleteConfiguration"> <app-multiple-auto-complete [formControl]="formGroup.get('organisations')" [configuration]="organisationsAutoCompleteConfiguration">
@ -189,7 +195,7 @@
<span *ngIf="!cantAddOrganizations()" class="insert-manually" (click)="addOrganization($event)">{{'DMP-EDITOR.ACTIONS.INSERT-MANUALLY' | translate}}</span> <span *ngIf="!cantAddOrganizations()" class="insert-manually" (click)="addOrganization($event)">{{'DMP-EDITOR.ACTIONS.INSERT-MANUALLY' | translate}}</span>
</div> </div>
</div> </div>
<div *ngIf="field.type == 4"> <div *ngIf="field.systemFieldType == dmpBlueprintSystemFieldType.LANGUAGE">
<mat-form-field> <mat-form-field>
<mat-select [formControl]="formGroup.get('extraProperties').get('language')" placeholder="{{'DMP-EDITOR.FIELDS.LANGUAGE' | translate}}" required> <mat-select [formControl]="formGroup.get('extraProperties').get('language')" placeholder="{{'DMP-EDITOR.FIELDS.LANGUAGE' | translate}}" required>
<mat-option *ngFor="let lang of getLanguageInfos()" [value]="lang.code"> <mat-option *ngFor="let lang of getLanguageInfos()" [value]="lang.code">
@ -202,7 +208,7 @@
{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> {{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field> </mat-form-field>
</div> </div>
<div *ngIf="field.type == 5"> <div *ngIf="field.systemFieldType == dmpBlueprintSystemFieldType.CONTACT">
<div class="contact-form"> <div class="contact-form">
<mat-form-field> <mat-form-field>
<mat-select [formControl]="formGroup.get('extraProperties').get('contact')" placeholder="{{'DMP-EDITOR.FIELDS.CONTACT' | translate}}"> <mat-select [formControl]="formGroup.get('extraProperties').get('contact')" placeholder="{{'DMP-EDITOR.FIELDS.CONTACT' | translate}}">
@ -217,16 +223,16 @@
</mat-form-field> </mat-form-field>
</div> </div>
</div> </div>
<div *ngIf="field.type == 6"> <div *ngIf="field.systemFieldType == dmpBlueprintSystemFieldType.FUNDER">
<funding-info [formGroup]="formGroup" [grantformGroup]="formGroup.get('grant')" [projectFormGroup]="formGroup.get('project')" [funderFormGroup]="formGroup.get('funder')" [isFinalized]="isFinalized" [isNew]="isNew" [isUserOwner]="isUserOwner" [isRequired]="field.required" [type]="1" (onFormChanged)="formChanged()"></funding-info> <funding-info [formGroup]="formGroup" [grantformGroup]="formGroup.get('grant')" [projectFormGroup]="formGroup.get('project')" [funderFormGroup]="formGroup.get('funder')" [isFinalized]="isFinalized" [isNew]="isNew" [isUserOwner]="isUserOwner" [isRequired]="field.required" [type]="1" (onFormChanged)="formChanged()"></funding-info>
</div> </div>
<div *ngIf="field.type == 7"> <div *ngIf="field.systemFieldType == dmpBlueprintSystemFieldType.GRANT">
<funding-info [formGroup]="formGroup" [grantformGroup]="formGroup.get('grant')" [projectFormGroup]="formGroup.get('project')" [funderFormGroup]="formGroup.get('funder')" [isFinalized]="isFinalized" [isNew]="isNew" [isUserOwner]="isUserOwner" [isRequired]="field.required" [type]="2" (onFormChanged)="formChanged()"></funding-info> <funding-info [formGroup]="formGroup" [grantformGroup]="formGroup.get('grant')" [projectFormGroup]="formGroup.get('project')" [funderFormGroup]="formGroup.get('funder')" [isFinalized]="isFinalized" [isNew]="isNew" [isUserOwner]="isUserOwner" [isRequired]="field.required" [type]="2" (onFormChanged)="formChanged()"></funding-info>
</div> </div>
<div *ngIf="field.type == 8"> <div *ngIf="field.systemFieldType == dmpBlueprintSystemFieldType.PROJECT">
<funding-info [formGroup]="formGroup" [grantformGroup]="formGroup.get('grant')" [projectFormGroup]="formGroup.get('project')" [funderFormGroup]="formGroup.get('funder')" [isFinalized]="isFinalized" [isNew]="isNew" [isUserOwner]="isUserOwner" [isRequired]="field.required" [type]="3" (onFormChanged)="formChanged()"></funding-info> <funding-info [formGroup]="formGroup" [grantformGroup]="formGroup.get('grant')" [projectFormGroup]="formGroup.get('project')" [funderFormGroup]="formGroup.get('funder')" [isFinalized]="isFinalized" [isNew]="isNew" [isUserOwner]="isUserOwner" [isRequired]="field.required" [type]="3" (onFormChanged)="formChanged()"></funding-info>
</div> </div>
<div *ngIf="field.type == 9"> <div *ngIf="field.systemFieldType == dmpBlueprintSystemFieldType.LICENSE">
<mat-form-field> <mat-form-field>
<app-single-auto-complete [formControl]="formGroup.get('extraProperties').get('license')" placeholder="{{'DMP-EDITOR.FIELDS.LICENSE' | translate}}" [configuration]="licenseAutoCompleteConfiguration"> <app-single-auto-complete [formControl]="formGroup.get('extraProperties').get('license')" placeholder="{{'DMP-EDITOR.FIELDS.LICENSE' | translate}}" [configuration]="licenseAutoCompleteConfiguration">
</app-single-auto-complete> </app-single-auto-complete>
@ -236,7 +242,7 @@
{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> {{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field> </mat-form-field>
</div> </div>
<div *ngIf="field.type == 10"> <div *ngIf="field.systemFieldType == dmpBlueprintSystemFieldType.ACCESS_RIGHTS">
<mat-form-field> <mat-form-field>
<mat-select [formControl]="formGroup.get('extraProperties').get('visible')" placeholder="{{'DMP-EDITOR.FIELDS.VISIBILITY' | translate}}"> <mat-select [formControl]="formGroup.get('extraProperties').get('visible')" placeholder="{{'DMP-EDITOR.FIELDS.VISIBILITY' | translate}}">
<mat-option *ngFor="let vis of visibles" [value]="vis.value"> <mat-option *ngFor="let vis of visibles" [value]="vis.value">
@ -249,7 +255,7 @@
{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> {{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field> </mat-form-field>
</div> </div>
<!-- <div *ngIf="field.type == 'DESCRIPTION_TEMPLATES'"> <!-- <div *ngIf="field.systemFieldType == 'DESCRIPTION_TEMPLATES'">
<mat-form-field> <mat-form-field>
<mat-label>{{'DMP-EDITOR.FIELDS.SELECT-TEMPLATE' | translate}}</mat-label> <mat-label>{{'DMP-EDITOR.FIELDS.SELECT-TEMPLATE' | translate}}</mat-label>
<app-multiple-auto-complete placeholder="{{'DMP-EDITOR.FIELDS.SELECT-TEMPLATE' | translate}}" [hidePlaceholder]="true" required='true' [formControl]="formGroup.get('profiles')" [configuration]="profilesAutoCompleteConfiguration" (optionRemoved)="onRemoveTemplate($event)" (optionActionClicked)="onPreviewTemplate($event)" (optionSelected)="onOptionSelected()"> <app-multiple-auto-complete placeholder="{{'DMP-EDITOR.FIELDS.SELECT-TEMPLATE' | translate}}" [hidePlaceholder]="true" required='true' [formControl]="formGroup.get('profiles')" [configuration]="profilesAutoCompleteConfiguration" (optionRemoved)="onRemoveTemplate($event)" (optionActionClicked)="onPreviewTemplate($event)" (optionSelected)="onOptionSelected()">
@ -267,31 +273,30 @@
</div> </div>
</div> --> </div> -->
</div> </div>
<div *ngIf="field.category === 'EXTRA'"> <div *ngIf="field.category === dmpBlueprintSectionFieldCategory.EXTRA">
<div *ngIf="field.type === extraFieldTypesEnum.TEXT"> <div *ngIf="field.dataType === dmpBlueprintExtraFieldDataType.TEXT">
<mat-form-field> <mat-form-field>
<input matInput placeholder="{{field.placeholder}}" type="text" name="value" [formControl]="formGroup.get('extraFields').get(getExtraFieldIndex(field.id)).get('value')" [required]="field.required"> <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> </mat-form-field>
</div> </div>
<div *ngIf="field.type === extraFieldTypesEnum.RICH_TEXT"> <div *ngIf="field.dataType === dmpBlueprintExtraFieldDataType.RICH_TEXT">
<ng-container formArrayName="extraFields"> <ng-container formArrayName="extraFields">
<ng-container *ngFor="let control of extraFieldsArray().controls; let extraFieldIndex = index;"> <ng-container *ngFor="let control of extraFieldsArray().controls; let extraFieldIndex = index;">
<ng-container [formGroupName]="extraFieldIndex"> <ng-container [formGroupName]="extraFieldIndex">
<ng-container *ngIf="control.get('id').value === field.id"> <ng-container *ngIf="control.get('id').value === field.id">
<rich-text-editor-component [parentFormGroup]="control" [controlName]="'value'" <rich-text-editor-component [parentFormGroup]="control" [controlName]="'value'" [placeholder]="field.placeholder" [required]="field.required">
[placeholder]="field.placeholder" [required]="field.required">
</rich-text-editor-component> </rich-text-editor-component>
</ng-container> </ng-container>
</ng-container> </ng-container>
</ng-container> </ng-container>
</ng-container> </ng-container>
</div> </div>
<div *ngIf="field.type === extraFieldTypesEnum.DATE"> <div *ngIf="field.dataType === dmpBlueprintExtraFieldDataType.DATE">
<mat-form-field> <mat-form-field>
<input matInput placeholder="{{field.placeholder}}" type="date" name="value" [formControl]="formGroup.get('extraFields').get(getExtraFieldIndex(field.id)).get('value')" [required]="field.required"> <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> </mat-form-field>
</div> </div>
<div *ngIf="field.type === extraFieldTypesEnum.NUMBER"> <div *ngIf="field.dataType === dmpBlueprintExtraFieldDataType.NUMBER">
<mat-form-field> <mat-form-field>
<input matInput placeholder="{{field.placeholder}}" type="number" name="value" [formControl]="formGroup.get('extraFields').get(getExtraFieldIndex(field.id)).get('value')" [required]="field.required"> <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> </mat-form-field>

View File

@ -56,6 +56,7 @@ import { ExtraPropertiesFormModel } from '../editor/general-tab/extra-properties
import { FunderFormModel } from '../editor/grant-tab/funder-form-model'; import { FunderFormModel } from '../editor/grant-tab/funder-form-model';
import { GrantTabModel } from '../editor/grant-tab/grant-tab-model'; import { GrantTabModel } from '../editor/grant-tab/grant-tab-model';
import { ProjectFormModel } from '../editor/grant-tab/project-form-model'; import { ProjectFormModel } from '../editor/grant-tab/project-form-model';
import { DmpBlueprintSectionFieldCategory } from '@app/core/common/enum/dmp-blueprint-section-field-category';
interface Visible { interface Visible {
value: boolean; value: boolean;
@ -87,6 +88,7 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im
isCreateNewProject = false; isCreateNewProject = false;
isCreateNewFunder = false; isCreateNewFunder = false;
dmp: DmpEditorModel; dmp: DmpEditorModel;
dmpSectionIndex: number = 0; dmpSectionIndex: number = 0;
formGroup: UntypedFormGroup = null; formGroup: UntypedFormGroup = null;
@ -110,8 +112,6 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im
sectionTemplates: Array<Array<DatasetProfileModel>> = new Array<Array<DatasetProfileModel>>(); sectionTemplates: Array<Array<DatasetProfileModel>> = new Array<Array<DatasetProfileModel>>();
extraFieldTypesEnum = DmpBlueprintExtraFieldDataType;
private associates: UserModel[] = []; private associates: UserModel[] = [];
visibles: Visible[] = [ visibles: Visible[] = [
@ -128,6 +128,16 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im
profilesAutoCompleteConfiguration: MultipleAutoCompleteConfiguration; profilesAutoCompleteConfiguration: MultipleAutoCompleteConfiguration;
dmpBlueprintSectionFieldCategory = DmpBlueprintSectionFieldCategory;
dmpBlueprintSystemFieldType = DmpBlueprintSystemFieldType;
//public dmpBlueprintSystemFieldTypeEnum = this.enumUtils.getEnumValues(DmpBlueprintSystemFieldType);
dmpBlueprintExtraFieldDataType = DmpBlueprintExtraFieldDataType;
//public dmpBlueprintExtraFieldDataTypeEnum = this.enumUtils.getEnumValues(DmpBlueprintExtraFieldDataType);
constructor( constructor(
private dmpBlueprintService: DmpBlueprintService, private dmpBlueprintService: DmpBlueprintService,
private datasetService: DatasetService, private datasetService: DatasetService,

View File

@ -1,14 +1,13 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router'; import { RouterModule, Routes } from '@angular/router';
import { AuthGuard } from '@app/core/auth-guard.service';
import { CanDeactivateGuard } from '@app/library/deactivate/can-deactivate.guard';
import { DmpCloneComponent } from './clone/dmp-clone.component';
import { DmpEditorBlueprintComponent } from './dmp-editor-blueprint/dmp-editor-blueprint.component';
import { DmpEditorComponent } from './editor/dmp-editor.component'; import { DmpEditorComponent } from './editor/dmp-editor.component';
import { InvitationAcceptedComponent } from './invitation/accepted/dmp-invitation-accepted.component'; import { InvitationAcceptedComponent } from './invitation/accepted/dmp-invitation-accepted.component';
import { DmpListingComponent } from './listing/dmp-listing.component'; import { DmpListingComponent } from './listing/dmp-listing.component';
import { DmpWizardComponent } from './wizard/dmp-wizard.component';
import { DmpOverviewComponent } from './overview/dmp-overview.component'; import { DmpOverviewComponent } from './overview/dmp-overview.component';
import { DmpCloneComponent } from './clone/dmp-clone.component';
import { AuthGuard } from '@app/core/auth-guard.service';
import { CanDeactivateGuard } from '@app/library/deactivate/can-deactivate.guard';
import { DmpEditorBlueprintComponent } from './dmp-editor-blueprint/dmp-editor-blueprint.component';
const routes: Routes = [ const routes: Routes = [
{ {

View File

@ -5,6 +5,7 @@
<div class="col-12 card"> <div class="col-12 card">
<!-- Title Field --> <!-- Title Field -->
<div class="row"> <div class="row">
dgdfgdfgdf
<div class="col-12"> <div class="col-12">
<div class="heading">1.1 {{'DMP-EDITOR.FIELDS.NAME' | translate}}*</div> <div class="heading">1.1 {{'DMP-EDITOR.FIELDS.NAME' | translate}}*</div>
<!-- <div class="hint">{{'DMP-EDITOR.MAIN-INFO.HINT' | translate}}</div> --> <!-- <div class="hint">{{'DMP-EDITOR.MAIN-INFO.HINT' | translate}}</div> -->

View File

@ -50,6 +50,7 @@
"value": "pl" "value": "pl"
} }
], ],
"defaultBlueprintId": "86635178-36a6-484f-9057-a934e4eeecd5",
"keycloak": { "keycloak": {
"enabled": true, "enabled": true,
"address": null, "address": null,

View File

@ -1156,6 +1156,7 @@
"RELATED-GRANT": "Related Grant", "RELATED-GRANT": "Related Grant",
"DESCRIPTION": "Description", "DESCRIPTION": "Description",
"DESCRIPTION-HINT": "Briefly describe the context and purpose of the DMP", "DESCRIPTION-HINT": "Briefly describe the context and purpose of the DMP",
"BLUEPRINT": "Blueprint",
"ORGANISATIONS": "Organizations", "ORGANISATIONS": "Organizations",
"ORGANISATIONS-HINT": "Add here the names of the organizations contributing to the creation and revision of the DMPs", "ORGANISATIONS-HINT": "Add here the names of the organizations contributing to the creation and revision of the DMPs",
"RESEARCHERS": "Researchers", "RESEARCHERS": "Researchers",
@ -1189,6 +1190,8 @@
}, },
"ACTIONS": { "ACTIONS": {
"GO-TO-GRANT": "Go To DMP Grant", "GO-TO-GRANT": "Go To DMP Grant",
"DEFAULT-BLUEPRINT": "Default Blueprint",
"OR-CONTINUE-WITH": "or continue with",
"GO-TO-DATASETS": "Go To Datasets", "GO-TO-DATASETS": "Go To Datasets",
"SAVE-CHANGES": "Save Changes", "SAVE-CHANGES": "Save Changes",
"SAVE": "Save", "SAVE": "Save",
@ -1206,6 +1209,7 @@
"PLACEHOLDER": { "PLACEHOLDER": {
"DESCRIPTION": "Fill with description", "DESCRIPTION": "Fill with description",
"ORGANIZATION": "Select organization", "ORGANIZATION": "Select organization",
"BLUEPRINT": "Select Blueprint",
"AUTHORS": "Select authors", "AUTHORS": "Select authors",
"RESEARCHERS": "Select researchers" "RESEARCHERS": "Select researchers"
}, },