Merge remote-tracking branch 'origin/Development' into roadmap

This commit is contained in:
Konstantinos Triantafyllou 2022-05-21 00:31:12 +03:00
commit d6e89cd440
24 changed files with 347 additions and 273 deletions

View File

@ -28,13 +28,15 @@ public class PrefillingManager {
private final ConfigLoader configLoader; private final ConfigLoader configLoader;
private final ObjectMapper objectMapper; private final ObjectMapper objectMapper;
private final DatasetManager datasetManager; private final DatasetManager datasetManager;
private final LicenseManager licenseManager;
@Autowired @Autowired
public PrefillingManager(ApiContext apiContext, ConfigLoader configLoader, DatasetManager datasetManager) { public PrefillingManager(ApiContext apiContext, ConfigLoader configLoader, DatasetManager datasetManager, LicenseManager licenseManager) {
this.apiContext = apiContext; this.apiContext = apiContext;
this.configLoader = configLoader; this.configLoader = configLoader;
this.objectMapper = new ObjectMapper(); this.objectMapper = new ObjectMapper();
this.datasetManager = datasetManager; this.datasetManager = datasetManager;
this.licenseManager = licenseManager;
} }
public List<Prefilling> getPrefillings(String like, String configId) { public List<Prefilling> getPrefillings(String like, String configId) {
@ -50,7 +52,7 @@ public class PrefillingManager {
PrefillingGet prefillingGet = prefillingConfig.getPrefillingGet(); PrefillingGet prefillingGet = prefillingConfig.getPrefillingGet();
Map<String, Object> prefillingEntity = getSingle(prefillingGet.getUrl(), prefillId); Map<String, Object> prefillingEntity = getSingle(prefillingGet.getUrl(), prefillId);
DatasetProfile datasetProfile = apiContext.getOperationsContext().getDatabaseRepository().getDatasetProfileDao().find(profileId); DatasetProfile datasetProfile = apiContext.getOperationsContext().getDatabaseRepository().getDatasetProfileDao().find(profileId);
return PrefillingMapper.mapPrefilledEntityToDatasetWizard(prefillingEntity, prefillingGet, prefillingConfig.getType(), datasetProfile, datasetManager); return PrefillingMapper.mapPrefilledEntityToDatasetWizard(prefillingEntity, prefillingGet, prefillingConfig.getType(), datasetProfile, datasetManager, licenseManager);
} }
private Map<String, Object> getSingle(String url, String id) { private Map<String, Object> getSingle(String url, String id) {

View File

@ -9,10 +9,13 @@ import eu.eudat.data.entities.DatasetProfile;
import eu.eudat.elastic.entities.Tag; import eu.eudat.elastic.entities.Tag;
import eu.eudat.logic.managers.DatasetManager; import eu.eudat.logic.managers.DatasetManager;
import eu.eudat.logic.managers.DatasetProfileManager; import eu.eudat.logic.managers.DatasetProfileManager;
import eu.eudat.logic.managers.LicenseManager;
import eu.eudat.logic.proxy.config.entities.DefaultPrefillingMapping; import eu.eudat.logic.proxy.config.entities.DefaultPrefillingMapping;
import eu.eudat.logic.proxy.config.entities.PrefillingFixedMapping; import eu.eudat.logic.proxy.config.entities.PrefillingFixedMapping;
import eu.eudat.logic.proxy.config.entities.PrefillingGet; import eu.eudat.logic.proxy.config.entities.PrefillingGet;
import eu.eudat.logic.proxy.config.entities.PrefillingMapping; import eu.eudat.logic.proxy.config.entities.PrefillingMapping;
import eu.eudat.logic.proxy.config.exceptions.HugeResultSet;
import eu.eudat.logic.proxy.config.exceptions.NoURLFound;
import eu.eudat.logic.utilities.helpers.StreamDistinctBy; import eu.eudat.logic.utilities.helpers.StreamDistinctBy;
import eu.eudat.logic.utilities.json.JsonSearcher; import eu.eudat.logic.utilities.json.JsonSearcher;
import eu.eudat.models.data.components.commons.datafield.AutoCompleteData; import eu.eudat.models.data.components.commons.datafield.AutoCompleteData;
@ -20,6 +23,7 @@ import eu.eudat.models.data.datasetprofile.DatasetProfileOverviewModel;
import eu.eudat.models.data.datasetprofile.RenderStyle; import eu.eudat.models.data.datasetprofile.RenderStyle;
import eu.eudat.models.data.datasetwizard.DatasetWizardModel; import eu.eudat.models.data.datasetwizard.DatasetWizardModel;
import eu.eudat.models.data.externaldataset.ExternalAutocompleteFieldModel; import eu.eudat.models.data.externaldataset.ExternalAutocompleteFieldModel;
import eu.eudat.models.data.license.LicenseModel;
import org.json.JSONObject; import org.json.JSONObject;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
@ -33,7 +37,7 @@ public class PrefillingMapper {
private static final ObjectMapper mapper = new ObjectMapper().configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true); private static final ObjectMapper mapper = new ObjectMapper().configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true);
public static DatasetWizardModel mapPrefilledEntityToDatasetWizard(Map<String, Object> prefilledEntity, PrefillingGet prefillingGet, String type, public static DatasetWizardModel mapPrefilledEntityToDatasetWizard(Map<String, Object> prefilledEntity, PrefillingGet prefillingGet, String type,
DatasetProfile profile, DatasetManager datasetManager) throws Exception { DatasetProfile profile, DatasetManager datasetManager, LicenseManager licenseManager) throws Exception {
DatasetWizardModel datasetWizardModel = new DatasetWizardModel(); DatasetWizardModel datasetWizardModel = new DatasetWizardModel();
datasetWizardModel.setProfile(new DatasetProfileOverviewModel().fromDataModel(profile)); datasetWizardModel.setProfile(new DatasetProfileOverviewModel().fromDataModel(profile));
Dataset dataset = new Dataset(); Dataset dataset = new Dataset();
@ -50,17 +54,17 @@ public class PrefillingMapper {
sourceValue = ((Map)sourceValue).get(sourceKey); sourceValue = ((Map)sourceValue).get(sourceKey);
} }
} }
setValue(prefillingMapping, mapper.writeValueAsString(sourceValue), datasetWizardModel, parentNode, properties, type); setValue(prefillingMapping, mapper.writeValueAsString(sourceValue), datasetWizardModel, parentNode, properties, type, licenseManager);
} }
for (PrefillingFixedMapping fixedMapping: prefillingGet.getFixedMappings()) { for (PrefillingFixedMapping fixedMapping: prefillingGet.getFixedMappings()) {
setValue(fixedMapping, fixedMapping.getValue(), datasetWizardModel, parentNode, properties, type); setValue(fixedMapping, fixedMapping.getValue(), datasetWizardModel, parentNode, properties, type, licenseManager);
} }
dataset.setProperties(mapper.writeValueAsString(properties)); dataset.setProperties(mapper.writeValueAsString(properties));
datasetWizardModel.setDatasetProfileDefinition(datasetManager.getPagedProfile(datasetWizardModel, dataset)); datasetWizardModel.setDatasetProfileDefinition(datasetManager.getPagedProfile(datasetWizardModel, dataset));
return datasetWizardModel; return datasetWizardModel;
} }
private static void setValue(PrefillingMapping prefillingMapping, String value, DatasetWizardModel datasetWizardModel, JsonNode parentNode, Map<String, Object> properties, String type) throws InvocationTargetException, IllegalAccessException, JsonProcessingException { private static void setValue(PrefillingMapping prefillingMapping, String value, DatasetWizardModel datasetWizardModel, JsonNode parentNode, Map<String, Object> properties, String type, LicenseManager licenseManager) throws InvocationTargetException, IllegalAccessException, JsonProcessingException {
String trimRegex = prefillingMapping.getTrimRegex() != null ? prefillingMapping.getTrimRegex() : ""; String trimRegex = prefillingMapping.getTrimRegex() != null ? prefillingMapping.getTrimRegex() : "";
if (!value.startsWith("\"") && !value.startsWith("[") && !value.equals("null")) { if (!value.startsWith("\"") && !value.startsWith("[") && !value.equals("null")) {
value = "\"" + value + "\""; value = "\"" + value + "\"";
@ -158,6 +162,17 @@ public class PrefillingMapper {
} }
properties.put(id, datasetID.toString()); properties.put(id, datasetID.toString());
break; break;
case LICENSES:
try {
List<LicenseModel> licenses = licenseManager.getLicenses("", "");
String finalParsedValue = parsedValue;
licenses = licenses.stream().filter(license -> license.getPid().equals(finalParsedValue)).collect(Collectors.toList());
properties.put(id, licenses);
}
catch (NoURLFound | HugeResultSet e){
properties.put(id, parsedValue);
}
break;
default: default:
if (!parsedValues.isEmpty()) if (!parsedValues.isEmpty())
properties.put(id, String.join(", ", parsedValues)); properties.put(id, String.join(", ", parsedValues));

View File

@ -1214,9 +1214,6 @@ but not
<fixedMapping maDmpTarget="dataset.distribution.host.description" value="Repository hosted by Zenodo" /> <fixedMapping maDmpTarget="dataset.distribution.host.description" value="Repository hosted by Zenodo" />
<fixedMapping maDmpTarget="dataset.distribution.host.url" value="https://zenodo.org" /> <fixedMapping maDmpTarget="dataset.distribution.host.url" value="https://zenodo.org" />
<fixedMapping maDmpTarget="dataset.distribution.host.pid_system" value="doi" /> <fixedMapping maDmpTarget="dataset.distribution.host.pid_system" value="doi" />
<fixedMapping maDmpTarget="dataset.security_and_privacy.title" value="TBD" />
<fixedMapping maDmpTarget="dataset.security_and_privacy.description" value="TBD" />
<fixedMapping maDmpTarget="dataset.preservation_statement" value="TBD" />
</fixedMappings> </fixedMappings>
</prefillingGet> </prefillingGet>
</config> </config>

View File

@ -8,7 +8,8 @@ import {FormControl} from "@angular/forms";
<div class="editor-wrapper" [class]="wrapperClasses" [formGroup]="parentFormGroup"> <div class="editor-wrapper" [class]="wrapperClasses" [formGroup]="parentFormGroup">
<angular-editor class="full-width editor" [ngClass]="editable ? '': 'disabled'" [id]="id" <angular-editor class="full-width editor" [ngClass]="editable ? '': 'disabled'" [id]="id"
[config]="editorConfig" [formControlName]="controlName" [config]="editorConfig" [formControlName]="controlName"
placeholder="{{(placeholder? (placeholder | translate) : '') + (required ? ' *': '')}}"></angular-editor> placeholder="{{(placeholder? (placeholder | translate) : '') + (required ? ' *': '')}}"
(paste)="pasteWithoutFormatting($event)"></angular-editor>
<mat-icon *ngIf="formInput.value" (click)="formInput.patchValue('')" class="clear">close</mat-icon> <mat-icon *ngIf="formInput.value" (click)="formInput.patchValue('')" class="clear">close</mat-icon>
</div> </div>
`, `,
@ -40,6 +41,14 @@ export class RichTextEditorComponent {
defaultFontSize: '', defaultFontSize: '',
sanitize: true, sanitize: true,
toolbarPosition: 'top', toolbarPosition: 'top',
customClasses: [
{ name: 'H1 header', class: '', tag: 'h1' },
{ name: 'H2 header', class: '', tag: 'h2' },
{ name: 'H3 header', class: '', tag: 'h3' },
{ name: 'H4 header', class: '', tag: 'h4' },
{ name: 'H5 header', class: '', tag: 'h5'},
{ name: 'H6 header', class: '', tag: 'h6'}
],
toolbarHiddenButtons: [ toolbarHiddenButtons: [
[ [
'heading', 'heading',
@ -48,10 +57,10 @@ export class RichTextEditorComponent {
[ [
'fontSize', 'fontSize',
'backgroundColor', 'backgroundColor',
'customClasses', // 'customClasses',
'insertImage', 'insertImage',
'insertVideo', 'insertVideo',
'removeFormat', // 'removeFormat',
'toggleEditorMode' 'toggleEditorMode'
] ]
] ]
@ -64,4 +73,10 @@ export class RichTextEditorComponent {
ngAfterContentInit() { ngAfterContentInit() {
this.editorConfig.editable = this.editable; this.editorConfig.editable = this.editable;
} }
pasteWithoutFormatting($event) {
$event.preventDefault();
const text = $event.clipboardData.getData("text/plain");
window.document.execCommand("insertText", false, text);
}
} }

View File

@ -7,122 +7,98 @@
<!-- Total steps: {{stepper.steps.length}} --> <!-- Total steps: {{stepper.steps.length}} -->
<div id="header-outer-wrapper">
<div class="row">
<div class="col-12 d-flex" id="title-column">
<div class="row"> <div style="padding-left: 2em;">
<div class="col-12 d-flex" id="title-column"> <h3 *ngIf="isNew && !isClone && !isNewVersion">{{'DATASET-PROFILE-EDITOR.TITLE.NEW-PROFILE' | translate}}</h3>
<h3 *ngIf="isNew && isClone">
<span *ngIf="isClone">{{'DATASET-PROFILE-EDITOR.TITLE.NEW-PROFILE-CLONE' | translate}}</span>
{{form.get('label').value}}
</h3>
<h3 *ngIf="isNew && isNewVersion">
<span *ngIf="isNewVersion">{{'DATASET-PROFILE-EDITOR.TITLE.NEW-PROFILE-VERSION' | translate}}</span>
{{form.get('label').value}}
</h3>
<div style="padding-left: 2em;"> <h3 *ngIf="!isNew">{{form.get('label').value}}</h3>
<h3 *ngIf="isNew && !isClone && !isNewVersion">{{'DATASET-PROFILE-EDITOR.TITLE.NEW-PROFILE' | translate}}</h3> </div>
<h3 *ngIf="isNew && isClone"> <ng-container *ngTemplateOutlet="actions"></ng-container>
<span *ngIf="isClone">{{'DATASET-PROFILE-EDITOR.TITLE.NEW-PROFILE-CLONE' | translate}}</span>
{{form.get('label').value}}
</h3>
<h3 *ngIf="isNew && isNewVersion">
<span *ngIf="isNewVersion">{{'DATASET-PROFILE-EDITOR.TITLE.NEW-PROFILE-VERSION' | translate}}</span>
{{form.get('label').value}}
</h3>
<h3 *ngIf="!isNew">{{form.get('label').value}}</h3>
<!-- <div class="d-flex justify-content-end" style="gap: 1em">
<button mat-raised-button *ngIf="form.get('status').value==1" class="template_action_btn" (click)="downloadXML();" type="button" [@action-btn]>{{
'DATASET-WIZARD.ACTIONS.DOWNLOAD-XML' | translate }}</button>
<ng-container *ngIf="!viewOnly">
<button mat-raised-button class="template_action_btn" type="button"
*ngIf="stepper.selectedIndex !=2 && !newVersionId"
[@action-btn]
(click)='finalize()' [disabled]="!form.valid">{{'DATASET-PROFILE-EDITOR.ACTIONS.FINALIZE' |
translate}}</button>
<button mat-raised-button class="template_action_btn" type="button" [@action-btn]
*ngIf="!newVersionId || (newVersionId && stepper.selectedIndex !=2)"
(click)='onSubmit()' [disabled]="!form.valid">{{'DATASET-PROFILE-EDITOR.ACTIONS.SAVE' |
translate}}</button>
</ng-container>
<ng-container *ngIf="showUpdateButton()">
<button mat-raised-button class="template_action_btn" type="button"
*ngIf="stepper.selectedIndex !=2 && !newVersionId"
[@action-btn]
(click)='updateFinalized()' [disabled]="!form.valid">{{'DATASET-PROFILE-EDITOR.ACTIONS.UPDATE' |
translate}}</button>
</ng-container>
<ng-container *ngIf="!isNew">
<button mat-raised-button class="template_action_btn" (click)="delete()" [@action-btn]>
<mat-icon>delete</mat-icon>{{'DATASET-PROFILE-EDITOR.ACTIONS.DELETE' | translate}}
</button>
</ng-container>
</div> -->
</div> </div>
<!-- <div class="d-flex justify-content-end" style="gap: 1em">
<button mat-raised-button *ngIf="form.get('status').value==1" class="template_action_btn" (click)="downloadXML();" type="button" [@action-btn]>{{
'DATASET-WIZARD.ACTIONS.DOWNLOAD-XML' | translate }}</button>
<ng-container *ngIf="!viewOnly">
<button mat-raised-button class="template_action_btn" type="button"
*ngIf="stepper.selectedIndex !=2 && !newVersionId"
[@action-btn]
(click)='finalize()' [disabled]="!form.valid">{{'DATASET-PROFILE-EDITOR.ACTIONS.FINALIZE' |
translate}}</button>
<button mat-raised-button class="template_action_btn" type="button" [@action-btn]
*ngIf="!newVersionId || (newVersionId && stepper.selectedIndex !=2)"
(click)='onSubmit()' [disabled]="!form.valid">{{'DATASET-PROFILE-EDITOR.ACTIONS.SAVE' |
translate}}</button>
</ng-container>
<ng-container *ngIf="showUpdateButton()">
<button mat-raised-button class="template_action_btn" type="button"
*ngIf="stepper.selectedIndex !=2 && !newVersionId"
[@action-btn]
(click)='updateFinalized()' [disabled]="!form.valid">{{'DATASET-PROFILE-EDITOR.ACTIONS.UPDATE' |
translate}}</button>
</ng-container>
<ng-container *ngIf="!isNew">
<button mat-raised-button class="template_action_btn" (click)="delete()" [@action-btn]>
<mat-icon>delete</mat-icon>{{'DATASET-PROFILE-EDITOR.ACTIONS.DELETE' | translate}}
</button>
</ng-container>
</div> -->
</div> </div>
</div>
<div class="row stepper-navigation-outer-wrapper" > <div class="row stepper-navigation-outer-wrapper" >
<!-- Steps Navigation --> <!-- Steps Navigation -->
<div id="stepper-navigation-wrapper"> <div id="stepper-navigation-wrapper">
<div class="col-12 d-flex" *ngIf="steps" id="stepper-navigation"> <div class="col-12 d-flex" *ngIf="steps" id="stepper-navigation">
<div class="col-7 bg-white" style="overflow: hidden; padding: 0px" id="progress-container"> <!-- <button [@previous_btn] mat-button class="navigate-btn mr-3" (click)="stepper.previous()"-->
<div id="progress" [ngStyle]="progressStyle"></div> <!-- [class.navigate-btn-disabled]="stepper.selectedIndex ==0">-->
<div class="row h-100"> <!-- <mat-icon class="back-icon pointer">chevron_left</mat-icon>-->
<div class="col text-center align-self-center" *ngFor="let step of steps; index as idx"> <!-- {{'DMP-EDITOR.STEPPER.PREVIOUS' | translate}}-->
<span (click)="stepper.selectedIndex=idx" <!-- </button>-->
class="stepper-title-label"
[ngClass]="{'stepper-title-label-locked': !isStepUnlocked(idx),'stepper-title-label-completed':idx < stepper.selectedIndex} "> <div class="col-7 bg-white" style="overflow: hidden; padding: 0px" id="progress-container">
<ng-container *ngIf="(step.completed &&(idx!=steps.length-1)) else numberLabel"> <div id="progress" [ngStyle]="progressStyle"></div>
<mat-icon style="font-size:0.7em; height: 0px;">done</mat-icon> <div class="row h-100 progress-min-height">
</ng-container> <div class="col text-center align-self-center" *ngFor="let step of steps; index as idx">
<ng-template #numberLabel> <span (click)="stepper.selectedIndex=idx"
{{idx+1}} class="stepper-title-label"
</ng-template> [ngClass]="{'stepper-title-label-locked': !isStepUnlocked(idx),'stepper-title-label-completed':idx < stepper.selectedIndex} ">
{{step.label}} <ng-container *ngIf="(step.completed &&(idx!=steps.length-1)) else numberLabel">
</span> <mat-icon style="font-size:0.7em; height: 0px;">done</mat-icon>
</ng-container>
<ng-template #numberLabel>
{{idx+1}}
</ng-template>
{{step.label}}
</span>
</div>
</div>
</div> </div>
<!-- <button mat-button class="navigate-btn ml-3"-->
<!-- [@next_btn]-->
<!-- (click)="validateStep(stepper.selectedIndex);stepper.next();"-->
<!-- [ngClass]="{'navigate-btn-disabled': !isStepCompleted(stepper.selectedIndex) || (stepper.selectedIndex === (steps.length-1))}">-->
<!-- <span>{{'DMP-EDITOR.STEPPER.NEXT' | translate}}</span>-->
<!-- <mat-icon class="back-icon pointer">chevron_right</mat-icon>-->
<!-- </button>-->
</div> </div>
</div> </div>
<div class="col d-flex justify-content-end" style="padding-right: 0px;">
<button [@previous_btn] mat-button class="navigate-btn" (click)="stepper.previous()" *ngIf="stepper.selectedIndex !=0">
<!-- <mat-icon>navigate_before</mat-icon> -->
{{'DMP-EDITOR.STEPPER.PREVIOUS' | translate}}
</button>
<button mat-button class="navigate-btn ml-3"
[@next_btn]
(click)="validateStep(stepper.selectedIndex);stepper.next();"
*ngIf="stepper.selectedIndex != (steps.length-1)"
[ngClass]="{'navigate-btn-disabled': !isStepCompleted(stepper.selectedIndex)}">
<mat-icon style="font-size: 1.66em;">navigate_next</mat-icon>{{'DMP-EDITOR.STEPPER.NEXT' | translate}}
</button>
<ng-container *ngIf="steps.length-1 === stepper.selectedIndex">
<button [@finalize_btn] mat-button class="finalize-btn ml-3"
[disabled]="!form.valid"
(click)="updateAndFinalize()"
>
<ng-container *ngIf="form.get('status').value==1">
<ng-container *ngIf="newVersionId else updateText">
{{'DATASET-PROFILE-EDITOR.ACTIONS.SAVE' |translate}}
</ng-container>
<ng-template #updateText>
{{'DATASET-PROFILE-EDITOR.ACTIONS.UPDATE' |translate}}
</ng-template>
</ng-container>
<ng-container *ngIf="form.get('status').value!=1">
{{'DATASET-PROFILE-EDITOR.ACTIONS.FINALIZE' |translate}}
</ng-container>
</button>
</ng-container>
</div>
</div> </div>
</div>
</div> </div>
@ -134,12 +110,7 @@
<mat-step [label]="'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.TITLE' | translate" [completed]="(!form.get('label').invalid && !form.get('description').invalid && !form.get('language').invalid)" > <mat-step [label]="'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.TITLE' | translate" [completed]="(!form.get('label').invalid && !form.get('description').invalid && !form.get('language').invalid)" >
<!-- <ng-template matStepLabel>{{'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.TITLE' | translate}} <!-- <ng-template matStepLabel>{{'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.TITLE' | translate}}
</ng-template> --> </ng-template> -->
<div class="row"> <div class="col-9">
<div class="col-3 side-actions">
<ng-container *ngTemplateOutlet="actions">
</ng-container>
</div>
<div class="col"> <div class="col">
<div class="col-12"> <div class="col-12">
<div class="heading">1.1 {{'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.DATASET-TEMPLATE-NAME'| translate}} *</div> <div class="heading">1.1 {{'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.DATASET-TEMPLATE-NAME'| translate}} *</div>
@ -267,10 +238,6 @@
(dataNeedsRefresh)="onDataNeedsRefresh($event)" (dataNeedsRefresh)="onDataNeedsRefresh($event)"
[colorizeInvalid]="colorizeInvalid"> [colorizeInvalid]="colorizeInvalid">
</dataset-profile-table-of-contents> </dataset-profile-table-of-contents>
<ng-container *ngIf="true then actions">
</ng-container>
</div> </div>
</div> </div>
@ -281,7 +248,7 @@
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="row" *ngIf="selectedTocEntry"> <div class="col-12" *ngIf="selectedTocEntry">
<!-- PAGE INFO --> <!-- PAGE INFO -->
<div class="col-12 content-displayer" *ngIf="selectedTocEntry.type === tocEntryEnumValues.Page" [@fade-in-fast]> <div class="col-12 content-displayer" *ngIf="selectedTocEntry.type === tocEntryEnumValues.Page" [@fade-in-fast]>
@ -370,17 +337,13 @@
<!-- {{'DATASET-PROFILE-EDITOR.ACTIONS.PREVIEW-AND-FINALIZE' | translate}} --> <!-- {{'DATASET-PROFILE-EDITOR.ACTIONS.PREVIEW-AND-FINALIZE' | translate}} -->
<!-- <button (click)="generatePreviewForm()">foo</button> --> <!-- <button (click)="generatePreviewForm()">foo</button> -->
<ng-container *ngIf="formGroup"> <ng-container *ngIf="formGroup">
<div class="row"> <div class="col-9">
<div class="col-3 sticky-top" style="display: flex; height: 40vh;">
<ng-container *ngTemplateOutlet="actions">
</ng-container>
</div>
<div class="col"> <div class="col">
<div class="col-12">
<app-final-preview-component [formGroup]="formGroup" [visibilityRules]="visibilityRules"> <app-final-preview-component [formGroup]="formGroup" [visibilityRules]="visibilityRules">
</app-final-preview-component> </app-final-preview-component>
</div>
</div> </div>
</div> </div>
@ -441,13 +404,37 @@
</ng-container> --> </ng-container> -->
<div class="scroll-on-top"> <!-- <div class="scroll-on-top">-->
<button mat-fab (click)="scrollOnTop()" *ngIf="showScrollOnTopButton" [@scroll-on-top-btn] [matTooltip]="'DATASET-PROFILE-EDITOR.ACTIONS.BACK-TO-TOP'| translate"> <!-- <button mat-fab (click)="scrollOnTop()" *ngIf="showScrollOnTopButton" [@scroll-on-top-btn] [matTooltip]="'DATASET-PROFILE-EDITOR.ACTIONS.BACK-TO-TOP'| translate">-->
<mat-icon> <!-- <mat-icon>-->
keyboard_arrow_up <!-- keyboard_arrow_up-->
</mat-icon> <!-- </mat-icon>-->
</button> <!-- </button>-->
</div> <!-- </div>-->
<a class="scroll-on-top d-flex flex-column align-items-center" (click)="scrollOnTop()" *ngIf="showScrollOnTopButton" [@scroll-on-top-btn] [matTooltip]="'DATASET-PROFILE-EDITOR.ACTIONS.BACK-TO-TOP'| translate">
<mat-icon>
arrow_upward
</mat-icon>
<div>SCROLL</div>
</a>
<ng-container *ngIf="steps && stepper">
<div class="floating-btn">
<button *ngIf="stepper?.selectedIndex > 0" [@previous_btn] mat-button
class="navigate-btn" (click)="stepper?.previous()">
<mat-icon class="back-icon pointer">chevron_left</mat-icon>
{{'DMP-EDITOR.STEPPER.PREVIOUS' | translate}}
</button>
<button *ngIf="stepper?.selectedIndex < (steps.length-1)" mat-button
class="navigate-btn ml-3" [@next_btn]
(click)="validateStep(stepper?.selectedIndex);stepper?.next();"
[ngClass]="{'navigate-btn-disabled': !isStepCompleted(stepper?.selectedIndex)}">
<span>{{'DMP-EDITOR.STEPPER.NEXT' | translate}}</span>
<mat-icon class="back-icon pointer">chevron_right</mat-icon>
</button>
</div>
</ng-container>
<!-- <div class="row"> <!-- <div class="row">
<button (click)="printForm()"> <button (click)="printForm()">
@ -479,9 +466,29 @@
<ng-template #actions> <ng-template #actions>
<div class="actions-template"> <div>
<button mat-raised-button class="template_action_btn" (click)="discardChanges()">{{'DATASET-WIZARD.ACTIONS.BACK' | translate}}</button> <button mat-raised-button class="template_action_btn mr-3" (click)="discardChanges()">{{'DATASET-WIZARD.ACTIONS.CLOSE' | translate}}</button>
<button *ngIf="!viewOnly" mat-raised-button class="template_action_btn save-btn" (click)="onSubmit()" [disabled]="!form.valid">{{'DATASET-PROFILE-EDITOR.ACTIONS.SAVE' |translate}}</button> <button *ngIf="!viewOnly" mat-raised-button class="template_action_btn save-btn" (click)="onSubmit()" [disabled]="!form.valid">
<button *ngIf="viewOnly" [@finalize_btn] mat-raised-button class="template_action_btn save-btn" (click)="updateAndFinalize()">{{'DATASET-PROFILE-EDITOR.ACTIONS.UPDATE' |translate}}</button> {{'DATASET-PROFILE-EDITOR.ACTIONS.SAVE' |translate}}
<mat-icon (click)="$event.stopPropagation();" style="width: 14px;" [matMenuTriggerFor]="menuSave">expand_more</mat-icon>
</button>
<mat-menu #menuSave="matMenu">
<button [disabled]="!form.valid" mat-menu-item (click)="onSubmit(true)" type="button">{{ 'DATASET-WIZARD.ACTIONS.SAVE-AND-CLOSE' | translate }}</button>
<button [disabled]="!form.valid" mat-menu-item (click)="onSubmit()" type="button">{{ 'DATASET-WIZARD.ACTIONS.SAVE-AND-CONTINUE' | translate }}</button>
</mat-menu>
<button *ngIf="viewOnly" [@finalize_btn] mat-raised-button class="template_action_btn save-btn" [disabled]="!form.valid" (click)="updateAndFinalize()">
{{'DATASET-PROFILE-EDITOR.ACTIONS.UPDATE' |translate}}
</button>
<button *ngIf="!viewOnly && steps?.length-1 === stepper?.selectedIndex"
[@finalize_btn] mat-button class="finalize-btn ml-3"
[disabled]="!form.valid"
[class.invisible]="steps?.length-1 !== stepper?.selectedIndex"
(click)="updateAndFinalize()">
<ng-container *ngIf="form.get('status').value!=1">
{{'DATASET-PROFILE-EDITOR.ACTIONS.FINALIZE' |translate}}
</ng-container>
</button>
</div> </div>
</ng-template> </ng-template>

View File

@ -1,5 +1,5 @@
.dataset-profile-editor { .dataset-profile-editor {
margin-top: 1.3rem; //margin-top: 1.3rem;
.full-width { .full-width {
width: 100%; width: 100%;
@ -146,7 +146,7 @@ $blue-color-light: #5cf7f2;
padding-right: 2em; padding-right: 2em;
box-shadow: 0px 3px 6px #1E202029; box-shadow: 0px 3px 6px #1E202029;
color: #212121; color: #212121;
transition-property: background-color, color; transition-property: background-color, color;
transition-duration: 200ms; transition-duration: 200ms;
transition-delay: 50ms; transition-delay: 50ms;
@ -317,11 +317,25 @@ $blue-color-light: #5cf7f2;
text-align: center; text-align: center;
} }
.scroll-on-top{ .scroll-on-top{
position: fixed;
bottom: 20em;
right: 2em;
color: #129D99 !important;
cursor: pointer;
font-size: 1rem;
font-weight: 400;
}
.floating-btn {
position: fixed; position: fixed;
bottom: 2em; bottom: 2em;
right: 2em; right: 2em;
} }
.progress-min-height {
min-height: 35px;
}
#stepper-navigation-wrapper{ #stepper-navigation-wrapper{
z-index: 99; z-index: 99;
@ -343,6 +357,14 @@ $blue-color-light: #5cf7f2;
.stepper-navigation-outer-wrapper{ .stepper-navigation-outer-wrapper{
padding: 2em; padding: 2em;
margin-bottom: 1em; margin-bottom: 1em;
//background: #f4f4f4;
//position: sticky;
//top: 0.01em;
//z-index: 9999;
}
#header-outer-wrapper {
padding-top: 1.3rem;
background: #f4f4f4; background: #f4f4f4;
position: sticky; position: sticky;
top: 0.01em; top: 0.01em;
@ -359,4 +381,4 @@ $blue-color-light: #5cf7f2;
height: 40vh; height: 40vh;
position: sticky; position: sticky;
top: 2em; top: 2em;
} }

View File

@ -85,7 +85,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
inputUserState: 'untriggered'| 'triggered' = 'untriggered'; inputUserState: 'untriggered'| 'triggered' = 'untriggered';
private _inputUserField$:BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false); private _inputUserField$:BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
private _inputUserButton$:BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false); private _inputUserButton$:BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
showScrollOnTopButton:boolean = false; showScrollOnTopButton:boolean = true;
private stepperNavigationObserver: IntersectionObserver; private stepperNavigationObserver: IntersectionObserver;
@ -246,34 +246,34 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
if(tocentries && tocentries.length){ if(tocentries && tocentries.length){
this.selectedTocEntry = tocentries[0]; this.selectedTocEntry = tocentries[0];
} }
setTimeout(() => { // setTimeout(() => {
// const stepperNavigation = document.getElementById('stepper-navigation'); // // const stepperNavigation = document.getElementById('stepper-navigation');
const titleColumn = document.getElementById('title-column'); // // const titleColumn = document.getElementById('title-column');
// const stepperNavigationWrapper = document.getElementById('stepper-navigation-wrapper'); // // const stepperNavigationWrapper = document.getElementById('stepper-navigation-wrapper');
//
if(titleColumn){ // if(titleColumn){
if(this.stepperNavigationObserver){ // if(this.stepperNavigationObserver){
this.stepperNavigationObserver.disconnect(); // this.stepperNavigationObserver.disconnect();
this.stepperNavigationObserver = null; // this.stepperNavigationObserver = null;
} // }
this.stepperNavigationObserver = new IntersectionObserver((e)=>{ // this.stepperNavigationObserver = new IntersectionObserver((e)=>{
e.forEach(_=>{ // e.forEach(_=>{
if(_.isIntersecting){ // if(_.isIntersecting){
this.showScrollOnTopButton = false; // this.showScrollOnTopButton = false;
// stepperNavigation.classList.remove('fixed-navigation'); // // stepperNavigation.classList.remove('fixed-navigation');
// stepperNavigationWrapper.classList.remove('fixed-navigation'); // // stepperNavigationWrapper.classList.remove('fixed-navigation');
}else{ // }else{
this.showScrollOnTopButton = true; // this.showScrollOnTopButton = true;
// stepperNavigation.classList.add('fixed-navigation'); // // stepperNavigation.classList.add('fixed-navigation');
// stepperNavigationWrapper.classList.add('fixed-navigation'); // // stepperNavigationWrapper.classList.add('fixed-navigation');
} // }
}) // })
}, {root:null, rootMargin:'0px', threshold:0}); // }, {root:null, rootMargin:'0px', threshold:0});
this.stepperNavigationObserver.observe(titleColumn); // this.stepperNavigationObserver.observe(titleColumn);
}else{ // }else{
console.log('Could not load scroll On Top Observer') // console.log('Could not load scroll On Top Observer')
} // }
}, 400); // }, 400);
// this._initializeFormValidity(tocentries); // this._initializeFormValidity(tocentries);
//Checking invalid visibilty RULES //Checking invalid visibilty RULES
@ -424,7 +424,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
// (<FormArray>this.form.get('sections')).removeAt(index); // (<FormArray>this.form.get('sections')).removeAt(index);
// } // }
onSubmit() { onSubmit(close: boolean = false) {
let data = this.form.value; let data = this.form.value;
if (this.datasetProfileId) { if (this.datasetProfileId) {
@ -432,7 +432,9 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
.pipe(takeUntil(this._destroyed)) .pipe(takeUntil(this._destroyed))
.subscribe(() => { .subscribe(() => {
this.form.markAsPristine();//deactivate guard this.form.markAsPristine();//deactivate guard
this.router.navigate(['/dataset-profiles']); if(close) {
this.router.navigate(['/dataset-profiles']);
}
this.uiNotificationService.snackBarNotification(this.language.instant('DATASET-PROFILE-EDITOR.FEEDBACK-MESSAGES.SAVE-SUCCESS'), SnackBarNotificationLevel.Success); this.uiNotificationService.snackBarNotification(this.language.instant('DATASET-PROFILE-EDITOR.FEEDBACK-MESSAGES.SAVE-SUCCESS'), SnackBarNotificationLevel.Success);
},error=> this.onCallbackError(error)); },error=> this.onCallbackError(error));
} else if (this.newVersionId) { } else if (this.newVersionId) {
@ -442,8 +444,10 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
.pipe(takeUntil(this._destroyed)) .pipe(takeUntil(this._destroyed))
.subscribe(() => { .subscribe(() => {
this.form.markAsPristine();//deactivate guard this.form.markAsPristine();//deactivate guard
this.router.navigate(['/dataset-profiles']); if(close) {
this.uiNotificationService.snackBarNotification(this.language.instant('DATASET-PROFILE-EDITOR.FEEDBACK-MESSAGES.SAVE-SUCCESS'), SnackBarNotificationLevel.Success); this.router.navigate(['/dataset-profiles']);
}
this.uiNotificationService.snackBarNotification(this.language.instant('DATASET-PROFILE-EDITOR.FEEDBACK-MESSAGES.SAVE-SUCCESS'), SnackBarNotificationLevel.Success);
}, },
error => this.onCallbackErrorNewVersion(error) error => this.onCallbackErrorNewVersion(error)
); );
@ -456,7 +460,9 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
.pipe(takeUntil(this._destroyed)) .pipe(takeUntil(this._destroyed))
.subscribe(() => { .subscribe(() => {
this.form.markAsPristine();//deactivate guard this.form.markAsPristine();//deactivate guard
this.router.navigate(['/dataset-profiles']); if(close) {
this.router.navigate(['/dataset-profiles']);
}
this.uiNotificationService.snackBarNotification(this.language.instant('DATASET-PROFILE-EDITOR.FEEDBACK-MESSAGES.SAVE-SUCCESS'), SnackBarNotificationLevel.Success); this.uiNotificationService.snackBarNotification(this.language.instant('DATASET-PROFILE-EDITOR.FEEDBACK-MESSAGES.SAVE-SUCCESS'), SnackBarNotificationLevel.Success);
}, error=> this.onCallbackError(error)); }, error=> this.onCallbackError(error));
} }

View File

@ -82,12 +82,12 @@
<div>{{'DMP-EDITOR.STEPPER.PREVIOUS' | translate}}</div> <div>{{'DMP-EDITOR.STEPPER.PREVIOUS' | translate}}</div>
</div> </div>
<div *ngIf="this.step < this.maxStep" mat-raised-button type="button" class="col-auto stepper-btn dataset-next ml-auto" (click)="nextStep()"> <div *ngIf="this.step < this.maxStep" mat-raised-button type="button" class="col-auto stepper-btn dataset-next ml-auto" (click)="nextStep()">
<span class="material-icons">chevron_right</span>
<div>{{'DMP-EDITOR.STEPPER.NEXT' | translate}}</div> <div>{{'DMP-EDITOR.STEPPER.NEXT' | translate}}</div>
<span class="material-icons">chevron_right</span>
</div> </div>
<div *ngIf="!formGroup.get('profile').value" mat-raised-button type="button" class="col-auto stepper-btn dataset-next next-disabled ml-auto"> <div *ngIf="!formGroup.get('profile').value" mat-raised-button type="button" class="col-auto stepper-btn dataset-next next-disabled ml-auto">
<span class="material-icons">chevron_right</span>
<div>{{'DMP-EDITOR.STEPPER.NEXT' | translate}}</div> <div>{{'DMP-EDITOR.STEPPER.NEXT' | translate}}</div>
<span class="material-icons">chevron_right</span>
</div> </div>
<button [disabled]="saving" (click)="save(saveAnd.addNew)" *ngIf="(step === maxStep) && !lockStatus && formGroup.get('profile').value && !viewOnly" mat-raised-button type="button" class="col-auto stepper-btn add-dataset-btn ml-auto"> <button [disabled]="saving" (click)="save(saveAnd.addNew)" *ngIf="(step === maxStep) && !lockStatus && formGroup.get('profile').value && !viewOnly" mat-raised-button type="button" class="col-auto stepper-btn add-dataset-btn ml-auto">
{{ 'DATASET-WIZARD.ACTIONS.SAVE-AND-ADD' | translate }} {{ 'DATASET-WIZARD.ACTIONS.SAVE-AND-ADD' | translate }}

View File

@ -775,6 +775,7 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme
const errorMessages = this._buildSemiFormErrorMessages(); const errorMessages = this._buildSemiFormErrorMessages();
this.showValidationErrorsDialog(undefined, errorMessages); this.showValidationErrorsDialog(undefined, errorMessages);
this.hintErrors = true; this.hintErrors = true;
this.saving = false;
return; return;
} }
this.submit(saveType); this.submit(saveType);
@ -853,7 +854,7 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme
saveFinalize() { saveFinalize() {
// this.formService.touchAllFormFields(this.formGroup); // this.formService.touchAllFormFields(this.formGroup);
this.saving = true;
if (!this.isSemiFormValid(this.formGroup) || (this.table0fContents && this.table0fContents.hasVisibleInvalidFields())) { if (!this.isSemiFormValid(this.formGroup) || (this.table0fContents && this.table0fContents.hasVisibleInvalidFields())) {
// this.showValidationErrorsDialog(); // this.showValidationErrorsDialog();
this.dialog.open(FormValidationErrorsDialogComponent, { this.dialog.open(FormValidationErrorsDialogComponent, {
@ -865,6 +866,7 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme
this.touchForm(); this.touchForm();
this.hintErrors = true; this.hintErrors = true;
this.saving = false;
return; return;
} }
const dialogRef = this.dialog.open(ConfirmationDialogComponent, { const dialogRef = this.dialog.open(ConfirmationDialogComponent, {

View File

@ -90,8 +90,8 @@
<div>{{'DMP-EDITOR.STEPPER.PREVIOUS' | translate}}</div> <div>{{'DMP-EDITOR.STEPPER.PREVIOUS' | translate}}</div>
</div> </div>
<div *ngIf="this.step < 3" mat-raised-button type="button" class="col-auto stepper-btn ml-auto" [ngClass]="{ 'next-disabled': this.step === this.maxStep, 'next': this.step < stepsBeforeDatasets, 'dataset-next': this.step >= stepsBeforeDatasets }" (click)="nextStep()"> <div *ngIf="this.step < 3" mat-raised-button type="button" class="col-auto stepper-btn ml-auto" [ngClass]="{ 'next-disabled': this.step === this.maxStep, 'next': this.step < stepsBeforeDatasets, 'dataset-next': this.step >= stepsBeforeDatasets }" (click)="nextStep()">
<span class="material-icons">chevron_right</span>
<div>{{'DMP-EDITOR.STEPPER.NEXT' | translate}}</div> <div>{{'DMP-EDITOR.STEPPER.NEXT' | translate}}</div>
<span class="material-icons">chevron_right</span>
</div> </div>
<div *ngIf="this.step >= 3 && hasProfile() && !isFinalized" mat-raised-button type="button" class="col-auto stepper-btn add-dataset-btn ml-auto" (click)="addDataset()" target="_blank"> <div *ngIf="this.step >= 3 && hasProfile() && !isFinalized" mat-raised-button type="button" class="col-auto stepper-btn add-dataset-btn ml-auto" (click)="addDataset()" target="_blank">
<mat-icon>add</mat-icon> <mat-icon>add</mat-icon>

View File

@ -69,8 +69,8 @@
<div>{{'DMP-EDITOR.STEPPER.PREVIOUS' | translate}}</div> <div>{{'DMP-EDITOR.STEPPER.PREVIOUS' | translate}}</div>
</div> </div>
<div *ngIf="this.step < 3" mat-raised-button type="button" class="col-auto stepper-btn ml-auto" [ngClass]="{ 'next-disabled': this.step === this.maxStep, 'next': this.step < stepsBeforeDatasets, 'dataset-next': this.step >= stepsBeforeDatasets }" (click)="nextStep()"> <div *ngIf="this.step < 3" mat-raised-button type="button" class="col-auto stepper-btn ml-auto" [ngClass]="{ 'next-disabled': this.step === this.maxStep, 'next': this.step < stepsBeforeDatasets, 'dataset-next': this.step >= stepsBeforeDatasets }" (click)="nextStep()">
<span class="material-icons">chevron_right</span>
<div>{{'DMP-EDITOR.STEPPER.NEXT' | translate}}</div> <div>{{'DMP-EDITOR.STEPPER.NEXT' | translate}}</div>
<span class="material-icons">chevron_right</span>
</div> </div>
<!-- <div *ngIf="this.step >= 3 && hasProfile() && !isFinalized" mat-raised-button type="button" class="col-auto stepper-btn add-dataset-btn ml-auto" (click)="addDataset()" target="_blank"> --> <!-- <div *ngIf="this.step >= 3 && hasProfile() && !isFinalized" mat-raised-button type="button" class="col-auto stepper-btn add-dataset-btn ml-auto" (click)="addDataset()" target="_blank"> -->
<button [disabled]="saving" *ngIf="this.step >= 3 && !isFinalized" mat-raised-button type="button" class="col-auto stepper-btn add-dataset-btn ml-auto" (click)="addDataset()" target="_blank"> <button [disabled]="saving" *ngIf="this.step >= 3 && !isFinalized" mat-raised-button type="button" class="col-auto stepper-btn add-dataset-btn ml-auto" (click)="addDataset()" target="_blank">

View File

@ -20,6 +20,44 @@
</div> </div>
</div> </div>
</div> </div>
<!-- Visibility field-->
<div class="row">
<div class="col-12">
<div class="heading">3.2 {{'DMP-EDITOR.FIELDS.VISIBILITY' | translate}}</div>
<div class="hint">{{'DMP-EDITOR.FIELDS.VISIBILITY-HINT' | translate}}</div>
<div class="visibility-form">
<mat-form-field>
<mat-select [formControl]="formGroup.get('extraProperties').get('visible')" placeholder="{{'DMP-EDITOR.FIELDS.VISIBILITY' | translate}}">
<mat-option *ngFor="let vis of visibles" [value]="vis.value">
{{vis.name | translate}}
</mat-option>
</mat-select>
<mat-error *ngIf="formGroup.get('extraProperties').get('visible').hasError('backendError')">
{{formGroup.get('extraProperties').get('visible').getError('backendError').message}}</mat-error>
<mat-error *ngIf="formGroup.get('extraProperties').get('visible').hasError('required')">
{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field>
</div>
</div>
</div>
<!-- Publication Field -->
<div class="row" *ngIf="formGroup.get('extraProperties').get('visible').value">
<div class="col-12">
<div class="heading">3.3 {{'DMP-EDITOR.FIELDS.PUBLICATION' | translate}}*</div>
<!-- <div class="hint">{{'DMP-EDITOR.LICENSE-INFO.HINT' | translate}}</div> -->
<div class="publication-form">
<mat-form-field>
<input matInput [matDatepicker]="picker" [formControl]="formGroup.get('extraProperties').get('publicDate')" placeholder="{{'DMP-EDITOR.FIELDS.PUBLICATION' | translate}}" [required]="formGroup.get('extraProperties').get('visible').value">
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<mat-datepicker #picker></mat-datepicker>
<mat-error *ngIf="formGroup.get('extraProperties').get('publicDate').hasError('backendError')">
{{formGroup.get('extraProperties').get('publicDate').getError('backendError').message}}</mat-error>
<mat-error *ngIf="formGroup.get('extraProperties').get('publicDate').hasError('required')">
{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field>
</div>
</div>
</div>
<!-- <div class="row"> <!-- <div class="row">
<div class="col-12"> <div class="col-12">
<div class="heading">4.6 {{'DMP-EDITOR.FIELDS.COST' | translate}}</div> <div class="heading">4.6 {{'DMP-EDITOR.FIELDS.COST' | translate}}</div>

View File

@ -15,7 +15,10 @@ import { LicenseCriteria } from '@app/core/query/license/license-criteria';
import { AddCostComponent } from '../cost-editor/add-cost/add-cost.component'; import { AddCostComponent } from '../cost-editor/add-cost/add-cost.component';
import { CostEditorModel } from '../cost-editor/add-cost/add-cost.model'; import { CostEditorModel } from '../cost-editor/add-cost/add-cost.model';
interface Visible {
value: boolean;
name: string;
}
@Component({ @Component({
selector: 'license-info', selector: 'license-info',
@ -33,6 +36,11 @@ export class LicenseInfoComponent extends BaseComponent implements OnInit {
public formControl = new FormControl(); public formControl = new FormControl();
visibles: Visible[] = [
{ value: true, name: 'DMP-EDITOR.VISIBILITY.PUBLIC' },
{ value: false, name: 'DMP-EDITOR.VISIBILITY.RESTRICTED' }
]
licenseAutoCompleteConfiguration: SingleAutoCompleteConfiguration = { licenseAutoCompleteConfiguration: SingleAutoCompleteConfiguration = {
filterFn: this.licenseSearch.bind(this), filterFn: this.licenseSearch.bind(this),
initialItems: (excludedItems: any[]) => this.licenseSearch('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))), initialItems: (excludedItems: any[]) => this.licenseSearch('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))),

View File

@ -31,50 +31,10 @@
</div> </div>
</div> </div>
</div> </div>
<!-- Language field -->
<div class="row">
<div class="col-12">
<div class="heading">1.3 {{'DMP-EDITOR.FIELDS.LANGUAGE' | translate}}*</div>
<div class="hint">{{'DMP-EDITOR.FIELDS.LANGUAGE-HINT' | translate}}</div>
<div class="language-form">
<mat-form-field>
<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">
{{ lang.name }}
</mat-option>
</mat-select>
<mat-error *ngIf="formGroup.get('extraProperties').get('language').hasError('backendError')">
{{formGroup.get('extraProperties').get('language').getError('backendError').message}}</mat-error>
<mat-error *ngIf="formGroup.get('extraProperties').get('language').hasError('required')">
{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field>
</div>
</div>
</div>
<!-- Visibility field-->
<div class="row">
<div class="col-12">
<div class="heading">1.4 {{'DMP-EDITOR.FIELDS.VISIBILITY' | translate}}</div>
<div class="hint">{{'DMP-EDITOR.FIELDS.VISIBILITY-HINT' | translate}}</div>
<div class="visibility-form">
<mat-form-field>
<mat-select [formControl]="formGroup.get('extraProperties').get('visible')" placeholder="{{'DMP-EDITOR.FIELDS.VISIBILITY' | translate}}">
<mat-option *ngFor="let vis of visibles" [value]="vis.value">
{{vis.name | translate}}
</mat-option>
</mat-select>
<mat-error *ngIf="formGroup.get('extraProperties').get('visible').hasError('backendError')">
{{formGroup.get('extraProperties').get('visible').getError('backendError').message}}</mat-error>
<mat-error *ngIf="formGroup.get('extraProperties').get('visible').hasError('required')">
{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field>
</div>
</div>
</div>
<!-- Researchers field--> <!-- Researchers field-->
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<div class="heading">1.5 {{'DMP-EDITOR.FIELDS.RESEARCHERS' | translate}}</div> <div class="heading">1.3 {{'DMP-EDITOR.FIELDS.RESEARCHERS' | translate}}</div>
<div class="hint"> <div class="hint">
<div class="pb-1">{{'DMP-EDITOR.FIELDS.RESEARCHERS-HINT' | translate}}</div> <div class="pb-1">{{'DMP-EDITOR.FIELDS.RESEARCHERS-HINT' | translate}}</div>
<div><span class="material-icons-outlined align-bottom">info</span> {{'DMP-EDITOR.MAIN-INFO.TYPING' | translate}}</div> <div><span class="material-icons-outlined align-bottom">info</span> {{'DMP-EDITOR.MAIN-INFO.TYPING' | translate}}</div>
@ -102,7 +62,7 @@
<!-- Organizations Field --> <!-- Organizations Field -->
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<div class="heading">1.6 {{'DMP-EDITOR.FIELDS.ORGANISATIONS' | translate}}</div> <div class="heading">1.4 {{'DMP-EDITOR.FIELDS.ORGANISATIONS' | translate}}</div>
<div class="hint"> <div class="hint">
<div class="pb-1">{{'DMP-EDITOR.FIELDS.ORGANISATIONS-HINT' | translate}}</div> <div class="pb-1">{{'DMP-EDITOR.FIELDS.ORGANISATIONS-HINT' | translate}}</div>
<div><span class="material-icons-outlined align-bottom">info</span> {{'DMP-EDITOR.MAIN-INFO.TYPING' | translate}}</div> <div><span class="material-icons-outlined align-bottom">info</span> {{'DMP-EDITOR.MAIN-INFO.TYPING' | translate}}</div>
@ -126,10 +86,30 @@
</div> </div>
</div> </div>
</div> </div>
<!-- Language field -->
<div class="row">
<div class="col-12">
<div class="heading">1.5 {{'DMP-EDITOR.FIELDS.LANGUAGE' | translate}}*</div>
<div class="hint">{{'DMP-EDITOR.FIELDS.LANGUAGE-HINT' | translate}}</div>
<div class="language-form">
<mat-form-field>
<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">
{{ lang.name }}
</mat-option>
</mat-select>
<mat-error *ngIf="formGroup.get('extraProperties').get('language').hasError('backendError')">
{{formGroup.get('extraProperties').get('language').getError('backendError').message}}</mat-error>
<mat-error *ngIf="formGroup.get('extraProperties').get('language').hasError('required')">
{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field>
</div>
</div>
</div>
<!-- Contact Field --> <!-- Contact Field -->
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<div class="heading">1.7 {{'DMP-EDITOR.FIELDS.CONTACT' | translate}}*</div> <div class="heading">1.6 {{'DMP-EDITOR.FIELDS.CONTACT' | translate}}*</div>
<!-- <div class="hint">{{'DMP-EDITOR.LICENSE-INFO.HINT' | translate}}</div> --> <!-- <div class="hint">{{'DMP-EDITOR.LICENSE-INFO.HINT' | translate}}</div> -->
<div class="contact-form"> <div class="contact-form">
<mat-form-field> <mat-form-field>
@ -146,23 +126,5 @@
</div> </div>
</div> </div>
</div> </div>
<!-- Publication Field -->
<div class="row" *ngIf="formGroup.get('extraProperties').get('visible').value">
<div class="col-12">
<div class="heading">1.8 {{'DMP-EDITOR.FIELDS.PUBLICATION' | translate}}*</div>
<!-- <div class="hint">{{'DMP-EDITOR.LICENSE-INFO.HINT' | translate}}</div> -->
<div class="publication-form">
<mat-form-field>
<input matInput [matDatepicker]="picker" [formControl]="formGroup.get('extraProperties').get('publicDate')" placeholder="{{'DMP-EDITOR.FIELDS.PUBLICATION' | translate}}" [required]="formGroup.get('extraProperties').get('visible').value">
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<mat-datepicker #picker></mat-datepicker>
<mat-error *ngIf="formGroup.get('extraProperties').get('publicDate').hasError('backendError')">
{{formGroup.get('extraProperties').get('publicDate').getError('backendError').message}}</mat-error>
<mat-error *ngIf="formGroup.get('extraProperties').get('publicDate').hasError('required')">
{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field>
</div>
</div>
</div>
</div> </div>
</div> </div>

View File

@ -25,11 +25,6 @@ import { AuthService } from '@app/core/services/auth/auth.service';
import { Principal } from '@app/core/model/auth/principal'; import { Principal } from '@app/core/model/auth/principal';
import { OrganisationService } from '@app/core/services/organisation/organisation.service'; import { OrganisationService } from '@app/core/services/organisation/organisation.service';
interface Visible {
value: boolean;
name: string;
}
@Component({ @Component({
selector: 'main-info', selector: 'main-info',
templateUrl: './main-info.component.html', templateUrl: './main-info.component.html',
@ -45,10 +40,6 @@ export class MainInfoComponent extends BaseComponent implements OnInit {
@Output() onFormChanged: EventEmitter<any> = new EventEmitter(); @Output() onFormChanged: EventEmitter<any> = new EventEmitter();
public formControl = new FormControl(); public formControl = new FormControl();
visibles: Visible[] = [
{ value: true, name: 'DMP-EDITOR.VISIBILITY.PUBLIC' },
{ value: false, name: 'DMP-EDITOR.VISIBILITY.RESTRICTED' }
]
private associates: UserModel[] = []; private associates: UserModel[] = [];

View File

@ -716,6 +716,7 @@
"ACTIONS": { "ACTIONS": {
"NEXT": "Weiter", "NEXT": "Weiter",
"BACK": "Zurück", "BACK": "Zurück",
"CLOSE": "Schließen",
"BACK-TO": "Back to", "BACK-TO": "Back to",
"DELETE": "Löschen", "DELETE": "Löschen",
"GO-TO-GRANT": "Gehe zu Datansatzbeschreibung Förderung", "GO-TO-GRANT": "Gehe zu Datansatzbeschreibung Förderung",
@ -1658,7 +1659,7 @@
}, },
"USER-PROFILE": { "USER-PROFILE": {
"MERGING-EMAILS-DIALOG": { "MERGING-EMAILS-DIALOG": {
"TITLE": "Link new account", "TITLE": "Verify linked account",
"MESSAGE": "An email to verify this action has been sent to you. Once accepted, you will be able to see your accounts merged. The last email account that you merge will be the one containing all of your DMP records and activity in Argos." "MESSAGE": "An email to verify this action has been sent to you. Once accepted, you will be able to see your accounts merged. The last email account that you merge will be the one containing all of your DMP records and activity in Argos."
}, },
"SETTINGS": { "SETTINGS": {

View File

@ -716,6 +716,7 @@
"ACTIONS": { "ACTIONS": {
"NEXT": "Next", "NEXT": "Next",
"BACK": "Back", "BACK": "Back",
"CLOSE": "Close",
"BACK-TO": "Back to", "BACK-TO": "Back to",
"DELETE": "Delete", "DELETE": "Delete",
"GO-TO-GRANT": "Go to Dataset's Grant", "GO-TO-GRANT": "Go to Dataset's Grant",
@ -1032,8 +1033,8 @@
"LANGUAGE": "Language", "LANGUAGE": "Language",
"LANGUAGE-HINT": "Select the language of your DMP", "LANGUAGE-HINT": "Select the language of your DMP",
"LICENSE": "License", "LICENSE": "License",
"VISIBILITY": "Visibility", "VISIBILITY": "Access Rights",
"VISIBILITY-HINT": "Choose how the DMP is displayed in Argos. By choosing Public, the DMP is automatically made available to all users from the “Public DMPs” collection.", "VISIBILITY-HINT": "Choose how the DMP is displayed after is published on Zenodo. By choosing Open Access, the DMP will be open on Zenodo after the Publication Date. By choosing Restricted Access, the DMP will be restricted after the publication is made.",
"PUBLICATION": "Publication Date", "PUBLICATION": "Publication Date",
"CONTACT": "Contact", "CONTACT": "Contact",
"COST": "Costs", "COST": "Costs",
@ -1071,16 +1072,16 @@
"OK": "OK" "OK": "OK"
}, },
"VISIBILITY": { "VISIBILITY": {
"PUBLIC": "Public", "PUBLIC": "Open Access",
"RESTRICTED": "Restricted" "RESTRICTED": "Restricted Access"
}, },
"STEPPER": { "STEPPER": {
"USER-GUIDE": "Guide steps", "USER-GUIDE": "Guide steps",
"MAIN-INFO": "Main info", "MAIN-INFO": "Main info",
"FUNDING-INFO": "Funding info", "FUNDING-INFO": "Funding",
"DATASET-SELECTION": "Dataset selection", "DATASET-SELECTION": "Dataset selection",
"DATASET-INFO": "Dataset info", "DATASET-INFO": "Dataset info",
"LICENSE-INFO": "License info", "LICENSE-INFO": "License",
"DATASET": "Dataset", "DATASET": "Dataset",
"PREVIOUS": "Previous", "PREVIOUS": "Previous",
"NEXT": "Next" "NEXT": "Next"
@ -1658,7 +1659,7 @@
}, },
"USER-PROFILE": { "USER-PROFILE": {
"MERGING-EMAILS-DIALOG": { "MERGING-EMAILS-DIALOG": {
"TITLE": "Link new account", "TITLE": "Verify linked account",
"MESSAGE": "An email to verify this action has been sent to you. Once accepted, you will be able to see your accounts merged. The last email account that you merge will be the one containing all of your DMP records and activity in Argos." "MESSAGE": "An email to verify this action has been sent to you. Once accepted, you will be able to see your accounts merged. The last email account that you merge will be the one containing all of your DMP records and activity in Argos."
}, },
"SETTINGS": { "SETTINGS": {

View File

@ -716,6 +716,7 @@
"ACTIONS": { "ACTIONS": {
"NEXT": "Siguiente", "NEXT": "Siguiente",
"BACK": "Volver", "BACK": "Volver",
"CLOSE": "Cerrar",
"BACK-TO": "Back to", "BACK-TO": "Back to",
"DELETE": "Borrar", "DELETE": "Borrar",
"GO-TO-GRANT": "Ir a la subvención de la descripción del dataset", "GO-TO-GRANT": "Ir a la subvención de la descripción del dataset",
@ -1658,7 +1659,7 @@
}, },
"USER-PROFILE": { "USER-PROFILE": {
"MERGING-EMAILS-DIALOG": { "MERGING-EMAILS-DIALOG": {
"TITLE": "Link new account", "TITLE": "Verify linked account",
"MESSAGE": "An email to verify this action has been sent to you. Once accepted, you will be able to see your accounts merged. The last email account that you merge will be the one containing all of your DMP records and activity in Argos." "MESSAGE": "An email to verify this action has been sent to you. Once accepted, you will be able to see your accounts merged. The last email account that you merge will be the one containing all of your DMP records and activity in Argos."
}, },
"SETTINGS": { "SETTINGS": {

View File

@ -716,6 +716,7 @@
"ACTIONS": { "ACTIONS": {
"NEXT": "Επόμενο", "NEXT": "Επόμενο",
"BACK": "Πίσω", "BACK": "Πίσω",
"CLOSE": "Κλείσιμο",
"BACK-TO": "Back to", "BACK-TO": "Back to",
"DELETE": "Διαγραφή", "DELETE": "Διαγραφή",
"GO-TO-GRANT": "Μετάβαση σε Περιγραφή Συνόλου Δεδομένων της Επιχορήγησης", "GO-TO-GRANT": "Μετάβαση σε Περιγραφή Συνόλου Δεδομένων της Επιχορήγησης",
@ -1658,7 +1659,7 @@
}, },
"USER-PROFILE": { "USER-PROFILE": {
"MERGING-EMAILS-DIALOG": { "MERGING-EMAILS-DIALOG": {
"TITLE": "Link new account", "TITLE": "Verify linked account",
"MESSAGE": "An email to verify this action has been sent to you. Once accepted, you will be able to see your accounts merged. The last email account that you merge will be the one containing all of your DMP records and activity in Argos." "MESSAGE": "An email to verify this action has been sent to you. Once accepted, you will be able to see your accounts merged. The last email account that you merge will be the one containing all of your DMP records and activity in Argos."
}, },
"SETTINGS": { "SETTINGS": {

View File

@ -716,6 +716,7 @@
"ACTIONS": { "ACTIONS": {
"NEXT": "Sljedeće", "NEXT": "Sljedeće",
"BACK": "Prethodno", "BACK": "Prethodno",
"CLOSE": "Ζatvori",
"BACK-TO": "Natrag na", "BACK-TO": "Natrag na",
"DELETE": "Obriši", "DELETE": "Obriši",
"GO-TO-GRANT": "Idi na potporu za skupove podataka", "GO-TO-GRANT": "Idi na potporu za skupove podataka",
@ -1658,7 +1659,7 @@
}, },
"USER-PROFILE": { "USER-PROFILE": {
"MERGING-EMAILS-DIALOG": { "MERGING-EMAILS-DIALOG": {
"TITLE": "Link new account", "TITLE": "Verify linked account",
"MESSAGE": "An email to verify this action has been sent to you. Once accepted, you will be able to see your accounts merged. The last email account that you merge will be the one containing all of your DMP records and activity in Argos." "MESSAGE": "An email to verify this action has been sent to you. Once accepted, you will be able to see your accounts merged. The last email account that you merge will be the one containing all of your DMP records and activity in Argos."
}, },
"SETTINGS": { "SETTINGS": {

View File

@ -716,6 +716,7 @@
"ACTIONS": { "ACTIONS": {
"NEXT": "Seguinte", "NEXT": "Seguinte",
"BACK": "Voltar", "BACK": "Voltar",
"CLOSE": "Fechar",
"BACK-TO": "Voltar para", "BACK-TO": "Voltar para",
"DELETE": "Eliminar", "DELETE": "Eliminar",
"GO-TO-GRANT": "Ir para o Grant do Dataset", "GO-TO-GRANT": "Ir para o Grant do Dataset",
@ -1658,7 +1659,7 @@
}, },
"USER-PROFILE": { "USER-PROFILE": {
"MERGING-EMAILS-DIALOG": { "MERGING-EMAILS-DIALOG": {
"TITLE": "Link new account", "TITLE": "Verify linked account",
"MESSAGE": "An email to verify this action has been sent to you. Once accepted, you will be able to see your accounts merged. The last email account that you merge will be the one containing all of your DMP records and activity in Argos." "MESSAGE": "An email to verify this action has been sent to you. Once accepted, you will be able to see your accounts merged. The last email account that you merge will be the one containing all of your DMP records and activity in Argos."
}, },
"SETTINGS": { "SETTINGS": {

View File

@ -716,6 +716,7 @@
"ACTIONS": { "ACTIONS": {
"NEXT": "Ďalej", "NEXT": "Ďalej",
"BACK": "Späť", "BACK": "Späť",
"CLOSE": "Ζavrieť",
"BACK-TO": "Späť na", "BACK-TO": "Späť na",
"DELETE": "Vymazať", "DELETE": "Vymazať",
"GO-TO-GRANT": "Prejsť na Grant súboru dát", "GO-TO-GRANT": "Prejsť na Grant súboru dát",
@ -1658,7 +1659,7 @@
}, },
"USER-PROFILE": { "USER-PROFILE": {
"MERGING-EMAILS-DIALOG": { "MERGING-EMAILS-DIALOG": {
"TITLE": "Link new account", "TITLE": "Verify linked account",
"MESSAGE": "An email to verify this action has been sent to you. Once accepted, you will be able to see your accounts merged. The last email account that you merge will be the one containing all of your DMP records and activity in Argos." "MESSAGE": "An email to verify this action has been sent to you. Once accepted, you will be able to see your accounts merged. The last email account that you merge will be the one containing all of your DMP records and activity in Argos."
}, },
"SETTINGS": { "SETTINGS": {

View File

@ -716,6 +716,7 @@
"ACTIONS": { "ACTIONS": {
"NEXT": "Sledeći", "NEXT": "Sledeći",
"BACK": "Nazad", "BACK": "Nazad",
"CLOSE": "Zatvorite",
"BACK-TO": "Nazad na", "BACK-TO": "Nazad na",
"DELETE": "Obrišite", "DELETE": "Obrišite",
"GO-TO-GRANT": "Pređite na grant za skupove podataka", "GO-TO-GRANT": "Pređite na grant za skupove podataka",
@ -1658,7 +1659,7 @@
}, },
"USER-PROFILE": { "USER-PROFILE": {
"MERGING-EMAILS-DIALOG": { "MERGING-EMAILS-DIALOG": {
"TITLE": "Link new account", "TITLE": "Verify linked account",
"MESSAGE": "An email to verify this action has been sent to you. Once accepted, you will be able to see your accounts merged. The last email account that you merge will be the one containing all of your DMP records and activity in Argos." "MESSAGE": "An email to verify this action has been sent to you. Once accepted, you will be able to see your accounts merged. The last email account that you merge will be the one containing all of your DMP records and activity in Argos."
}, },
"SETTINGS": { "SETTINGS": {

View File

@ -716,6 +716,7 @@
"ACTIONS": { "ACTIONS": {
"NEXT": "Sonraki", "NEXT": "Sonraki",
"BACK": "Geri", "BACK": "Geri",
"CLOSE": "Kapat",
"BACK-TO": "Geriye", "BACK-TO": "Geriye",
"DELETE": "Sil", "DELETE": "Sil",
"GO-TO-GRANT": "Veri Seti Hibesine Git", "GO-TO-GRANT": "Veri Seti Hibesine Git",
@ -1658,7 +1659,7 @@
}, },
"USER-PROFILE": { "USER-PROFILE": {
"MERGING-EMAILS-DIALOG": { "MERGING-EMAILS-DIALOG": {
"TITLE": "Link new account", "TITLE": "Verify linked account",
"MESSAGE": "An email to verify this action has been sent to you. Once accepted, you will be able to see your accounts merged. The last email account that you merge will be the one containing all of your DMP records and activity in Argos." "MESSAGE": "An email to verify this action has been sent to you. Once accepted, you will be able to see your accounts merged. The last email account that you merge will be the one containing all of your DMP records and activity in Argos."
}, },
"SETTINGS": { "SETTINGS": {