This commit is contained in:
Diamantis Tziotzios 2023-11-03 13:24:01 +02:00
parent 44dab9c19a
commit 9fed92dbcb
22 changed files with 669 additions and 631 deletions

View File

@ -77,7 +77,7 @@ public class DMPDaoImpl extends DatabaseAccess<DMP> implements DMPDao {
query.where((builder, root) -> root.join("users", JoinType.LEFT).join("user", JoinType.LEFT).get("id").in(criteria.getCollaborators()));
}
if (criteria.getDatasetTemplates() != null && !criteria.getDatasetTemplates().isEmpty()) {
query.where((builder, root) -> root.join("associatedDmps", JoinType.LEFT).get("id").in(criteria.getDatasetTemplates()));
query.where((builder, root) -> root.join("associatedDmps", JoinType.LEFT).get("datasetprofile").get("id").in(criteria.getDatasetTemplates()));
}
if (criteria.getGrantStatus() != null) {
if (criteria.getGrantStatus().equals(GrantStateType.FINISHED.getValue().shortValue()))

View File

@ -1,5 +1,6 @@
package eu.eudat.logic.managers;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import eu.eudat.configurations.dynamicgrant.DynamicGrantConfiguration;
@ -67,6 +68,7 @@ import eu.eudat.models.data.userinfo.UserListingModel;
import eu.eudat.queryable.QueryableList;
import eu.eudat.types.Authorities;
import eu.eudat.types.MetricNames;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
import org.apache.poi.xwpf.usermodel.XWPFRun;
@ -144,6 +146,7 @@ public class DataManagementPlanManager {
public DataTableData<DataManagementPlanListingModel> getPaged(DataManagementPlanTableRequest dataManagementPlanTableRequest, Principal principal, String fieldsGroup) throws Exception {
UUID principalID = principal.getId();
List<Dmp> dmps = null;
QueryableList<DMP> items = null;
QueryableList<DMP> authItems = null;
Long totalData = 0L;
@ -1360,103 +1363,104 @@ public class DataManagementPlanManager {
dmpBlueprintModel.fromDataModel(dmpProfile);
DataManagementPlanBlueprint dmpBlueprint = dmpBlueprintModel.getDefinition();
for(Section section: dmpBlueprint.getSections()){
wordBuilder.addParagraphContent("Section " + section.getOrdinal(), document, ParagraphStyle.HEADER1, BigInteger.ZERO, 0);
XWPFParagraph sectionInfoParagraph = document.createParagraph();
sectionInfoParagraph.setSpacingBetween(1.0);
XWPFRun runSectionTitle = sectionInfoParagraph.createRun();
runSectionTitle.setText("Title: ");
runSectionTitle.setColor("000000");
XWPFRun runSectionTitleText = sectionInfoParagraph.createRun();
runSectionTitleText.setText(section.getLabel());
runSectionTitleText.setColor("116a78");
XWPFParagraph sectionDescriptionParagraph = document.createParagraph();
XWPFRun runSectionDescription = sectionDescriptionParagraph.createRun();
runSectionDescription.setText("Description: ");
runSectionDescription.setColor("000000");
XWPFRun runSectionDescriptionText = sectionDescriptionParagraph.createRun();
runSectionDescriptionText.setText(section.getDescription());
runSectionDescriptionText.setColor("116a78");
wordBuilder.addParagraphContent(section.getOrdinal() + ". " + section.getLabel(), document, ParagraphStyle.HEADER1, BigInteger.ZERO, 0);
// XWPFParagraph sectionInfoParagraph = document.createParagraph();
// sectionInfoParagraph.setSpacingBetween(1.0);
// XWPFRun runSectionTitle = sectionInfoParagraph.createRun();
// runSectionTitle.setText("Title: ");
// runSectionTitle.setColor("000000");
// XWPFRun runSectionTitleText = sectionInfoParagraph.createRun();
// runSectionTitleText.setText(section.getLabel());
// runSectionTitleText.setColor("116a78");
// XWPFParagraph sectionDescriptionParagraph = document.createParagraph();
// XWPFRun runSectionDescription = sectionDescriptionParagraph.createRun();
// runSectionDescription.setText("Description: ");
// runSectionDescription.setColor("000000");
// XWPFRun runSectionDescriptionText = sectionDescriptionParagraph.createRun();
// runSectionDescriptionText.setText(section.getDescription());
// runSectionDescriptionText.setColor("116a78");
wordBuilder.addParagraphContent("Section Fields", document, ParagraphStyle.HEADER2, BigInteger.ZERO, 0);
//wordBuilder.addParagraphContent("Section Fields", document, ParagraphStyle.HEADER2, BigInteger.ZERO, 0);
section.getFields().sort(Comparator.comparingInt(FieldModel::getOrdinal));
for(FieldModel field: section.getFields()){
if(field.getCategory() == FieldCategory.SYSTEM){
SystemField systemField = field.toSystemField();
if (systemField.getType() == SystemFieldType.LANGUAGE) continue;
XWPFParagraph systemFieldParagraph = document.createParagraph();
systemFieldParagraph.setSpacingBetween(1.0);
// systemFieldParagraph.setSpacingBetween(1.0);
XWPFRun runSyStemFieldTitle = systemFieldParagraph.createRun();
runSyStemFieldTitle.setText("Title: ");
runSyStemFieldTitle.setText(systemField.getLabel() +": ");
runSyStemFieldTitle.setColor("000000");
XWPFRun runSystemFieldTitleText = systemFieldParagraph.createRun();
runSystemFieldTitleText.setText(systemField.getLabel());
runSystemFieldTitleText.setColor("116a78");
if(systemField.getDescription() != null && !systemField.getDescription().isEmpty()){
XWPFParagraph systemFieldDescription = document.createParagraph();
systemFieldDescription.setSpacingBetween(1.0);
XWPFRun runSyStemFieldDescription = systemFieldDescription.createRun();
runSyStemFieldDescription.setText("Description: ");
runSyStemFieldDescription.setColor("000000");
XWPFRun runSystemFieldDescriptionText = systemFieldDescription.createRun();
runSystemFieldDescriptionText.setText(systemField.getDescription());
runSystemFieldDescriptionText.setColor("116a78");
}
XWPFParagraph systemFieldInput = document.createParagraph();
systemFieldInput.setSpacingBetween(1.0);
XWPFRun runInput = systemFieldInput.createRun();
runInput.setText("Input: ");
runInput.setColor("000000");
// XWPFRun runSystemFieldTitleText = systemFieldParagraph.createRun();
// runSystemFieldTitleText.setText(systemField.getLabel());
// runSystemFieldTitleText.setColor("116a78");
// if(systemField.getDescription() != null && !systemField.getDescription().isEmpty()){
// XWPFParagraph systemFieldDescription = document.createParagraph();
// systemFieldDescription.setSpacingBetween(1.0);
// XWPFRun runSyStemFieldDescription = systemFieldDescription.createRun();
// runSyStemFieldDescription.setText("Description: ");
// runSyStemFieldDescription.setColor("000000");
// XWPFRun runSystemFieldDescriptionText = systemFieldDescription.createRun();
// runSystemFieldDescriptionText.setText(systemField.getDescription());
// runSystemFieldDescriptionText.setColor("116a78");
// }
// XWPFParagraph systemFieldInput = document.createParagraph();
// systemFieldInput.setSpacingBetween(1.0);
// XWPFRun runInput = systemFieldInput.createRun();
// runInput.setText("Input: ");
// runInput.setColor("000000");
switch (systemField.getType()) {
case TEXT:
XWPFRun runTitle = systemFieldInput.createRun();
XWPFRun runTitle = systemFieldParagraph.createRun();
runTitle.setText(dmpEntity.getLabel());
runTitle.setColor("116a78");
break;
case HTML_TEXT:
XWPFRun runDescription = systemFieldInput.createRun();
runDescription.setText(dmpEntity.getDescription());
runDescription.setColor("116a78");
wordBuilder.addParagraphContent(dmpEntity.getDescription(), document, ParagraphStyle.HTML, BigInteger.ZERO, 0);
break;
case RESEARCHERS:
for(Researcher researcher: dmpEntity.getResearchers()){
XWPFRun runResearcher = systemFieldInput.createRun();
XWPFRun runResearcher = systemFieldParagraph.createRun();
runResearcher.addBreak();
runResearcher.setText("" + researcher.getLabel());
runResearcher.setColor("116a78");
}
break;
case ORGANIZATIONS:
for(Organisation organisation: dmpEntity.getOrganisations()){
XWPFRun runOrganisation = systemFieldInput.createRun();
XWPFRun runOrganisation = systemFieldParagraph.createRun();
runOrganisation.addBreak();
runOrganisation.setText("" + organisation.getLabel());
runOrganisation.setColor("116a78");
}
break;
case LANGUAGE:
XWPFRun runLanguage = systemFieldInput.createRun();
runLanguage.setText(objectMapper.readValue(dmpEntity.getExtraProperties(), HashMap.class).get("language").toString());
runLanguage.setColor("116a78");
break;
// case LANGUAGE:
// XWPFRun runLanguage = systemFieldParagraph.createRun();
// runLanguage.setText(objectMapper.readValue(dmpEntity.getExtraProperties(), HashMap.class).get("language").toString());
// runLanguage.setColor("116a78");
// break;
case CONTACT:
XWPFRun runContact = systemFieldInput.createRun();
runContact.setText(dmpEntity.getCreator().getName());
XWPFRun runContact = systemFieldParagraph.createRun();
runContact.setText(dmpEntity.getCreator() == null ? "" : dmpEntity.getCreator().getName());
runContact.setColor("116a78");
break;
case FUNDER:
if (dmpEntity.getGrant() != null && dmpEntity.getGrant().getFunder() != null) {
XWPFRun runFunder = systemFieldInput.createRun();
XWPFRun runFunder = systemFieldParagraph.createRun();
runFunder.setText(dmpEntity.getGrant().getFunder().getLabel());
runFunder.setColor("116a78");
}
break;
case GRANT:
if (dmpEntity.getGrant() != null) {
XWPFRun runGrant = systemFieldInput.createRun();
XWPFRun runGrant = systemFieldParagraph.createRun();
runGrant.setText(dmpEntity.getGrant().getLabel());
runGrant.setColor("116a78");
}
break;
case PROJECT:
if (dmpEntity.getProject() != null ) {
XWPFRun runProject = systemFieldInput.createRun();
XWPFRun runProject = systemFieldParagraph.createRun();
runProject.setText(dmpEntity.getProject().getLabel());
runProject.setColor("116a78");
}
@ -1464,52 +1468,73 @@ public class DataManagementPlanManager {
case LICENSE:
Map extraProperties = objectMapper.readValue(dmpEntity.getExtraProperties(), HashMap.class);
if (extraProperties.containsKey("license")) {
XWPFRun runLicense = systemFieldInput.createRun();
runLicense.setText(extraProperties.get("license").toString());
runLicense.setColor("116a78");
Map<String, String> license = ((Map<String, String>) extraProperties.get("license"));
if(!StringUtils.isEmpty(license.get("pid"))) {
XWPFRun runLicense = systemFieldParagraph.createRun();
runLicense.setText(license.get("pid").toString());
runLicense.setColor("116a78");
}
}
break;
case ACCESS_RIGHTS:
Map extraPropertiesMap = objectMapper.readValue(dmpEntity.getExtraProperties(), HashMap.class);
if (extraPropertiesMap.containsKey("visible")) {
XWPFRun runAccessRights = systemFieldInput.createRun();
runAccessRights.setText(extraPropertiesMap.get("visible").toString());
XWPFRun runAccessRights = systemFieldParagraph.createRun();
runAccessRights.setText(Boolean.valueOf(extraPropertiesMap.get("visible").toString()) ? "Public" : "Restricted");
runAccessRights.setColor("116a78");
}
break;
}
document.createParagraph();
//document.createParagraph();
}
else if(field.getCategory() == FieldCategory.EXTRA){
Map dmpProperties = objectMapper.readValue(dmpEntity.getProperties(), HashMap.class);
if (dmpProperties != null && (!dmpProperties.containsKey(field.getId().toString()) || StringUtils.isEmpty((String) dmpProperties.get(field.getId().toString())))) continue;
ExtraField extraField = field.toExtraField();
XWPFParagraph extraFieldParagraph = document.createParagraph();
extraFieldParagraph.setSpacingBetween(1.0);
XWPFRun runExtraFieldLabel = extraFieldParagraph.createRun();
runExtraFieldLabel.setText(extraField.getLabel());
runExtraFieldLabel.setColor("116a78");
if(extraField.getDescription() != null && !extraField.getDescription().isEmpty()){
XWPFRun runExtraFieldDescription = extraFieldParagraph.createRun();
runExtraFieldDescription.setText(extraField.getDescription());
runExtraFieldDescription.setColor("116a78");
}
runExtraFieldLabel.setText(extraField.getLabel() + ": ");
runExtraFieldLabel.setColor("000000");
// if(extraField.getDescription() != null && !extraField.getDescription().isEmpty()){
// XWPFRun runExtraFieldDescription = extraFieldParagraph.createRun();
// runExtraFieldDescription.setText(extraField.getDescription());
// runExtraFieldDescription.setColor("116a78");
// }
XWPFRun runExtraFieldInput = extraFieldParagraph.createRun();
Map dmpProperties = objectMapper.readValue(dmpEntity.getProperties(), HashMap.class);
if (dmpProperties.containsKey(field.getId()) && dmpProperties.get(field.getId()) != null) {
runExtraFieldInput.setText((String) dmpProperties.get(field.getId()));
switch (extraField.getType()) {
case TEXT:
runExtraFieldInput.setText((String) dmpProperties.get(field.getId().toString()));
runExtraFieldInput.setColor("116a78");
break;
case RICH_TEXT:
wordBuilder.addParagraphContent(dmpProperties.get(field.getId().toString()), document, ParagraphStyle.HTML, BigInteger.ZERO, 0);
// runExtraFieldInput.setText((String) dmpProperties.get(field.getId().toString()));
// runExtraFieldInput.setColor("116a78");
break;
case DATE:
runExtraFieldInput.setText((String) dmpProperties.get(field.getId().toString()));
runExtraFieldInput.setColor("116a78");
break;
case NUMBER:
runExtraFieldInput.setText((String) dmpProperties.get(field.getId().toString()));
runExtraFieldInput.setColor("116a78");
break;
}
runExtraFieldInput.setColor("116a78");
}
}
if(!section.getDescriptionTemplates().isEmpty()){
//if(!section.getDescriptionTemplates().isEmpty()){
wordBuilder.addParagraphContent("Section descriptions", document, ParagraphStyle.HEADER2, BigInteger.ZERO, 0);
wordBuilder.addParagraphContent("Description Templates", document, ParagraphStyle.HEADER4, BigInteger.ZERO, 0);
for(eu.eudat.models.data.entities.xmlmodels.dmpprofiledefinition.DescriptionTemplate descriptionTemplate: section.getDescriptionTemplates()){
XWPFParagraph templateParagraph = document.createParagraph();
XWPFRun runTemplateLabel = templateParagraph.createRun();
runTemplateLabel.setText("" + descriptionTemplate.getLabel());
runTemplateLabel.setColor("116a78");
}
// wordBuilder.addParagraphContent("Description Templates", document, ParagraphStyle.HEADER4, BigInteger.ZERO, 0);
// for(eu.eudat.models.data.entities.xmlmodels.dmpprofiledefinition.DescriptionTemplate descriptionTemplate: section.getDescriptionTemplates()){
// XWPFParagraph templateParagraph = document.createParagraph();
// XWPFRun runTemplateLabel = templateParagraph.createRun();
// runTemplateLabel.setText("" + descriptionTemplate.getLabel());
// runTemplateLabel.setColor("116a78");
// }
final Boolean isFinalized = dmpEntity.getStatus() == DMP.DMPStatus.FINALISED.getValue();
final Boolean isPublic = dmpEntity.isPublic();
@ -1538,7 +1563,7 @@ public class DataManagementPlanManager {
datasetDescriptionParagraph.setStyle("Heading4");
datasetDescriptionParagraph.setSpacingBetween(1.5);
XWPFRun datasetDescriptionRun = datasetDescriptionParagraph.createRun();
datasetDescriptionRun.setText("Dataset Description");
datasetDescriptionRun.setText("Description");
//datasetDescriptionRun.setColor("2E75B6");
//datasetDescriptionRun.setBold(true);
datasetDescriptionRun.setFontSize(15);
@ -1632,7 +1657,7 @@ public class DataManagementPlanManager {
XWPFParagraph parBreakDataset = document.createParagraph();
parBreakDataset.setPageBreak(true);
});
}
//}
}
// // Removes the top empty headings.

View File

@ -12,8 +12,8 @@ public class DescriptionTemplate {
private String id;
private String descriptionTemplateId;
private String label;
private int minMultiplicity;
private int maxMultiplicity;
private Integer minMultiplicity;
private Integer maxMultiplicity;
@XmlAttribute(name = "id")
public String getId() {
@ -43,20 +43,20 @@ public class DescriptionTemplate {
}
@XmlAttribute(name = "minMultiplicity")
public int getMinMultiplicity() {
public Integer getMinMultiplicity() {
return minMultiplicity;
}
public void setMinMultiplicity(int minMultiplicity) {
public void setMinMultiplicity(Integer minMultiplicity) {
this.minMultiplicity = minMultiplicity;
}
@XmlAttribute(name = "maxMultiplicity")
public int getMaxMultiplicity() {
public Integer getMaxMultiplicity() {
return maxMultiplicity;
}
public void setMaxMultiplicity(int maxMultiplicity) {
public void setMaxMultiplicity(Integer maxMultiplicity) {
this.maxMultiplicity = maxMultiplicity;
}

View File

@ -55,8 +55,8 @@ public class DescriptionTemplate implements XmlSerializable<DescriptionTemplate>
rootElement.setAttribute("id", this.getId().toString());
rootElement.setAttribute("descriptionTemplateId", this.getDescriptionTemplateId().toString());
rootElement.setAttribute("label", this.label);
rootElement.setAttribute("minMultiplicity", String.valueOf(this.minMultiplicity));
rootElement.setAttribute("maxMultiplicity", String.valueOf(this.maxMultiplicity));
if (this.minMultiplicity != null) rootElement.setAttribute("minMultiplicity", String.valueOf(this.minMultiplicity));
if (this.maxMultiplicity != null) rootElement.setAttribute("maxMultiplicity", String.valueOf(this.maxMultiplicity));
return rootElement;
}

View File

@ -221,6 +221,9 @@ export class MultipleAutoCompleteComponent extends _CustomComponentMixinBase imp
if (changes['configuration'] && changes['configuration'].isFirstChange) {
this.getSelectedItems(this.value);
}
if (changes['value'] && !changes['value'].isFirstChange()) {
this.getSelectedItems(this.value);
}
}
getSelectedItems(value: any) {

View File

@ -12,7 +12,7 @@ export class AuthFieldEditorModel extends FieldDataEditorModel<AuthFieldEditorMo
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
const formGroup = this.formBuilder.group({
method: [{ value: this.method, disabled: (disabled && !skipDisable.includes('AuthFieldEditorModel.method')) }],
url: [{ value: this.url, disabled: (disabled && !skipDisable.includes('AuthFieldEditorModel.url')) },[Validators.required]],
url: [{ value: this.url, disabled: (disabled && !skipDisable.includes('AuthFieldEditorModel.url')) }, [Validators.required]],
body: [{ value: this.body, disabled: (disabled && !skipDisable.includes('AuthFieldEditorModel.body')) }],
path: [{ value: this.path, disabled: (disabled && !skipDisable.includes('AuthFieldEditorModel.path')) }, [Validators.required]],
type: [{ value: this.type, disabled: (disabled && !skipDisable.includes('AuthFieldEditorModel.type')) }, [Validators.required]]
@ -22,11 +22,13 @@ export class AuthFieldEditorModel extends FieldDataEditorModel<AuthFieldEditorMo
}
fromModel(item: AuthAutoCompleteData): AuthFieldEditorModel {
this.url = item.url;
this.method = item.method;
this.body = item.body;
this.path = item.path;
this.type = item.type;
if (item) {
this.url = item.url;
this.method = item.method;
this.body = item.body;
this.path = item.path;
this.type = item.type;
}
return this;
}

View File

@ -222,7 +222,7 @@
<div class="col-12">
<mat-form-field>
<mat-label>Description Templates</mat-label>
<app-multiple-auto-complete placeholder="Description Templates" [disabled]="viewOnly" [value]="descriptionTemplatesPerSection[sectionIndex]" [hidePlaceholder]="true" required='false' [configuration]="profilesAutoCompleteConfiguration" (optionRemoved)="onRemoveTemplate($event, sectionIndex)" (optionSelected)="onOptionSelected($event, sectionIndex)">
<app-multiple-auto-complete placeholder="Description Templates" [disabled]="viewOnly" [value]="descriptionTemplatesPerSection[sectionIndex]" [hidePlaceholder]="true" required='false' [configuration]="profilesAutoCompleteConfiguration" (optionRemoved)="onRemoveTemplate($event, sectionIndex)" (optionActionClicked)="onPreviewTemplate($event, sectionIndex)" (optionSelected)="onOptionSelected($event, sectionIndex)">
</app-multiple-auto-complete>
<!-- <button matSuffix class="input-btn" (click)="allAvailableProfiles($event)">
<mat-icon class="icon-btn">view_list</mat-icon>

View File

@ -219,10 +219,12 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie
section.hasTemplates = false;
this.sectionsArray().push(section.buildForm());
this.systemFieldListPerSection.push(new Array());
this.descriptionTemplatesPerSection.push(new Array());
}
removeSection(sectionIndex: number): void {
this.systemFieldListPerSection.splice(sectionIndex, 1);
this.descriptionTemplatesPerSection.splice(sectionIndex, 1);
this.sectionsArray().removeAt(sectionIndex);
this.sectionsArray().controls.forEach((section, index) => {
section.get('ordinal').setValue(index + 1);
@ -274,6 +276,7 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie
}
selectedFieldType(type: SystemFieldType, sectionIndex: number): void {
if (this.systemFieldDisabled(type, sectionIndex)) return;
let index = this.systemFieldListPerSection[sectionIndex].indexOf(type);
if (index == -1) {
this.systemFieldListPerSection[sectionIndex].push(type);
@ -371,6 +374,8 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie
this.sectionsArray().controls.forEach((section, index) => {
section.get('ordinal').setValue(index + 1);
});
moveItemInArray(this.systemFieldListPerSection, event.previousIndex, event.currentIndex);
moveItemInArray(this.descriptionTemplatesPerSection, event.previousIndex, event.currentIndex);
}
moveItemInFormArray(formArray: FormArray, fromIndex: number, toIndex: number): void {
@ -394,36 +399,30 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie
foundIndex !== -1 && this.descriptionTemplatesArray(sectionIndex).removeAt(foundIndex);
}
// onPreviewTemplate(event, sectionIndex: number) {
// const dialogRef = this.dialog.open(DatasetPreviewDialogComponent, {
// width: '590px',
// minHeight: '200px',
// restoreFocus: false,
// data: {
// template: event
// },
// panelClass: 'custom-modalbox'
// });
// dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
// if (result) {
// let profiles = this.sectionsArray().at(sectionIndex).get('descriptionTemplates').value;//this.formGroup.get('profiles').value;
// const profile: DescriptionTemplatesInSectionEditor = new DescriptionTemplatesInSectionEditor();
// profile.id = Guid.create().toString();
// profile.descriptionTemplateId = event.id;
// profile.label = event.label;
// profiles.push(profile.buildForm());
// this.sectionsArray().at(sectionIndex).get('descriptionTemplates').setValue(profiles);//this.formGroup.get('profiles').setValue(profiles);
// this.profilesAutoCompleteConfiguration = {
// filterFn: this.filterProfiles.bind(this),
// initialItems: (excludedItems: any[]) => this.filterProfiles('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))),
// displayFn: (item) => item['label'],
// titleFn: (item) => item['label'],
// subtitleFn: (item) => item['description'],
// popupItemActionIcon: 'visibility'
// };
// }
// });
// }
onPreviewTemplate(event, sectionIndex: number) {
const dialogRef = this.dialog.open(DatasetPreviewDialogComponent, {
width: '590px',
minHeight: '200px',
restoreFocus: false,
data: {
template: event
},
panelClass: 'custom-modalbox'
});
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
if (result) {
const profile: DescriptionTemplatesInSectionEditor = new DescriptionTemplatesInSectionEditor();
profile.id = Guid.create().toString();
profile.descriptionTemplateId = event.id;
profile.label = event.label;
this.descriptionTemplatesArray(sectionIndex).push(profile.buildForm());
const items = this.descriptionTemplatesPerSection[sectionIndex];
items.push({id: event.id, label: event.label, description: ""});
this.descriptionTemplatesPerSection[sectionIndex] = [...items];
}
});
}
onOptionSelected(item, sectionIndex){
const profile: DescriptionTemplatesInSectionEditor = new DescriptionTemplatesInSectionEditor();

View File

@ -74,7 +74,7 @@ export class DatasetCopyDialogueComponent {
map(result => {
this.dmpModel = result
this.dmpModel.profiles.forEach((element) => {
if (element.id == this.data.datasetProfileId) {
if (element.descriptionTemplateId == this.data.datasetProfileId) {
this.data.datasetProfileExist = true;
}
})

View File

@ -1,67 +1,67 @@
import {ChangeDetectorRef, Component, OnInit, ViewChild} from '@angular/core';
import {AbstractControl, FormArray, FormControl, FormGroup} from '@angular/forms';
import {MatDialog} from '@angular/material/dialog';
import {MatSnackBar} from '@angular/material/snack-bar';
import {ActivatedRoute, Router} from '@angular/router';
import {DatasetStatus} from '@app/core/common/enum/dataset-status';
import {DmpStatus} from '@app/core/common/enum/dmp-status';
import {DataTableRequest} from '@app/core/model/data-table/data-table-request';
import {DatasetProfileModel} from '@app/core/model/dataset/dataset-profile';
import {DmpModel} from '@app/core/model/dmp/dmp';
import {DmpListingModel} from '@app/core/model/dmp/dmp-listing';
import {DatasetProfileCriteria} from '@app/core/query/dataset-profile/dataset-profile-criteria';
import {DmpCriteria} from '@app/core/query/dmp/dmp-criteria';
import {RequestItem} from '@app/core/query/request-item';
import {DatasetWizardService} from '@app/core/services/dataset-wizard/dataset-wizard.service';
import {DmpService} from '@app/core/services/dmp/dmp.service';
import { ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core';
import { AbstractControl, FormArray, FormControl, FormGroup } from '@angular/forms';
import { MatDialog } from '@angular/material/dialog';
import { MatSnackBar } from '@angular/material/snack-bar';
import { ActivatedRoute, Router } from '@angular/router';
import { DatasetStatus } from '@app/core/common/enum/dataset-status';
import { DmpStatus } from '@app/core/common/enum/dmp-status';
import { DataTableRequest } from '@app/core/model/data-table/data-table-request';
import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile';
import { DmpModel } from '@app/core/model/dmp/dmp';
import { DmpListingModel } from '@app/core/model/dmp/dmp-listing';
import { DatasetProfileCriteria } from '@app/core/query/dataset-profile/dataset-profile-criteria';
import { DmpCriteria } from '@app/core/query/dmp/dmp-criteria';
import { RequestItem } from '@app/core/query/request-item';
import { DatasetWizardService } from '@app/core/services/dataset-wizard/dataset-wizard.service';
import { DmpService } from '@app/core/services/dmp/dmp.service';
import {
ExternalSourcesConfigurationService
} from '@app/core/services/external-sources/external-sources-configuration.service';
import {ExternalSourcesService} from '@app/core/services/external-sources/external-sources.service';
import { ExternalSourcesService } from '@app/core/services/external-sources/external-sources.service';
import {
SnackBarNotificationLevel,
UiNotificationService
} from '@app/core/services/notification/ui-notification-service';
import {SingleAutoCompleteConfiguration} from '@app/library/auto-complete/single/single-auto-complete-configuration';
import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration';
import {
DatasetCopyDialogueComponent
} from '@app/ui/dataset/dataset-wizard/dataset-copy-dialogue/dataset-copy-dialogue.component';
import {DatasetWizardEditorModel} from '@app/ui/dataset/dataset-wizard/dataset-wizard-editor.model';
import {BreadcrumbItem} from '@app/ui/misc/breadcrumb/definition/breadcrumb-item';
import {IBreadCrumbComponent} from '@app/ui/misc/breadcrumb/definition/IBreadCrumbComponent';
import {DatasetDescriptionFormEditorModel} from '@app/ui/misc/dataset-description-form/dataset-description-form.model';
import { DatasetWizardEditorModel } from '@app/ui/dataset/dataset-wizard/dataset-wizard-editor.model';
import { BreadcrumbItem } from '@app/ui/misc/breadcrumb/definition/breadcrumb-item';
import { IBreadCrumbComponent } from '@app/ui/misc/breadcrumb/definition/IBreadCrumbComponent';
import { DatasetDescriptionFormEditorModel } from '@app/ui/misc/dataset-description-form/dataset-description-form.model';
import {
Link,
LinkToScroll,
TableOfContents
} from '@app/ui/misc/dataset-description-form/tableOfContentsMaterial/table-of-contents';
import {FormService} from '@common/forms/form-service';
import { FormService } from '@common/forms/form-service';
import {
FormValidationErrorsDialogComponent
} from '@common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component';
import {ValidationErrorModel} from '@common/forms/validation/error-model/validation-error-model';
import {ConfirmationDialogComponent} from '@common/modules/confirmation-dialog/confirmation-dialog.component';
import {TranslateService} from '@ngx-translate/core';
import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model';
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
import { TranslateService } from '@ngx-translate/core';
import * as FileSaver from 'file-saver';
import {interval, Observable, of as observableOf} from 'rxjs';
import {catchError, debounceTime, filter, map, takeUntil} from 'rxjs/operators';
import {LockService} from '@app/core/services/lock/lock.service';
import {Location} from '@angular/common';
import {LockModel} from '@app/core/model/lock/lock.model';
import {Guid} from '@common/types/guid';
import {isNullOrUndefined} from '@app/utilities/enhancers/utils';
import {AuthService} from '@app/core/services/auth/auth.service';
import {ConfigurationService} from '@app/core/services/configuration/configuration.service';
import {SaveType} from '@app/core/common/enum/save-type';
import {DatasetWizardModel} from '@app/core/model/dataset/dataset-wizard';
import {MatomoService} from '@app/core/services/matomo/matomo-service';
import {HttpClient} from '@angular/common/http';
import {VisibilityRulesService} from '@app/ui/misc/dataset-description-form/visibility-rules/visibility-rules.service';
import {PopupNotificationDialogComponent} from '@app/library/notification/popup/popup-notification.component';
import {CheckDeactivateBaseComponent} from '@app/library/deactivate/deactivate.component';
import {PrefillDatasetComponent} from "@app/ui/dataset/dataset-wizard/prefill-dataset/prefill-dataset.component";
import {ToCEntry, ToCEntryType} from "@app/ui/misc/dataset-description-form/dataset-description.component";
import {dispatchFakeEvent} from "@angular/cdk/testing/testbed/fake-events";
import { interval, Observable, of as observableOf } from 'rxjs';
import { catchError, debounceTime, filter, map, takeUntil } from 'rxjs/operators';
import { LockService } from '@app/core/services/lock/lock.service';
import { Location } from '@angular/common';
import { LockModel } from '@app/core/model/lock/lock.model';
import { Guid } from '@common/types/guid';
import { isNullOrUndefined } from '@app/utilities/enhancers/utils';
import { AuthService } from '@app/core/services/auth/auth.service';
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
import { SaveType } from '@app/core/common/enum/save-type';
import { DatasetWizardModel } from '@app/core/model/dataset/dataset-wizard';
import { MatomoService } from '@app/core/services/matomo/matomo-service';
import { HttpClient } from '@angular/common/http';
import { VisibilityRulesService } from '@app/ui/misc/dataset-description-form/visibility-rules/visibility-rules.service';
import { PopupNotificationDialogComponent } from '@app/library/notification/popup/popup-notification.component';
import { CheckDeactivateBaseComponent } from '@app/library/deactivate/deactivate.component';
import { PrefillDatasetComponent } from "@app/ui/dataset/dataset-wizard/prefill-dataset/prefill-dataset.component";
import { ToCEntry, ToCEntryType } from "@app/ui/misc/dataset-description-form/dataset-description.component";
import { dispatchFakeEvent } from "@angular/cdk/testing/testbed/fake-events";
import { DmpDatasetProfile } from '@app/core/model/dmp/dmp-dataset-profile/dmp-dataset-profile';
import { DmpProfileService } from '@app/core/services/dmp/dmp-profile.service';
import { DatasetService } from '@app/core/services/dataset/dataset.service';
@ -202,63 +202,63 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme
this.datasetWizardService.getSingle(this.itemId)
.pipe(takeUntil(this._destroyed))
.subscribe(data => {
this.lockService.checkLockStatus(data.id).pipe(takeUntil(this._destroyed)).subscribe(lockStatus => {
this.lockStatus = lockStatus;
this.datasetWizardModel = new DatasetWizardEditorModel().fromModel(data);
this.dmpSectionIndex = this.datasetWizardModel.dmpSectionIndex;
this.needsUpdate();
this.breadCrumbs = observableOf([
{
parentComponentName: null,
label: this.datasetWizardModel.label,
url: '/datasets/edit/' + this.datasetWizardModel.id,
notFoundResolver: [
{
parentComponentName: null,
label: this.language.instant('NAV-BAR.MY-DATASET-DESCRIPTIONS').toUpperCase(),
url: '/datasets'
},
]
}]);
this.formGroup = this.datasetWizardModel.buildForm();
let profiles = this.datasetWizardModel.dmp.profiles.filter(profile => profile.data.dmpSectionIndex.includes(this.datasetWizardModel.dmpSectionIndex));
for(var profile of profiles){
this.availableDescriptionTemplates.push({id: profile.descriptionTemplateId, label: profile.label, description: ""})
}
this.formGroupRawValue = JSON.parse(JSON.stringify(this.formGroup.getRawValue()));
this.editMode = this.datasetWizardModel.status === DatasetStatus.Draft;
if (this.datasetWizardModel.status === DatasetStatus.Finalized || lockStatus) {
this.formGroup.disable();
this.viewOnly = true;
}
if (!lockStatus && !isNullOrUndefined(this.authService.current())) {
this.lock = new LockModel(data.id, this.authService.current());
this.lockService.checkLockStatus(data.id).pipe(takeUntil(this._destroyed)).subscribe(lockStatus => {
this.lockStatus = lockStatus;
this.datasetWizardModel = new DatasetWizardEditorModel().fromModel(data);
this.dmpSectionIndex = this.datasetWizardModel.dmpSectionIndex;
this.needsUpdate();
this.breadCrumbs = observableOf([
{
parentComponentName: null,
label: this.datasetWizardModel.label,
url: '/datasets/edit/' + this.datasetWizardModel.id,
notFoundResolver: [
{
parentComponentName: null,
label: this.language.instant('NAV-BAR.MY-DATASET-DESCRIPTIONS').toUpperCase(),
url: '/datasets'
},
]
}]);
this.formGroup = this.datasetWizardModel.buildForm();
let profiles = this.datasetWizardModel.dmp.profiles.filter(profile => profile.data.dmpSectionIndex.includes(this.datasetWizardModel.dmpSectionIndex));
for (var profile of profiles) {
this.addToAvailableDescriptionTemplates(this.availableDescriptionTemplates, { id: profile.descriptionTemplateId, label: profile.label, description: "" });
}
this.formGroupRawValue = JSON.parse(JSON.stringify(this.formGroup.getRawValue()));
this.editMode = this.datasetWizardModel.status === DatasetStatus.Draft;
if (this.datasetWizardModel.status === DatasetStatus.Finalized || lockStatus) {
this.formGroup.disable();
this.viewOnly = true;
}
if (!lockStatus && !isNullOrUndefined(this.authService.current())) {
this.lock = new LockModel(data.id, this.authService.current());
this.lockService.createOrUpdate(this.lock).pipe(takeUntil(this._destroyed)).subscribe(async result => {
this.lock.id = Guid.parse(result);
interval(this.configurationService.lockInterval).pipe(takeUntil(this._destroyed)).subscribe(() => this.pumpLock());
});
}
// if (this.viewOnly) { this.formGroup.disable(); } // For future use, to make Dataset edit like DMP.
this.loadDatasetProfiles();
this.registerFormListeners();
this.lockService.createOrUpdate(this.lock).pipe(takeUntil(this._destroyed)).subscribe(async result => {
this.lock.id = Guid.parse(result);
interval(this.configurationService.lockInterval).pipe(takeUntil(this._destroyed)).subscribe(() => this.pumpLock());
});
}
// if (this.viewOnly) { this.formGroup.disable(); } // For future use, to make Dataset edit like DMP.
this.loadDatasetProfiles();
this.registerFormListeners();
if (lockStatus) {
this.dialog.open(PopupNotificationDialogComponent, {
data: {
title: this.language.instant('DATASET-WIZARD.LOCKED.TITLE'),
message: this.language.instant('DATASET-WIZARD.LOCKED.MESSAGE')
}, maxWidth: '30em'
});
}
if(this.finalize && !this.lockStatus && !this.viewOnly) {
setTimeout(() => {
this.saveFinalize();
}, 0);
}
// this.availableProfiles = this.datasetWizardModel.dmp.profiles;
});
},
if (lockStatus) {
this.dialog.open(PopupNotificationDialogComponent, {
data: {
title: this.language.instant('DATASET-WIZARD.LOCKED.TITLE'),
message: this.language.instant('DATASET-WIZARD.LOCKED.MESSAGE')
}, maxWidth: '30em'
});
}
if (this.finalize && !this.lockStatus && !this.viewOnly) {
setTimeout(() => {
this.saveFinalize();
}, 0);
}
// this.availableProfiles = this.datasetWizardModel.dmp.profiles;
});
},
error => {
switch (error.status) {
case 403:
@ -284,53 +284,53 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme
this.datasetWizardModel.dmpSectionIndex = this.dmpSectionIndex;
this.formGroup = this.datasetWizardModel.buildForm();
let profiles = this.datasetWizardModel.dmp.profiles.filter(profile => profile.data.dmpSectionIndex.includes(this.dmpSectionIndex));
for(var profile of profiles){
this.availableDescriptionTemplates.push({id: profile.descriptionTemplateId, label: profile.label, description: ""})
for (var profile of profiles) {
this.addToAvailableDescriptionTemplates(this.availableDescriptionTemplates, { id: profile.descriptionTemplateId, label: profile.label, description: "" });
}
this.formGroupRawValue = JSON.parse(JSON.stringify(this.formGroup.getRawValue()));
this.editMode = this.datasetWizardModel.status === DatasetStatus.Draft;
this.formGroup.get('dmp').disable();
this.dmpProfileService.getSingleBlueprint(data.profile.id)
.pipe(takeUntil(this._destroyed))
.subscribe(result => {
const request: DataTableRequest<DatasetProfileCriteria> = new DataTableRequest<DatasetProfileCriteria>(null, null, null);
request.criteria = new DatasetProfileCriteria();
request.criteria.ids = [];
result.definition.sections[this.dmpSectionIndex].descriptionTemplates.forEach(template => request.criteria.ids.push(template.descriptionTemplateId));
this.availableDescriptionTemplates.forEach(template => request.criteria.ids.push(template.id));
this.datasetService.getDatasetProfilesWithPrefilling(request)
.pipe(takeUntil(this._destroyed))
.subscribe(items => {
items.forEach(template => {
if(template.enablePrefilling){
this.availableDescriptionTemplatesForPrefilling.push({id: template.id, label: template.label, description: ''});
}
})
if (this.availableDescriptionTemplatesForPrefilling.length > 0) {
const dialogRef = this.dialog.open(PrefillDatasetComponent, {
width: '590px',
minHeight: '200px',
restoreFocus: false,
data: {
availableProfiles: this.availableDescriptionTemplatesForPrefilling,
datasetFormGroup: this.formGroup
},
panelClass: 'custom-modalbox'
});
dialogRef.afterClosed().subscribe(result => {
if(result) {
this.datasetWizardModel = this.datasetWizardModel.fromModel(result);
this.datasetWizardModel.dmp = data;
this.datasetWizardModel.dmpSectionIndex = this.dmpSectionIndex;
this.formGroup = this.datasetWizardModel.buildForm();
this.formGroupRawValue = JSON.parse(JSON.stringify(this.formGroup.getRawValue()));
this.formGroup.get('dmp').disable();
this.loadDatasetProfiles();
this.registerFormListeners();
.pipe(takeUntil(this._destroyed))
.subscribe(result => {
const request: DataTableRequest<DatasetProfileCriteria> = new DataTableRequest<DatasetProfileCriteria>(null, null, null);
request.criteria = new DatasetProfileCriteria();
request.criteria.ids = [];
result.definition.sections[this.dmpSectionIndex].descriptionTemplates.forEach(template => request.criteria.ids.push(template.descriptionTemplateId));
this.availableDescriptionTemplates.forEach(template => request.criteria.ids.push(template.id));
this.datasetService.getDatasetProfilesWithPrefilling(request)
.pipe(takeUntil(this._destroyed))
.subscribe(items => {
items.forEach(template => {
if (template.enablePrefilling) {
this.addToAvailableDescriptionTemplates(this.availableDescriptionTemplatesForPrefilling, { id: template.id, label: template.label, description: '' });
}
})
}
});
if (this.availableDescriptionTemplatesForPrefilling.length > 0) {
const dialogRef = this.dialog.open(PrefillDatasetComponent, {
width: '590px',
minHeight: '200px',
restoreFocus: false,
data: {
availableProfiles: this.availableDescriptionTemplatesForPrefilling,
datasetFormGroup: this.formGroup
},
panelClass: 'custom-modalbox'
});
dialogRef.afterClosed().subscribe(result => {
if (result) {
this.datasetWizardModel = this.datasetWizardModel.fromModel(result);
this.datasetWizardModel.dmp = data;
this.datasetWizardModel.dmpSectionIndex = this.dmpSectionIndex;
this.formGroup = this.datasetWizardModel.buildForm();
this.formGroupRawValue = JSON.parse(JSON.stringify(this.formGroup.getRawValue()));
this.formGroup.get('dmp').disable();
this.loadDatasetProfiles();
this.registerFormListeners();
}
})
}
});
});
this.loadDatasetProfiles();
this.registerFormListeners();
@ -419,11 +419,11 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme
this.isNew = false;
this.datasetWizardService.getSinglePublic(this.publicId)
.pipe(takeUntil(this._destroyed)).pipe(
catchError((error: any) => {
this.uiNotificationService.snackBarNotification(error.error.message, SnackBarNotificationLevel.Error);
this.router.navigate(['/datasets/publicEdit/' + this.publicId]);
return observableOf(null);
}))
catchError((error: any) => {
this.uiNotificationService.snackBarNotification(error.error.message, SnackBarNotificationLevel.Error);
this.router.navigate(['/datasets/publicEdit/' + this.publicId]);
return observableOf(null);
}))
.subscribe(data => {
if (data) {
this.datasetWizardModel = new DatasetWizardEditorModel().fromModel(data);
@ -506,6 +506,13 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme
}
}
addToAvailableDescriptionTemplates(list: DatasetProfileModel[], item: DatasetProfileModel) {
if (list.some(x => x.id === item.id)) {
list.splice(list.findIndex(x => x.id === item.id), 1)
}
list.push(item);
}
// private _listenersSubscription:Subscription = new Subscription();
registerFormListeners() {
// const dmpSubscription =
@ -593,7 +600,7 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme
searchDmp(query: string): Observable<DmpListingModel[]> {
const fields: Array<string> = new Array<string>();
fields.push('-created');
const dmpDataTableRequest: DataTableRequest<DmpCriteria> = new DataTableRequest(0, null, {fields: fields});
const dmpDataTableRequest: DataTableRequest<DmpCriteria> = new DataTableRequest(0, null, { fields: fields });
dmpDataTableRequest.criteria = new DmpCriteria();
dmpDataTableRequest.criteria.like = query;
dmpDataTableRequest.criteria.status = DmpStatus.Draft;
@ -724,12 +731,12 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme
this.hasChanges = false;
this.datasetIsOnceSaved = true;
this.onCallbackSuccess(data, saveType);
if(onSuccess) {
if (onSuccess) {
onSuccess();
}
},
error => {
if(onError) {
if (onError) {
onError();
}
this.onCallbackError(error)
@ -747,9 +754,9 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme
else if (key === 'email') {
errors.push(this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.THIS-FIELD') + ' "' + name + '" ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.HAS-ERROR') + ', ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.EMAIL'));
} else if (key === 'min') {
errors.push(this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.THIS-FIELD') + ' "' + name + '" ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.HAS-ERROR') + ', ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.MIN-VALUE', {'min': formControl.getError('min').min}));
errors.push(this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.THIS-FIELD') + ' "' + name + '" ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.HAS-ERROR') + ', ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.MIN-VALUE', { 'min': formControl.getError('min').min }));
} else if (key === 'max') {
errors.push(this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.THIS-FIELD') + ' "' + name + '" ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.HAS-ERROR') + ', ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.MAX-VALUE', {'max': formControl.getError('max').max}));
errors.push(this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.THIS-FIELD') + ' "' + name + '" ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.HAS-ERROR') + ', ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.MAX-VALUE', { 'max': formControl.getError('max').max }));
} else {
errors.push(this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.THIS-FIELD') + ' "' + name + '" ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.HAS-ERROR') + ', ' + formControl.errors[key].message);
}
@ -904,27 +911,27 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme
filter(x => x),
takeUntil(this._destroyed)
).subscribe(result => {
if (result) {
// if (!this.isFormValid()) { return; }
this.formGroup.get('status').setValue(DatasetStatus.Draft);
this.submit(SaveType.finalize, () => {
this.viewOnly = false;
this.datasetWizardModel.status = DatasetStatus.Draft;
setTimeout(x => {
this.formGroup = null;
if (result) {
// if (!this.isFormValid()) { return; }
this.formGroup.get('status').setValue(DatasetStatus.Draft);
this.submit(SaveType.finalize, () => {
this.viewOnly = false;
this.datasetWizardModel.status = DatasetStatus.Draft;
setTimeout(x => {
this.formGroup = null;
});
setTimeout(x => {
this.formGroup = this.datasetWizardModel.buildForm();
this.registerFormListeners();
});
}, () => {
this.formGroup.get('status').setValue(DatasetStatus.Finalized);
this.viewOnly = true;
});
setTimeout(x => {
this.formGroup = this.datasetWizardModel.buildForm();
this.registerFormListeners();
});
}, () => {
this.formGroup.get('status').setValue(DatasetStatus.Finalized);
this.viewOnly = true;
});
} else {
this.saving = false;
}
});
} else {
this.saving = false;
}
});
}
@ -1009,7 +1016,7 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme
document.getElementById('stepper-options').scrollTop = this.tocScrollTop;
}, 500);
this.saving = false;
if(this.isNew) {
if (this.isNew) {
this.reloadDateset(this.datasetWizardModel.id);
}
// this.router.navigate(['/reload']).then(() => { this.router.navigate(['/datasets', 'edit', data.id]); });
@ -1040,7 +1047,7 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme
this.datasetWizardService.downloadPDF(id)
.pipe(takeUntil(this._destroyed))
.subscribe(response => {
const blob = new Blob([response.body], {type: 'application/pdf'});
const blob = new Blob([response.body], { type: 'application/pdf' });
const filename = this.getFilenameFromContentDispositionHeader(response.headers.get('Content-Disposition'));
FileSaver.saveAs(blob, filename);
@ -1052,7 +1059,7 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme
this.datasetWizardService.downloadDOCX(id)
.pipe(takeUntil(this._destroyed))
.subscribe(response => {
const blob = new Blob([response.body], {type: 'application/msword'});
const blob = new Blob([response.body], { type: 'application/msword' });
const filename = this.getFilenameFromContentDispositionHeader(response.headers.get('Content-Disposition'));
FileSaver.saveAs(blob, filename);
@ -1065,7 +1072,7 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme
this.datasetWizardService.downloadXML(id)
.pipe(takeUntil(this._destroyed))
.subscribe(response => {
const blob = new Blob([response.body], {type: 'application/xml'});
const blob = new Blob([response.body], { type: 'application/xml' });
const filename = this.getFilenameFromContentDispositionHeader(response.headers.get('Content-Disposition'));
FileSaver.saveAs(blob, filename);
@ -1186,7 +1193,7 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme
.subscribe(result => {
if (result && result.datasetProfileExist) {
const newDmpId = result.formControl.value.id
this.router.navigate(['/datasets/copy/' + result.datasetId], {queryParams: {newDmpId: newDmpId}});
this.router.navigate(['/datasets/copy/' + result.datasetId], { queryParams: { newDmpId: newDmpId } });
}
});
}
@ -1238,9 +1245,9 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme
getEntryVisibleFieldSets(entry: ToCEntry): ToCEntry[] {
let fieldSets = [];
if(entry.type === ToCEntryType.FieldSet && !this.table0fContents.internalTable.hiddenEntries.find(hiddenEntry => hiddenEntry === entry.id)) {
if (entry.type === ToCEntryType.FieldSet && !this.table0fContents.internalTable.hiddenEntries.find(hiddenEntry => hiddenEntry === entry.id)) {
fieldSets.push(entry);
} else if(entry.type !== ToCEntryType.FieldSet) {
} else if (entry.type !== ToCEntryType.FieldSet) {
entry.subEntries.forEach(subEntry => {
fieldSets = fieldSets.concat(this.getEntryVisibleFieldSets(subEntry));
});
@ -1248,13 +1255,13 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme
return fieldSets;
}
get visibleFieldSets(): ToCEntry[]{
get visibleFieldSets(): ToCEntry[] {
let fieldSets = [];
let arrays= this.table0fContents?this.table0fContents.tocentries.
filter(entry => !this.table0fContents.internalTable.hiddenEntries.find(hiddenEntry => hiddenEntry === entry.id)).map(entry => {
return this.getEntryVisibleFieldSets(entry);
let arrays = this.table0fContents ? this.table0fContents.tocentries.
filter(entry => !this.table0fContents.internalTable.hiddenEntries.find(hiddenEntry => hiddenEntry === entry.id)).map(entry => {
return this.getEntryVisibleFieldSets(entry);
})
:[];
: [];
arrays.forEach(array => {
fieldSets = fieldSets.concat(array);
});
@ -1262,11 +1269,11 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme
}
getFirstFieldSet(entry: ToCEntry): ToCEntry {
if(entry.type === ToCEntryType.FieldSet && !this.table0fContents.internalTable.hiddenEntries.find(hiddenEntry => hiddenEntry === entry.id)) {
if (entry.type === ToCEntryType.FieldSet && !this.table0fContents.internalTable.hiddenEntries.find(hiddenEntry => hiddenEntry === entry.id)) {
return entry;
} else {
let subEntries = entry.subEntries.filter(subEntry => !this.table0fContents.internalTable.hiddenEntries.find(hiddenEntry => hiddenEntry === subEntry.id));
if(subEntries.length > 0) {
if (subEntries.length > 0) {
return this.getFirstFieldSet(subEntries[0]);
} else {
return null;
@ -1275,11 +1282,11 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme
}
public changeStep(selected: ToCEntry = null, execute: boolean = true) {
if(execute) {
if(selected) {
if (execute) {
if (selected) {
let fieldSet = this.getFirstFieldSet(selected);
let index = this.visibleFieldSets.findIndex(entry => entry.id === fieldSet.id);
this.step = index + (selected.type === ToCEntryType.FieldSet?1:0.5);
this.step = index + (selected.type === ToCEntryType.FieldSet ? 1 : 0.5);
} else {
this.step = 0;
this.resetScroll();
@ -1303,7 +1310,7 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme
public previousStep() {
if (this.step > 0) {
this.step = Math.ceil(this.step - 1);
if(this.step >= 1) {
if (this.step >= 1) {
let entry = this.visibleFieldSets[this.step - 1];
this.table0fContents.onToCentrySelected(entry, false);
this.scroll(entry);

View File

@ -83,7 +83,7 @@
</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="">
<div class="heading2">0.1 Title of DMP *</div>
<mat-form-field>
<mat-label>Title</mat-label>
@ -94,13 +94,13 @@
{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> -->
</mat-form-field>
</div>
<div class="input-form">
<div class="">
<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="" style="margin-top: 3%;">
<div class="heading2">0.3 Blueprint of DMP *</div>
<mat-form-field>
<mat-label>Select blueprint</mat-label>
@ -110,7 +110,7 @@
</div>
<div class="row">
<div class="col-5">
<button mat-button class="action-btn" [disabled]="selectedDmpBlueprintDefinition == null" (click)="selectBlueprint()">Next</button>
<button mat-button class="action-btn" [disabled]="selectedDmpBlueprintDefinition == null || !(formGroup.get('label').valid && formGroup.get('description').valid)" (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">
@ -138,7 +138,7 @@
<div *ngFor="let field of section.fields; let j=index">
<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 class="input-form">
<div class="">
<div *ngIf="field.category === 'SYSTEM'">
<div *ngIf="field.type == 0">
<mat-form-field>
@ -305,7 +305,7 @@
<div class="col-12 card" *ngIf="section.hasTemplates">
<div class="row">
<div class="col-12">
<div class="input-form">
<div class="">
<div class="heading">Description templates</div>
<mat-form-field>
<mat-label>{{'DMP-EDITOR.FIELDS.SELECT-TEMPLATE' | translate}}</mat-label>

View File

@ -357,13 +357,13 @@ a:hover {
}
.input-form {
text-align: left;
font-weight: 400;
font-size: 16px;
letter-spacing: 0.15px;
color: #7d7d7d;
opacity: 1;
margin-bottom: 1rem;
// text-align: left;
// font-weight: 400;
// font-size: 16px;
// letter-spacing: 0.15px;
// color: #7d7d7d;
// opacity: 1;
// margin-bottom: 1rem;
}
.insert-manually {

View File

@ -64,9 +64,9 @@ interface Visible {
}
@Component({
selector: 'app-dmp-editor-blueprint',
templateUrl: './dmp-editor-blueprint.component.html',
styleUrls: ['./dmp-editor-blueprint.component.scss']
selector: 'app-dmp-editor-blueprint',
templateUrl: './dmp-editor-blueprint.component.html',
styleUrls: ['./dmp-editor-blueprint.component.scss']
})
export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent implements OnInit {
@ -84,7 +84,7 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im
hasChanges = false;
isDiscarded = false;
isCreateNew = false;
isCreateNew = false;
isCreateNewProject = false;
isCreateNewFunder = false;
@ -152,7 +152,7 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im
super();
}
ngOnInit(): void {
ngOnInit(): void {
this.matomoService.trackPageView('DMP Editor');
this.route.params
.pipe(takeUntil(this._destroyed))
@ -184,7 +184,7 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im
this.checkForFunder();
this.checkForProject();
this.buildExtraFields();
this.formGroup.get('profile').setValue(result.id);
this.formGroup.get('profile').setValue(result);
this.maxStep = this.selectedDmpBlueprintDefinition.sections.length;
this.step = 1;
this.addProfiles();
@ -214,10 +214,10 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im
this.formGroup.get('extraProperties').get('language').patchValue('en');
}
try{
try {
const profiles = this.formGroup.get('profiles').value as DmpDatasetProfile[];
profiles.sort((a,b)=>a.label.localeCompare(b.label));
}catch{
profiles.sort((a, b) => a.label.localeCompare(b.label));
} catch {
console.info('Could not sort profiles');
}
}
@ -232,84 +232,87 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im
subtitleFn: (item) => item['description'],
popupItemActionIcon: 'visibility'
};
}
}
private getItem(itemId: String) {
this.dmpService.getSingle(itemId).pipe(map(data => data as DmpModel))
.pipe(takeUntil(this._destroyed))
.subscribe(async data => {
this.lockService.checkLockStatus(data.id).pipe(takeUntil(this._destroyed)).subscribe(lockStatus => {
this.lockStatus = lockStatus;
.pipe(takeUntil(this._destroyed))
.subscribe(async data => {
this.lockService.checkLockStatus(data.id).pipe(takeUntil(this._destroyed)).subscribe(lockStatus => {
this.lockStatus = lockStatus;
this.dmp = new DmpEditorModel();
this.dmp.grant = new GrantTabModel();
this.dmp.project = new ProjectFormModel();
this.dmp.funder = new FunderFormModel();
this.dmp.extraProperties = new ExtraPropertiesFormModel();
this.dmp.fromModel(data);
this.formGroup = this.dmp.buildForm();
this.dmp = new DmpEditorModel();
this.dmp.grant = new GrantTabModel();
this.dmp.project = new ProjectFormModel();
this.dmp.funder = new FunderFormModel();
this.dmp.extraProperties = new ExtraPropertiesFormModel();
this.dmp.fromModel(data);
this.formGroup = this.dmp.buildForm();
this.datasets = this.formGroup.get('datasets') as FormArray;
this.datasets = this.formGroup.get('datasets') as FormArray;
this.formGroupRawValue = JSON.parse(JSON.stringify(this.formGroup.getRawValue()));
if (!isNullOrUndefined(this.formGroup.get('profile').value)) {
this.dmpProfileService.getSingleBlueprint(this.formGroup.get('profile').value)
.pipe(takeUntil(this._destroyed))
.subscribe(result => {
this.selectedDmpBlueprintDefinition = result.definition;
this.checkForGrant();
this.checkForFunder();
this.checkForProject();
this.buildExtraFields();
this.formGroup.get('profile').setValue(result.id);
this.maxStep = this.selectedDmpBlueprintDefinition.sections.length;
this.step = 1;
this.addProfiles(this.dmp.profiles);
});
}
this.maxStep = this.formGroup.get('datasets') ? this.maxStep + this.formGroup.get('datasets').value.length - 1 : this.maxStep;
this.setIsUserOwner();
if (!this.isUserOwner) {
if(this.isUserMember()){
this.router.navigate(['plans', 'overview', itemId]);
return;
this.formGroupRawValue = JSON.parse(JSON.stringify(this.formGroup.getRawValue()));
if (!isNullOrUndefined(this.formGroup.get('profile').value)) {
this.dmpProfileService.getSingleBlueprint(this.formGroup.get('profile').value)
.pipe(takeUntil(this._destroyed))
.subscribe(result => {
this.selectedDmpBlueprintDefinition = result.definition;
this.checkForGrant();
this.checkForFunder();
this.checkForProject();
this.buildExtraFields();
this.formGroup.get('profile').setValue(result);
this.maxStep = this.selectedDmpBlueprintDefinition.sections.length;
this.step = 1;
this.sectionTemplates = new Array<Array<DatasetProfileModel>>();
this.addProfiles(this.dmp.profiles);
});
}
this.isFinalized = true;
this.formGroup.disable();
}
this.maxStep = this.formGroup.get('datasets') ? this.maxStep + this.formGroup.get('datasets').value.length - 1 : this.maxStep;
if (this.dmp.status === DmpStatus.Finalized || lockStatus) {
this.isFinalized = true;
this.formGroup.disable();
}
this.setIsUserOwner();
if (!this.isUserOwner) {
if (this.authService.current() != null) {
if (!lockStatus) {
this.lock = new LockModel(data.id, this.getUserFromDMP());
if (this.isUserMember()) {
this.router.navigate(['plans', 'overview', itemId]);
return;
}
this.isFinalized = true;
this.formGroup.disable();
}
this.lockService.createOrUpdate(this.lock).pipe(takeUntil(this._destroyed)).subscribe(async result => {
this.lock.id = Guid.parse(result);
interval(this.configurationService.lockInterval).pipe(takeUntil(this._destroyed)).subscribe(() => this.pumpLock());
if (this.dmp.status === DmpStatus.Finalized || lockStatus) {
this.isFinalized = true;
this.formGroup.disable();
}
if (this.authService.current() != null) {
if (!lockStatus) {
this.lock = new LockModel(data.id, this.getUserFromDMP());
this.lockService.createOrUpdate(this.lock).pipe(takeUntil(this._destroyed)).subscribe(async result => {
this.lock.id = Guid.parse(result);
interval(this.configurationService.lockInterval).pipe(takeUntil(this._destroyed)).subscribe(() => this.pumpLock());
});
}
}
this.associatedUsers = data.associatedUsers;
this.people = data.users;
this.formGroup.valueChanges.pipe(takeUntil(this._destroyed))
.subscribe(x => {
this.formChanged();
});
if (this.lockStatus) {
this.dialog.open(PopupNotificationDialogComponent, {
data: {
title: this.language.instant('DMP-EDITOR.LOCKED.TITLE'),
message: this.language.instant('DMP-EDITOR.LOCKED.MESSAGE')
}, maxWidth: '30em'
});
}
}
this.associatedUsers = data.associatedUsers;
this.people = data.users;
this.formGroup.valueChanges.pipe(takeUntil(this._destroyed))
.subscribe(x => {
this.formChanged();
});
if(this.lockStatus){
this.dialog.open(PopupNotificationDialogComponent,{data:{
title:this.language.instant('DMP-EDITOR.LOCKED.TITLE'),
message:this.language.instant('DMP-EDITOR.LOCKED.MESSAGE')
}, maxWidth:'30em'});
}
});
});
});
}
extraFieldsArray(): FormArray {
@ -319,15 +322,15 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im
setIsUserOwner() {
if (this.dmp) {
const principal: Principal = this.authService.current();
this.isUserOwner = !!this.dmp.users.find(x => (x.role === Role.Owner) && (x.id === principal.id) );
this.isUserOwner = !!this.dmp.users.find(x => (x.role === Role.Owner) && (x.id === principal.id));
}
}
isUserMember(): boolean{
try{
isUserMember(): boolean {
try {
const principal: Principal = this.authService.current();
return !!this.dmp.users.find(x => (x.role === Role.Member) && (x.id === principal.id) );
}catch{
return !!this.dmp.users.find(x => (x.role === Role.Member) && (x.id === principal.id));
} catch {
return false;
}
}
@ -420,7 +423,7 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im
this.saving = true;
this.formService.touchAllFormFields(this.formGroup);
if(!this._isDMPDescriptionValid()){
if (!this._isDMPDescriptionValid()) {
const errmess = this._buildDMPDescriptionErrorMessages();
this.showValidationErrorsDialog(undefined, errmess);
this.hintErrors = true;
@ -438,13 +441,15 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im
selectDefaultBlueprint() {
this.dmpProfileService.getSingleBlueprint(this.defaultBlueprintId)
.pipe(takeUntil(this._destroyed))
.subscribe(result => {
this.selectedDmpBlueprintDefinition = result.definition;
this.formGroup.get('profile').setValue(result.id);
this.maxStep = this.selectedDmpBlueprintDefinition.sections.length;
this.nextStep();
});
.pipe(takeUntil(this._destroyed))
.subscribe(result => {
this.selectedDmpBlueprintDefinition = result.definition;
this.formGroup.get('profile').setValue(result);
this.maxStep = this.selectedDmpBlueprintDefinition.sections.length;
if (this.formGroup.get('label').valid && this.formGroup.get('description').valid) {
this.nextStep();
}
});
}
selectBlueprint() {
@ -485,7 +490,7 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im
addDataset(dmpSectionIndex: number) {
this.saving = true;
if(!this._isDMPDescriptionValid()){
if (!this._isDMPDescriptionValid()) {
const errmess = this._buildDMPDescriptionErrorMessages();
this.showValidationErrorsDialog(undefined, errmess);
this.hintErrors = true;
@ -581,7 +586,7 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im
// On save keep editor position
this.uiNotificationService.snackBarNotification(this.isNew ? this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-CREATION') : this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE'), SnackBarNotificationLevel.Success);
if (dmp) {
if(this.isNew){
if (this.isNew) {
this.router.navigate(['/plans', 'edit', dmp.id]);
}
this.getItem(dmp.id);
@ -619,10 +624,10 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im
this.saving = false;
}
editDataset(id: string, isNew: boolean, showModal:boolean = false) {
editDataset(id: string, isNew: boolean, showModal: boolean = false) {
if(showModal){
if (showModal) {
const dialogRef = this.dialog.open(DmpToDatasetDialogComponent, {
width: '500px',
autoFocus: false,
@ -637,7 +642,7 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im
}
}
});
}else{
} else {
if (isNew) {
this.router.navigate(['/datasets', 'new', id, this.dmpSectionIndex]);
} else {
@ -688,38 +693,38 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im
}
//checks if the dpm is valid not taking into account the datasets validity
private _isDMPDescriptionValid():boolean{
private _isDMPDescriptionValid(): boolean {
const form: FormGroup = this.formGroup;
if(form.controls){
if (form.controls) {
return Object.keys(form.controls)
.map(controlName=>{//get validity of each control
if(controlName === 'datasets'){//we dont care if datasets are valid
return true;
}
return !form.get(controlName).invalid;//!! in case the control is disabled, we consider it valid
})
.reduce((isFormValid,isControlValid)=>{//aggregate validities
return isControlValid && isFormValid;
}, true);
.map(controlName => {//get validity of each control
if (controlName === 'datasets') {//we dont care if datasets are valid
return true;
}
return !form.get(controlName).invalid;//!! in case the control is disabled, we consider it valid
})
.reduce((isFormValid, isControlValid) => {//aggregate validities
return isControlValid && isFormValid;
}, true);
}
return true;
}
private showValidationErrorsDialog(projectOnly?: boolean, errmess?: string[]) {
if(errmess){
if (errmess) {
const dialogRef = this.dialog.open(FormValidationErrorsDialogComponent, {
disableClose: true,
autoFocus: false,
restoreFocus: false,
data: {
errorMessages:errmess,
errorMessages: errmess,
projectOnly: projectOnly
},
});
}else{
} else {
const dialogRef = this.dialog.open(FormValidationErrorsDialogComponent, {
disableClose: true,
autoFocus: false,
@ -733,10 +738,10 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im
}
private _buildDMPDescriptionErrorMessages(): string[]{//not including datasets
private _buildDMPDescriptionErrorMessages(): string[] {//not including datasets
const errmess: string[] = [];
Object.keys(this.formGroup.controls).forEach(controlName=>{
if(controlName != 'datasets' && this.formGroup.get(controlName).invalid){
Object.keys(this.formGroup.controls).forEach(controlName => {
if (controlName != 'datasets' && this.formGroup.get(controlName).invalid) {
errmess.push(...this._buildErrorMessagesForAbstractControl(this.formGroup.get(controlName), controlName));
}
})
@ -745,16 +750,16 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im
}
// takes as an input an abstract control and gets its error messages[]
private _buildErrorMessagesForAbstractControl(aControl: AbstractControl, controlName: string):string[]{
const errmess:string[] = [];
private _buildErrorMessagesForAbstractControl(aControl: AbstractControl, controlName: string): string[] {
const errmess: string[] = [];
if(aControl.invalid){
if (aControl.invalid) {
if(aControl.errors){
if (aControl.errors) {
//check if has placeholder
if( (<any>aControl).nativeElement !== undefined && (<any>aControl).nativeElement !== null){
if ((<any>aControl).nativeElement !== undefined && (<any>aControl).nativeElement !== null) {
const placeholder = this._getPlaceHolder(aControl);
if(placeholder){
if (placeholder) {
controlName = placeholder;
}
}
@ -765,19 +770,19 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im
/*in case the aControl is FormControl then the it should have provided its error messages above.
No need to check case of FormControl below*/
if(aControl instanceof FormGroup){
if (aControl instanceof FormGroup) {
const fg = aControl as FormGroup;
//check children
Object.keys(fg.controls).forEach(controlName=>{
Object.keys(fg.controls).forEach(controlName => {
errmess.push(...this._buildErrorMessagesForAbstractControl(fg.get(controlName), controlName));
});
}else if(aControl instanceof FormArray){
} else if (aControl instanceof FormArray) {
const fa = aControl as FormArray;
fa.controls.forEach((control,index)=>{
errmess.push(... this._buildErrorMessagesForAbstractControl(control, `${controlName} --> ${index+1}`));
fa.controls.forEach((control, index) => {
errmess.push(... this._buildErrorMessagesForAbstractControl(control, `${controlName} --> ${index + 1}`));
});
}
@ -821,23 +826,23 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im
return this.dmpService.searchDMPProfiles(request);
}
registerFormEventsForDmpBlueprint(): void {
registerFormEventsForDmpBlueprint(): void {
this.formGroup.get('profile').valueChanges
.pipe(
takeUntil(this._destroyed))
.subscribe(Option => {
if (Option instanceof Object) {
this.selectedDmpBlueprintDefinition = Option.definition;
this.checkForGrant();
this.checkForFunder();
this.checkForProject();
this.buildExtraFields();
this.addProfiles();
}
else {
this.selectedDmpBlueprintDefinition = null;
}
})
.pipe(
takeUntil(this._destroyed))
.subscribe(Option => {
if (Option instanceof Object) {
this.selectedDmpBlueprintDefinition = Option.definition;
this.checkForGrant();
this.checkForFunder();
this.checkForProject();
this.buildExtraFields();
this.addProfiles();
}
else {
this.selectedDmpBlueprintDefinition = null;
}
})
}
private buildExtraFields(): void {
@ -848,7 +853,7 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im
extraField.id = field.id;
if (!isNullOrUndefined(this.dmp.extraFields)) {
let found = this.dmp.extraFields.find(f => f.id === field.id);
if(found !== undefined) {
if (found !== undefined) {
extraField.value = found.value;
}
}
@ -905,20 +910,20 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im
}
private addProfiles(profiles?: DmpDatasetProfile[]) {
for(let i = 0; i < this.selectedDmpBlueprintDefinition.sections.length; i++){
for (let i = 0; i < this.selectedDmpBlueprintDefinition.sections.length; i++) {
this.sectionTemplates.push(new Array<DatasetProfileModel>());
}
const templates: Array<DmpDatasetProfile> = new Array<DmpDatasetProfile>();
this.selectedDmpBlueprintDefinition.sections.forEach(section => {
if (profiles !== undefined) {
profiles.filter(profile => profile.data.dmpSectionIndex.includes(section.ordinal - 1)).forEach(profile => this.sectionTemplates[section.ordinal - 1].push({id: profile.descriptionTemplateId, label: profile.label, description: ""}));
profiles.filter(profile => profile.data.dmpSectionIndex.includes(section.ordinal - 1)).forEach(profile => this.sectionTemplates[section.ordinal - 1].push({ id: profile.descriptionTemplateId, label: profile.label, description: "" }));
}
else {
section.descriptionTemplates.forEach(template => {
this.sectionTemplates[section.ordinal - 1].push({id: template.descriptionTemplateId, label: template.label, description: ""})
this.sectionTemplates[section.ordinal - 1].push({ id: template.descriptionTemplateId, label: template.label, description: "" })
let found: DmpDatasetProfile = templates.find(dmpDatasetProfile => dmpDatasetProfile.descriptionTemplateId == template.descriptionTemplateId);
if (found === undefined) {
let data: DmpDatasetProfileSectionsFormModel= new DmpDatasetProfileSectionsFormModel();
let data: DmpDatasetProfileSectionsFormModel = new DmpDatasetProfileSectionsFormModel();
data.dmpSectionIndex.push(section.ordinal - 1);
let id = null;
if (profiles !== undefined) {
@ -945,7 +950,7 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im
}
dmpBlueprintAutoCompleteConfiguration: SingleAutoCompleteConfiguration = {
dmpBlueprintAutoCompleteConfiguration: SingleAutoCompleteConfiguration = {
filterFn: this.dmpBlueprintSearch.bind(this),
initialItems: (extraData) => this.dmpBlueprintSearch(''),
displayFn: (item) => item['label'],
@ -961,7 +966,7 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im
return this.dmpProfileService.getPagedBlueprint(request).pipe(map(x => x.data));
}
getLanguageInfos(): LanguageInfo[] {
getLanguageInfos(): LanguageInfo[] {
return this.languageInfoService.getLanguageInfoValues();
}
@ -977,7 +982,7 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im
return associates;
}
organisationsAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = {
organisationsAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = {
filterFn: this.filterOrganisations.bind(this),
initialItems: (excludedItems: any[]) => this.filterOrganisations('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))),
displayFn: (item) => item['name'],
@ -992,7 +997,7 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im
subtitleFn: (item) => item['tag'] ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item['tag'] : (item['key'] ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item['key'] : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE'))
};
// Researchers
// Researchers
filterResearchers(value: string): Observable<ExternalSourceItemModel[]> {
return this.externalSourcesService.searchDMPResearchers({ criteria: { name: value, like: null } });
}
@ -1060,7 +1065,7 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im
});
}
showToggleButton() {
showToggleButton() {
return (!this.isFinalized && this.isUserOwner) || this.isClone;
}
@ -1104,7 +1109,7 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im
};
}
else{
else {
this.sectionTemplates[sectionIndex] = this.sectionTemplates[sectionIndex].filter(sectionProfile => sectionProfile.id !== event.id);
profiles = profiles.filter(sectionProfile => sectionProfile.descriptionTemplateId !== event.id);
this.formGroup.get('profiles').setValue(profiles);
@ -1114,18 +1119,18 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im
addProfile(event, sectionIndex: number) {
const profiles = this.formGroup.get('profiles').value as DmpDatasetProfile[];
let found = profiles.find((value) => value.id === event.id);
if(found !== undefined) {
if(found.data.dmpSectionIndex.indexOf(sectionIndex) === -1){
if (found !== undefined) {
if (found.data.dmpSectionIndex.indexOf(sectionIndex) === -1) {
found.data.dmpSectionIndex.push(sectionIndex);
}
else{
else {
this.sectionTemplates[sectionIndex].pop();
}
}
else{
else {
let dmpDatasetProfileSection: DmpDatasetProfileSectionsFormModel = new DmpDatasetProfileSectionsFormModel();
dmpDatasetProfileSection.dmpSectionIndex = [sectionIndex];
profiles.push({id: null, descriptionTemplateId: event.id, label: event.label, data: dmpDatasetProfileSection});
profiles.push({ id: null, descriptionTemplateId: event.id, label: event.label, data: dmpDatasetProfileSection });
}
this.formGroup.get('profiles').setValue(profiles);
}
@ -1143,19 +1148,14 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
if (result) {
this.addProfile(event, sectionIndex);
this.profilesAutoCompleteConfiguration = {
filterFn: this.filterProfiles.bind(this),
initialItems: (excludedItems: any[]) => this.filterProfiles('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))),
displayFn: (item) => item['label'],
titleFn: (item) => item['label'],
subtitleFn: (item) => item['description'],
popupItemActionIcon: 'visibility'
};
const items = this.sectionTemplates[sectionIndex];
items.push({id: event.id, label: event.label, description: ""});
this.sectionTemplates[sectionIndex] = [...items];
}
});
}
onOptionSelected(event, sectionIndex: number){
try{
onOptionSelected(event, sectionIndex: number) {
try {
this.addProfile(event, sectionIndex);
// const profileCounts: Map<String, number> = new Map<String, number>();
// profiles.forEach((value) => profileCounts.set(value.id, (profileCounts.get(value.id) !== undefined ? profileCounts.get(value.id): 0 ) + 1));
@ -1168,7 +1168,7 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im
// });
// duplicateProfiles.forEach((value) => profiles.splice(profiles.lastIndexOf(value), 1));
// profiles.sort((a,b)=> a.label.localeCompare(b.label));
}catch{
} catch {
console.info('Could not sort Dataset Templates')
}
}

View File

@ -1,54 +1,54 @@
import {Component, ElementRef, OnInit, ViewChild} from '@angular/core';
import {MatDialog} from '@angular/material/dialog';
import {ActivatedRoute, Params, Router} from '@angular/router';
import {DatasetStatus} from '@app/core/common/enum/dataset-status';
import {DmpStatus} from '@app/core/common/enum/dmp-status';
import {Principal} from '@app/core/model/auth/principal';
import {DatasetOverviewModel} from '@app/core/model/dataset/dataset-overview';
import {DatasetsToBeFinalized} from '@app/core/model/dataset/datasets-toBeFinalized';
import {DmpOverviewModel} from '@app/core/model/dmp/dmp-overview';
import {UserInfoListingModel} from '@app/core/model/user/user-info-listing';
import {AuthService} from '@app/core/services/auth/auth.service';
import {DmpService} from '@app/core/services/dmp/dmp.service';
import { Location } from '@angular/common';
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { MatDialog } from '@angular/material/dialog';
import { ActivatedRoute, Params, Router } from '@angular/router';
import { DatasetStatus } from '@app/core/common/enum/dataset-status';
import { DmpStatus } from '@app/core/common/enum/dmp-status';
import { Role } from "@app/core/common/enum/role";
import { Principal } from '@app/core/model/auth/principal';
import { DatasetOverviewModel } from '@app/core/model/dataset/dataset-overview';
import { DatasetsToBeFinalized } from '@app/core/model/dataset/datasets-toBeFinalized';
import { DepositConfigurationModel } from '@app/core/model/deposit/deposit-configuration';
import { DmpModel } from '@app/core/model/dmp/dmp';
import { DmpBlueprintDefinition, SystemFieldType } from '@app/core/model/dmp/dmp-blueprint/dmp-blueprint';
import { DmpOverviewModel } from '@app/core/model/dmp/dmp-overview';
import { DoiModel } from '@app/core/model/doi/doi';
import { UserInfoListingModel } from '@app/core/model/user/user-info-listing';
import { VersionListingModel } from '@app/core/model/version/version-listing.model';
import { AuthService } from '@app/core/services/auth/auth.service';
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
import { DepositRepositoriesService } from '@app/core/services/deposit-repositories/deposit-repositories.service';
import { DmpProfileService } from '@app/core/services/dmp/dmp-profile.service';
import { DmpService } from '@app/core/services/dmp/dmp.service';
import { LockService } from '@app/core/services/lock/lock.service';
import { MatomoService } from '@app/core/services/matomo/matomo-service';
import {
SnackBarNotificationLevel,
UiNotificationService
} from '@app/core/services/notification/ui-notification-service';
import {ConfirmationDialogComponent} from '@common/modules/confirmation-dialog/confirmation-dialog.component';
import { PopupNotificationDialogComponent } from '@app/library/notification/popup/popup-notification.component';
import {
DmpFinalizeDialogComponent,
DmpFinalizeDialogInput,
DmpFinalizeDialogOutput
} from '@app/ui/dmp/editor/dmp-finalize-dialog/dmp-finalize-dialog.component';
import {BreadcrumbItem} from '@app/ui/misc/breadcrumb/definition/breadcrumb-item';
import {BaseComponent} from '@common/base/base.component';
import {TranslateService} from '@ngx-translate/core';
import { BreadcrumbItem } from '@app/ui/misc/breadcrumb/definition/breadcrumb-item';
import { isNullOrUndefined } from '@app/utilities/enhancers/utils';
import { BaseComponent } from '@common/base/base.component';
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
import { TranslateService } from '@ngx-translate/core';
import * as FileSaver from 'file-saver';
import {Observable, of as observableOf} from 'rxjs';
import {map, takeUntil} from 'rxjs/operators';
import {Role} from "@app/core/common/enum/role";
import {DmpInvitationDialogComponent} from '../invitation/dmp-invitation-dialog.component';
import {ConfigurationService} from '@app/core/services/configuration/configuration.service';
import {Location} from '@angular/common';
import {FormGroup} from '@angular/forms';
import {LockService} from '@app/core/services/lock/lock.service';
import {VersionListingModel} from '@app/core/model/version/version-listing.model';
import {CloneDialogComponent} from '../clone/clone-dialog/clone-dialog.component';
import {DmpModel} from '@app/core/model/dmp/dmp';
import {DmpEditorModel} from '../editor/dmp-editor.model';
import {FunderFormModel} from '../editor/grant-tab/funder-form-model';
import {ProjectFormModel} from '../editor/grant-tab/project-form-model';
import {GrantTabModel} from '../editor/grant-tab/grant-tab-model';
import {ExtraPropertiesFormModel} from '../editor/general-tab/extra-properties-form.model';
import {StartNewDmpDialogComponent} from '../start-new-dmp-dialogue/start-new-dmp-dialog.component';
import {MatomoService} from '@app/core/services/matomo/matomo-service';
import {PopupNotificationDialogComponent} from '@app/library/notification/popup/popup-notification.component';
import {DepositRepositoriesService} from '@app/core/services/deposit-repositories/deposit-repositories.service';
import {DepositConfigurationModel} from '@app/core/model/deposit/deposit-configuration';
import {DoiModel} from '@app/core/model/doi/doi';
import {isNullOrUndefined} from '@app/utilities/enhancers/utils';
import { DmpBlueprintDefinition, FieldCategory, SystemFieldType } from '@app/core/model/dmp/dmp-blueprint/dmp-blueprint';
import { DmpProfileService } from '@app/core/services/dmp/dmp-profile.service';
import { Observable, of as observableOf } from 'rxjs';
import { map, takeUntil } from 'rxjs/operators';
import { CloneDialogComponent } from '../clone/clone-dialog/clone-dialog.component';
import { DmpEditorModel } from '../editor/dmp-editor.model';
import { ExtraPropertiesFormModel } from '../editor/general-tab/extra-properties-form.model';
import { FunderFormModel } from '../editor/grant-tab/funder-form-model';
import { GrantTabModel } from '../editor/grant-tab/grant-tab-model';
import { ProjectFormModel } from '../editor/grant-tab/project-form-model';
import { DmpInvitationDialogComponent } from '../invitation/dmp-invitation-dialog.component';
import { StartNewDmpDialogComponent } from '../start-new-dmp-dialogue/start-new-dmp-dialog.component';
@Component({
selector: 'app-dmp-overview',
@ -113,7 +113,7 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
.pipe(takeUntil(this._destroyed))
.subscribe(data => {
this.dmp = data;
if(!this.hasDoi()) {
if (!this.hasDoi()) {
this.selectedModel = this.dmp.dois[0];
}
this.checkLockStatus(this.dmp.id);
@ -140,7 +140,7 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
.pipe(takeUntil(this._destroyed))
.subscribe(data => {
this.dmp = data;
if(!this.hasDoi()) {
if (!this.hasDoi()) {
this.selectedModel = this.dmp.dois[0];
}
// this.checkLockStatus(this.dmp.id);
@ -160,12 +160,12 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
}
});
this.depositRepositoriesService.getAvailableRepos()
.pipe(takeUntil(this._destroyed))
.subscribe(
repos => {
this.depositRepos = repos;
},
error => this.depositRepos = []);
.pipe(takeUntil(this._destroyed))
.subscribe(
repos => {
this.depositRepos = repos;
},
error => this.depositRepos = []);
}
onFetchingDeletedCallbackError(redirectRoot: string) {
@ -572,7 +572,7 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
return this.depositRepos.filter(repo => !this.dmp.dois.find(doi => doi.repositoryId === repo.repositoryId));
}
moreDeposit(){
moreDeposit() {
return (this.dmp.dois.length < this.depositRepos.length);
}
@ -617,17 +617,17 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
.pipe(takeUntil(this._destroyed))
.subscribe(
complete => {
if(extraProperties.visible){
if (extraProperties.visible) {
//this.publish(this.dmp.id);
this.dmpService.publish(this.dmp.id)
.pipe(takeUntil(this._destroyed))
.subscribe(() => {
//this.hasPublishButton = false;
this.dmp.status = DmpStatus.Finalized;
this.onUpdateCallbackSuccess();
});
.pipe(takeUntil(this._destroyed))
.subscribe(() => {
//this.hasPublishButton = false;
this.dmp.status = DmpStatus.Finalized;
this.onUpdateCallbackSuccess();
});
}
else{
else {
this.dmp.status = DmpStatus.Finalized;
this.onUpdateCallbackSuccess();
}
@ -648,22 +648,22 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
return this.dmpProfileService.getSingleBlueprint(blueprintId)
.pipe(map(result => {
return result.definition.sections.some(section => {
if(!section.hasTemplates)
if (!section.hasTemplates)
return false;
return section.descriptionTemplates.some(template => {
if(!(template.minMultiplicity > 0))
if (!(template.minMultiplicity > 0))
return false;
let count = 0;
dmpModel.datasets.filter(dataset => dataset.dmpSectionIndex === (section.ordinal - 1)).forEach(dataset => {
if(dataset.profile.id === template.descriptionTemplateId){
if (dataset.profile.id === template.descriptionTemplateId) {
count++;
}
})
if(count < template.minMultiplicity){
if (count < template.minMultiplicity) {
this.dialog.open(PopupNotificationDialogComponent, {
data: {
title: this.language.instant('DMP-OVERVIEW.MIN-DESCRIPTIONS-DIALOG.TITLE', {'minMultiplicity': template.minMultiplicity}),
message: this.language.instant('DMP-OVERVIEW.MIN-DESCRIPTIONS-DIALOG.MESSAGE', )
title: this.language.instant('DMP-OVERVIEW.MIN-DESCRIPTIONS-DIALOG.TITLE', { 'minMultiplicity': template.minMultiplicity }),
message: this.language.instant('DMP-OVERVIEW.MIN-DESCRIPTIONS-DIALOG.MESSAGE',)
}, maxWidth: '30em'
});
return true;
@ -735,7 +735,7 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
this.router.navigate(['/datasets', 'new', this.dmp.id]);
}
selectDoi(doiModel: DoiModel){
selectDoi(doiModel: DoiModel) {
this.selectedModel = doiModel;
const foundIdx = this.dmp.dois.findIndex(el => el.id == doiModel.id);
this.dmp.dois.splice(foundIdx, 1);
@ -744,17 +744,17 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
createDoiLink(doiModel: DoiModel): string {
const repository = this.depositRepos.find(r => r.repositoryId == doiModel.repositoryId);
if(typeof repository !== "undefined"){
if(doiModel.repositoryId == "Zenodo"){
if (typeof repository !== "undefined") {
if (doiModel.repositoryId == "Zenodo") {
const doiarr = doiModel.doi.split('.');
const id = doiarr[doiarr.length - 1];
return repository.repositoryRecordUrl + id;
}
else{
else {
return repository.repositoryRecordUrl + doiModel.doi;
}
}
else{
else {
return "";
}
}
@ -857,11 +857,13 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
this.lockService.checkLockStatus(id).pipe(takeUntil(this._destroyed))
.subscribe(lockStatus => {
this.lockStatus = lockStatus
if(lockStatus){
this.dialog.open(PopupNotificationDialogComponent,{data:{
title:this.language.instant('DMP-OVERVIEW.LOCKED-DIALOG.TITLE'),
message:this.language.instant('DMP-OVERVIEW.LOCKED-DIALOG.MESSAGE')
}, maxWidth:'30em'});
if (lockStatus) {
this.dialog.open(PopupNotificationDialogComponent, {
data: {
title: this.language.instant('DMP-OVERVIEW.LOCKED-DIALOG.TITLE'),
message: this.language.instant('DMP-OVERVIEW.LOCKED-DIALOG.MESSAGE')
}, maxWidth: '30em'
});
}
});
}

View File

@ -1390,13 +1390,13 @@
"PLACEHOLDER": "Bestehenden DMP auswählen"
},
"PREFILL-STEP": {
"TITLE": "Initialize your Dataset",
"TITLE": "Initialize your Description",
"PREFILL": "Prefill",
"OR": "OR",
"HINT": "Select the dataset from Zenodo to automatically retrieve answers to some questions in your template or start by answering the questions manually.",
"HINT": "Select an entry from Zenodo to automatically retrieve answers to some questions in your template or start by answering the questions manually.",
"MANUALLY": "Manually",
"PROFILE": "Dataset Template",
"PREFILLED-DATASET": "Prefilled Dataset",
"PROFILE": "Description Template",
"PREFILLED-DATASET": "Prefilled Description",
"SEARCH": "Start typing to search for a dataset or software",
"NEXT": "Next"
}

View File

@ -142,7 +142,7 @@
"DATASETCREATEWIZARD": "Add Dataset (Wizard)",
"GRANTS": "My Grants",
"DMP-BLUEPRINTS": "DMP Blueprints",
"DATASET-PROFILES": "Dataset Templates",
"DATASET-PROFILES": "Description Templates",
"DESCRIPTION-TYPES": "Description Types",
"USERS": "Users",
"PROFILE": "My Profile",
@ -159,8 +159,8 @@
"DMP-BLUEPRINT-NEW": "New DMP Blueprint",
"DMP-BLUEPRINT-CLONE": "New Clone of DMP Blueprint",
"DMP-BLUEPRINT-EDIT": "Edit DMP Blueprint",
"DATASET-PROFILES-NEW": "New Dataset Template",
"DATASET-PROFILES-EDIT": "Edit Dataset Template",
"DATASET-PROFILES-NEW": "New Description Template",
"DATASET-PROFILES-EDIT": "Edit Description Template",
"DESCRIPTION-TYPE-NEW": "New Description Type",
"DESCRIPTION-TYPE-EDIT": "Edit Description Type",
"EXPLORE-PLANS-OVERVIEW": "Published DMP Overview",
@ -168,8 +168,8 @@
"DMP-PUBLIC-EDIT": "View Published DMP",
"DATASET-COPY": "Copy Dataset",
"DATASET-UPDATE": "Update Dataset",
"DATASET-PROFILES-NEW-VERSION": "New Version of Dataset Template",
"DATASET-PROFILES-CLONE": "New Clone of Dataset Template",
"DATASET-PROFILES-NEW-VERSION": "New Version of Description Template",
"DATASET-PROFILES-CLONE": "New Clone of Description Template",
"LANGUAGE-EDITOR": "Language Editor",
"GUIDE-EDITOR": "User Guide Editor",
"LANGUAGE": "Language",
@ -231,7 +231,7 @@
"DESCRIPTION": "Description",
"PUBLIC-DATASETS": "Explore {{ APP_NAME_CAPS }}",
"USERS": "Users",
"DATASETS-ADMIN": "Dataset Templates",
"DATASETS-ADMIN": "Description Templates",
"DMP-BLUEPRINTS": "DMP Blueprints",
"ABOUT": "About",
"MY-DATASET-DESCRIPTIONS": "MY DATASETS",
@ -691,7 +691,7 @@
},
"LEVEL-OF-ACCESS": "Level of Access",
"INVOLVED-DATASETS": "Involved Datasets",
"TEMPLATES-INVOLVED": "Dataset Templates Involved"
"TEMPLATES-INVOLVED": "Description Templates Involved"
},
"VIEW-ALL-VERSIONS": "All versions of",
"EMPTY-LIST": "Nothing here yet."
@ -705,7 +705,7 @@
"TOOLTIP": {
"PUBLISHED": "Public access - Closed DMP",
"INVOLVED-DATASETS": "Involved Datasets",
"TEMPLATES-INVOLVED": "Dataset Templates Involved"
"TEMPLATES-INVOLVED": "Description Templates Involved"
},
"EMPTY-LIST": "Nothing here yet."
},
@ -733,7 +733,7 @@
"FIRST-STEP": {
"TITLE": "Dataset Information",
"DMP": "Data Management Plan",
"PROFILE": "Dataset Template",
"PROFILE": "Description Template",
"SUB-TITLE": "Created At: "
},
"SECOND-STEP": {
@ -773,7 +773,7 @@
"MESSAGES": {
"DATASET-NOT-FOUND": "Dataset does not exist",
"DATASET-NOT-ALLOWED": "You have no access to this Dataset",
"SUCCESS-UPDATE-DATASET-PROFILE": "Dataset Template updated successfully",
"SUCCESS-UPDATE-DATASET-PROFILE": "Description Template updated successfully",
"MISSING-FIELDS": "There are some required fields left unfilled. Please check the DMP and make sure that all required questions are answered and URLs are provided with valid input. (Missing fields are marked in red color)",
"NO-FILES-SELECTED": "There is no selected file to upload",
"LARGE-FILE-OR-UNACCEPTED-TYPE": "The file is too large or its type is not supported.",
@ -782,8 +782,8 @@
},
"UPLOAD": {
"UPLOAD-XML": "Import",
"UPLOAD-XML-FILE-TITLE": "Import Dataset Template",
"UPLOAD-XML-NAME": "Name Of Dataset Template",
"UPLOAD-XML-FILE-TITLE": "Import Description Template",
"UPLOAD-XML-NAME": "Name Of Description Template",
"UPLOAD-XML-IMPORT": "File",
"UPLOAD-XML-FILE-CANCEL": "Cancel"
},
@ -801,7 +801,7 @@
"COPY": "Copy",
"CANCEL": "Cancel",
"NEXT": "Next",
"ERROR-MESSAGE": "Does not contain this Dataset Template"
"ERROR-MESSAGE": "Does not contain this Description Template"
},
"LOCKED":{
"TITLE":"Dataset is locked",
@ -823,7 +823,7 @@
"TOOLTIP": {
"LEVEL-OF-ACCESS": "Level of Access",
"INVOLVED-DATASETS": "Involved Datasets",
"TEMPLATES-INVOLVED": "Dataset Templates Involved"
"TEMPLATES-INVOLVED": "Description Templates Involved"
},
"ERROR": {
"DELETED-DMP": "The requested DMP is deleted",
@ -916,7 +916,7 @@
},
"DMP": "DMP",
"GRANT": "Grant",
"TEMPLATES-INVOLVED": "Dataset Template",
"TEMPLATES-INVOLVED": "Description Template",
"VERSION": "DMP Version",
"PART-OF": "Part of",
"TO-DMP": "To DMP",
@ -930,7 +930,7 @@
"FINALIZED": "Private access - Closed Dataset",
"DMP": "DMP",
"GRANT": "Grant",
"TEMPLATES-INVOLVED": "Dataset Template"
"TEMPLATES-INVOLVED": "Description Template"
},
"EMPTY-LIST": "Nothing here yet."
},
@ -992,7 +992,7 @@
},
"PLACEHOLDER": "Dataset Title",
"DATASET-PROFILE": {
"SELECT": "Select Dataset Template"
"SELECT": "Select Description Template"
},
"SNACK-BAR": {
"SUCCESSFUL-CREATION": "Imported Successfully",
@ -1072,7 +1072,7 @@
"NEW": "New Data Management Plan",
"EDIT": "Edit",
"EDIT-DMP": "Editing DMP",
"ADD-DATASET": "Adding dataset",
"ADD-DATASET": "Adding description",
"EDIT-DESCRIPTION": "Editing Description",
"CLONE-DMP": "Clone",
"NEW-VERSION": "New Version",
@ -1092,7 +1092,7 @@
"AUTHORS": "Authors",
"TEMPLATES": "Templates",
"TEMPLATE": "DMP Template",
"DATASET-TEMPLATES": "Related Dataset Templates",
"DATASET-TEMPLATES": "Related Description Templates",
"SELECT-TEMPLATE": "Select a template to describe your descriptions",
"PROFILE": "DMP Template",
"PROJECT": "Project",
@ -1284,8 +1284,8 @@
"RELATED-DMP": "Related DMPs",
"SELECT-COLLABORATORS": "Select Collaborators",
"RELATED-COLLABORATORS": "Related Collaborators",
"SELECT-DATASET-TEMPLATES": "Select Dataset Templates",
"RELATED-DATASET-TEMPLATES": "Related Dataset Templates",
"SELECT-DATASET-TEMPLATES": "Select Description Templates",
"RELATED-DATASET-TEMPLATES": "Related Description Templates",
"ALL-VERSIONS": "From All Versions"
},
"DMP": {
@ -1294,8 +1294,8 @@
"SELECT-GRANTS": "Select Grants",
"SELECT-COLLABORATORS": "Select Collaborators",
"RELATED-COLLABORATORS": "Related Collaborators",
"SELECT-DATASET-TEMPLATES": "Select Dataset Templates",
"RELATED-DATASET-TEMPLATES": "Related Dataset Templates"
"SELECT-DATASET-TEMPLATES": "Select Description Templates",
"RELATED-DATASET-TEMPLATES": "Related Description Templates"
},
"BLUEPRINT": {
"LIKE": "Search",
@ -1362,7 +1362,7 @@
},
"VERSION-DIALOG": {
"ABOUT": "Versioning is automated.",
"QUESTION": "It seems your Dataset Template is outdated. Do you want to update it to the latest version?"
"QUESTION": "It seems your Description Template is outdated. Do you want to update it to the latest version?"
},
"ERRORS":{
"ERROR-OCCURED": "An error occurred.",
@ -1390,13 +1390,13 @@
"PLACEHOLDER": "Pick an existing DMP"
},
"PREFILL-STEP": {
"TITLE": "Initialize your Dataset",
"TITLE": "Initialize your Description",
"PREFILL": "Prefill",
"OR": "OR",
"HINT": "Select the dataset from Zenodo to automatically retrieve answers to some questions in your template or start by answering the questions manually.",
"HINT": "Select an entry from Zenodo to automatically retrieve answers to some questions in your template or start by answering the questions manually.",
"MANUALLY": "Manually",
"PROFILE": "Dataset Template",
"PREFILLED-DATASET": "Prefilled Dataset",
"PROFILE": "Description Template",
"PREFILLED-DATASET": "Prefilled Description",
"SEARCH": "Start typing to search for a dataset or software",
"NEXT": "Next"
}
@ -1932,15 +1932,15 @@
},
"SECOND-STEP": {
"TITLE": "DMP Profile",
"ABOUT": "A Data Management Plan consists of a set of questions that you should answer with a level of detail appropriate to the grant or with relevance to the purpose that you are creating the DMP. Contents of each DMP vary depending on the selected Dataset Template(s) which contain(s) a set of tailored questions in response to policy requirements of funders, institutions, research communities.",
"ABOUT": "A Data Management Plan consists of a set of questions that you should answer with a level of detail appropriate to the grant or with relevance to the purpose that you are creating the DMP. Contents of each DMP vary depending on the selected Description Template(s) which contain(s) a set of tailored questions in response to policy requirements of funders, institutions, research communities.",
"NEW-TITLE": "",
"DMP-NAME": "DMP For Grant : ",
"FIELDS": {
"NAME": "Title of the DMP",
"DESCRIPTION": "Summary",
"DESCRIPTION-HINT": "Briefly describe the context and purpose of the DMP",
"PROFILE": "Dataset Template",
"PROFILE-HINT": "Select a template to describe your Dataset(s). If you want to select multiple Dataset Templates use \"New DMP (Expert)\". You can also add new Datasets at any time after the DMP creation.",
"PROFILE": "Description Template",
"PROFILE-HINT": "Select a template to describe your Dataset(s). If you want to select multiple Description Templates use \"New DMP (Expert)\". You can also add new Datasets at any time after the DMP creation.",
"HELP": "If you can't find a template or if you want to create a personalized template for your institution, research community or training needs, please contact us."
}
},

View File

@ -1390,13 +1390,13 @@
"PLACEHOLDER": "Seleccione un PGD existente"
},
"PREFILL-STEP": {
"TITLE": "Initialize your Dataset",
"TITLE": "Initialize your Description",
"PREFILL": "Prefill",
"OR": "OR",
"HINT": "Select the dataset from Zenodo to automatically retrieve answers to some questions in your template or start by answering the questions manually.",
"HINT": "Select an entry from Zenodo to automatically retrieve answers to some questions in your template or start by answering the questions manually.",
"MANUALLY": "Manually",
"PROFILE": "Dataset Template",
"PREFILLED-DATASET": "Prefilled Dataset",
"PROFILE": "Description Template",
"PREFILLED-DATASET": "Prefilled Description",
"SEARCH": "Start typing to search for a dataset or software",
"NEXT": "Next"
}

View File

@ -1390,13 +1390,13 @@
"PLACEHOLDER": "Επιλέξτε ένα Σχέδιο Διαχείρισης Δεδομένων από τη συλλογή σας"
},
"PREFILL-STEP": {
"TITLE": "Initialize your Dataset",
"TITLE": "Initialize your Description",
"PREFILL": "Prefill",
"OR": "OR",
"HINT": "Select the dataset from Zenodo to automatically retrieve answers to some questions in your template or start by answering the questions manually.",
"HINT": "Select an entry from Zenodo to automatically retrieve answers to some questions in your template or start by answering the questions manually.",
"MANUALLY": "Manually",
"PROFILE": "Dataset Template",
"PREFILLED-DATASET": "Prefilled Dataset",
"PROFILE": "Description Template",
"PREFILLED-DATASET": "Prefilled Description",
"SEARCH": "Start typing to search for a dataset or software",
"NEXT": "Next"
}

View File

@ -1390,13 +1390,13 @@
"PLACEHOLDER": "Selecione um PGD existente"
},
"PREFILL-STEP": {
"TITLE": "Initialize your Dataset",
"TITLE": "Initialize your Description",
"PREFILL": "Prefill",
"OR": "OR",
"HINT": "Select the dataset from Zenodo to automatically retrieve answers to some questions in your template or start by answering the questions manually.",
"HINT": "Select an entry from Zenodo to automatically retrieve answers to some questions in your template or start by answering the questions manually.",
"MANUALLY": "Manually",
"PROFILE": "Dataset Template",
"PREFILLED-DATASET": "Prefilled Dataset",
"PROFILE": "Description Template",
"PREFILLED-DATASET": "Prefilled Description",
"SEARCH": "Start typing to search for a dataset or software",
"NEXT": "Next"
}

View File

@ -1390,13 +1390,13 @@
"PLACEHOLDER": "Vybrať existujúci DMP."
},
"PREFILL-STEP": {
"TITLE": "Initialize your Dataset",
"TITLE": "Initialize your Description",
"PREFILL": "Prefill",
"OR": "OR",
"HINT": "Select the dataset from Zenodo to automatically retrieve answers to some questions in your template or start by answering the questions manually.",
"HINT": "Select an entry from Zenodo to automatically retrieve answers to some questions in your template or start by answering the questions manually.",
"MANUALLY": "Manually",
"PROFILE": "Dataset Template",
"PREFILLED-DATASET": "Prefilled Dataset",
"PROFILE": "Description Template",
"PREFILLED-DATASET": "Prefilled Description",
"SEARCH": "Start typing to search for a dataset or software",
"NEXT": "Next"
}

View File

@ -1390,13 +1390,13 @@
"PLACEHOLDER": "Odaberite postojeći Plan"
},
"PREFILL-STEP": {
"TITLE": "Initialize your Dataset",
"TITLE": "Initialize your Description",
"PREFILL": "Prefill",
"OR": "OR",
"HINT": "Select the dataset from Zenodo to automatically retrieve answers to some questions in your template or start by answering the questions manually.",
"HINT": "Select an entry from Zenodo to automatically retrieve answers to some questions in your template or start by answering the questions manually.",
"MANUALLY": "Manually",
"PROFILE": "Dataset Template",
"PREFILLED-DATASET": "Prefilled Dataset",
"PROFILE": "Description Template",
"PREFILLED-DATASET": "Prefilled Description",
"SEARCH": "Start typing to search for a dataset or software",
"NEXT": "Next"
}

View File

@ -1390,13 +1390,13 @@
"PLACEHOLDER": "Mevcut olan bir VYP seçin"
},
"PREFILL-STEP": {
"TITLE": "Initialize your Dataset",
"TITLE": "Initialize your Description",
"PREFILL": "Prefill",
"OR": "OR",
"HINT": "Select the dataset from Zenodo to automatically retrieve answers to some questions in your template or start by answering the questions manually.",
"HINT": "Select an entry from Zenodo to automatically retrieve answers to some questions in your template or start by answering the questions manually.",
"MANUALLY": "Manually",
"PROFILE": "Dataset Template",
"PREFILLED-DATASET": "Prefilled Dataset",
"PROFILE": "Description Template",
"PREFILLED-DATASET": "Prefilled Description",
"SEARCH": "Start typing to search for a dataset or software",
"NEXT": "Next"
}