diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DMPDaoImpl.java b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DMPDaoImpl.java index e33fc5a48..215b373c0 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DMPDaoImpl.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DMPDaoImpl.java @@ -77,7 +77,7 @@ public class DMPDaoImpl extends DatabaseAccess 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())) diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java index 5b5b89a1a..d48bd452c 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java @@ -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 getPaged(DataManagementPlanTableRequest dataManagementPlanTableRequest, Principal principal, String fieldsGroup) throws Exception { UUID principalID = principal.getId(); List dmps = null; + QueryableList items = null; QueryableList 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 license = ((Map) 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. diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/DescriptionTemplate.java b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/DescriptionTemplate.java index 41d5dce25..d36355d40 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/DescriptionTemplate.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/xml/dmpXml/dmpBlueprintModel/DescriptionTemplate.java @@ -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; } diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/entities/xmlmodels/dmpprofiledefinition/DescriptionTemplate.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/entities/xmlmodels/dmpprofiledefinition/DescriptionTemplate.java index 0c8578333..1ad0fde24 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/entities/xmlmodels/dmpprofiledefinition/DescriptionTemplate.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/entities/xmlmodels/dmpprofiledefinition/DescriptionTemplate.java @@ -55,8 +55,8 @@ public class DescriptionTemplate implements XmlSerializable 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; } diff --git a/dmp-frontend/src/app/library/auto-complete/multiple/multiple-auto-complete.component.ts b/dmp-frontend/src/app/library/auto-complete/multiple/multiple-auto-complete.component.ts index f39413c8f..11ad5b015 100644 --- a/dmp-frontend/src/app/library/auto-complete/multiple/multiple-auto-complete.component.ts +++ b/dmp-frontend/src/app/library/auto-complete/multiple/multiple-auto-complete.component.ts @@ -220,6 +220,9 @@ export class MultipleAutoCompleteComponent extends _CustomComponentMixinBase imp ngOnChanges(changes: SimpleChanges) { if (changes['configuration'] && changes['configuration'].isFirstChange) { this.getSelectedItems(this.value); + } + if (changes['value'] && !changes['value'].isFirstChange()) { + this.getSelectedItems(this.value); } } diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/auto-complete-auth-field-data.model.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/auto-complete-auth-field-data.model.ts index 9d3cb9450..f01ea3ba8 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/auto-complete-auth-field-data.model.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/admin/field-data/auto-complete-auth-field-data.model.ts @@ -12,7 +12,7 @@ export class AuthFieldEditorModel extends FieldDataEditorModel = []): 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 Description Templates - + -
+
0.2 Description of DMP *
-
+
0.3 Blueprint of DMP *
Select blueprint @@ -110,7 +110,7 @@
- +
@@ -138,7 +138,7 @@
{{i + 1}}.{{j + 1}} {{field.label}}*
{{field.description}}
-
+
@@ -305,7 +305,7 @@
-
+
Description templates
{{'DMP-EDITOR.FIELDS.SELECT-TEMPLATE' | translate}} diff --git a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor-blueprint.component.scss b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor-blueprint.component.scss index 3d4fd45d8..e8209775a 100644 --- a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor-blueprint.component.scss +++ b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor-blueprint.component.scss @@ -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 { diff --git a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor-blueprint.component.ts b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor-blueprint.component.ts index 34e5c1072..3306c0880 100644 --- a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor-blueprint.component.ts +++ b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor-blueprint.component.ts @@ -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; @@ -148,11 +148,11 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im private dialog: MatDialog, private lockService: LockService, private matomoService: MatomoService - ) { + ) { 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,16 +214,16 @@ 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'); } } }); - - + + 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))), @@ -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>(); + 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( (aControl).nativeElement !== undefined && (aControl).nativeElement !== null){ + if ((aControl).nativeElement !== undefined && (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,27 +910,27 @@ 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()); } const templates: Array = new Array(); 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) { let existedProfile = profiles.find(profile => profile.descriptionTemplateId == template.descriptionTemplateId); if (existedProfile !== undefined) { id = existedProfile.id; - } + } } let profile: DmpDatasetProfile = { id: id, @@ -942,10 +947,10 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im } }); (profiles !== undefined) ? this.formGroup.get('profiles').setValue(profiles) : this.formGroup.get('profiles').setValue(templates); - + } - 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 { 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 = new Map(); // 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') } } diff --git a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts index 7e6599836..c7c59f7bb 100644 --- a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts +++ b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts @@ -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) { @@ -211,7 +211,7 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit { this.dmpModel.status = DmpStatus.Draft; this.formGroup = this.dmpModel.buildForm(); - if (!isNullOrUndefined(this.formGroup.get('profile').value)) { + if (!isNullOrUndefined(this.formGroup.get('profile').value)) { this.dmpProfileService.getSingleBlueprint(this.formGroup.get('profile').value) .pipe(takeUntil(this._destroyed)) .subscribe(result => { @@ -220,7 +220,7 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit { this.checkForProject(result.definition); }); } - + if (!isNewVersion) { this.formGroup.get('label').setValue(this.dmp.label + " New"); } @@ -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' + }); } }); } diff --git a/dmp-frontend/src/assets/i18n/de.json b/dmp-frontend/src/assets/i18n/de.json index ff8052bc8..4dc4c2211 100644 --- a/dmp-frontend/src/assets/i18n/de.json +++ b/dmp-frontend/src/assets/i18n/de.json @@ -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" } diff --git a/dmp-frontend/src/assets/i18n/en.json b/dmp-frontend/src/assets/i18n/en.json index 0ea3d537f..d738f32d5 100644 --- a/dmp-frontend/src/assets/i18n/en.json +++ b/dmp-frontend/src/assets/i18n/en.json @@ -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." } }, diff --git a/dmp-frontend/src/assets/i18n/es.json b/dmp-frontend/src/assets/i18n/es.json index d751c8e37..7059836c3 100644 --- a/dmp-frontend/src/assets/i18n/es.json +++ b/dmp-frontend/src/assets/i18n/es.json @@ -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" } diff --git a/dmp-frontend/src/assets/i18n/gr.json b/dmp-frontend/src/assets/i18n/gr.json index e971ed88e..8dbe1fe4f 100644 --- a/dmp-frontend/src/assets/i18n/gr.json +++ b/dmp-frontend/src/assets/i18n/gr.json @@ -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" } diff --git a/dmp-frontend/src/assets/i18n/pt.json b/dmp-frontend/src/assets/i18n/pt.json index 9763f2c3d..76b6d876b 100644 --- a/dmp-frontend/src/assets/i18n/pt.json +++ b/dmp-frontend/src/assets/i18n/pt.json @@ -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" } diff --git a/dmp-frontend/src/assets/i18n/sk.json b/dmp-frontend/src/assets/i18n/sk.json index 1d35c0301..68adb3866 100644 --- a/dmp-frontend/src/assets/i18n/sk.json +++ b/dmp-frontend/src/assets/i18n/sk.json @@ -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" } diff --git a/dmp-frontend/src/assets/i18n/sr.json b/dmp-frontend/src/assets/i18n/sr.json index cf764240a..e9a955128 100644 --- a/dmp-frontend/src/assets/i18n/sr.json +++ b/dmp-frontend/src/assets/i18n/sr.json @@ -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" } diff --git a/dmp-frontend/src/assets/i18n/tr.json b/dmp-frontend/src/assets/i18n/tr.json index 1fac8ea39..e1179c9f8 100644 --- a/dmp-frontend/src/assets/i18n/tr.json +++ b/dmp-frontend/src/assets/i18n/tr.json @@ -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" }