diff --git a/dmp-frontend/src/app/core/formatting.module.ts b/dmp-frontend/src/app/core/formatting.module.ts
index cac6237cb..fc082e27b 100644
--- a/dmp-frontend/src/app/core/formatting.module.ts
+++ b/dmp-frontend/src/app/core/formatting.module.ts
@@ -9,6 +9,7 @@ import { JsonParserPipe } from './pipes/json-parser.pipe';
import { DateTimeCultureFormatPipe } from './pipes/date-time-culture-format.pipe';
import {FieldValuePipe} from "@app/core/pipes/field-value.pipe";
import {ColumnClassPipe} from "@app/core/pipes/column-class.pipe";
+import { DatasetInSectioPipe } from './pipes/dataset-in-section.pipe';
//
//
@@ -25,7 +26,8 @@ import {ColumnClassPipe} from "@app/core/pipes/column-class.pipe";
DateTimeCultureFormatPipe,
JsonParserPipe,
FieldValuePipe,
- ColumnClassPipe
+ ColumnClassPipe,
+ DatasetInSectioPipe
],
exports: [
NgForLimitPipe,
@@ -35,7 +37,8 @@ import {ColumnClassPipe} from "@app/core/pipes/column-class.pipe";
DateTimeCultureFormatPipe,
JsonParserPipe,
FieldValuePipe,
- ColumnClassPipe
+ ColumnClassPipe,
+ DatasetInSectioPipe
],
providers: [
EnumUtils,
@@ -47,7 +50,8 @@ import {ColumnClassPipe} from "@app/core/pipes/column-class.pipe";
DateTimeCultureFormatPipe,
JsonParserPipe,
FieldValuePipe,
- ColumnClassPipe
+ ColumnClassPipe,
+ DatasetInSectioPipe
]
})
export class FormattingModule { }
diff --git a/dmp-frontend/src/app/core/model/dmp/dmp-dataset-profile/dmp-dataset-profile.ts b/dmp-frontend/src/app/core/model/dmp/dmp-dataset-profile/dmp-dataset-profile.ts
index 9c40d752e..043f4d525 100644
--- a/dmp-frontend/src/app/core/model/dmp/dmp-dataset-profile/dmp-dataset-profile.ts
+++ b/dmp-frontend/src/app/core/model/dmp/dmp-dataset-profile/dmp-dataset-profile.ts
@@ -2,6 +2,7 @@ import { DmpDatasetProfileSectionsFormModel } from "./dmp-dataset-profile-sectio
export interface DmpDatasetProfile {
id: string;
+ descriptionTemplateId: string;
label: string;
data: DmpDatasetProfileSectionsFormModel;
}
\ No newline at end of file
diff --git a/dmp-frontend/src/app/core/pipes/dataset-in-section.pipe.ts b/dmp-frontend/src/app/core/pipes/dataset-in-section.pipe.ts
new file mode 100644
index 000000000..7d0e12f6d
--- /dev/null
+++ b/dmp-frontend/src/app/core/pipes/dataset-in-section.pipe.ts
@@ -0,0 +1,18 @@
+import { Pipe, PipeTransform } from "@angular/core";
+import { FormGroup } from "@angular/forms";
+
+@Pipe({
+ name: 'datasetInSection'
+})
+export class DatasetInSectioPipe implements PipeTransform{
+
+ transform(datasets: FormGroup[], args: string): FormGroup[] {
+ let values = [];
+ for(var dataset of datasets){
+ if(dataset.get('dmpSectionIndex').value == args){
+ values.push(dataset);
+ }
+ }
+ return values;
+ }
+}
\ No newline at end of file
diff --git a/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-profile-editor.component.html b/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-profile-editor.component.html
index 65f6940c2..5c9c18514 100644
--- a/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-profile-editor.component.html
+++ b/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-profile-editor.component.html
@@ -172,7 +172,7 @@
Placeholder
-
+
diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.html b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.html
index d6c8feb05..6b84a8950 100644
--- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.html
+++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.html
@@ -141,7 +141,7 @@
diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts
index 70cd17950..c968f3c46 100644
--- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts
+++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts
@@ -62,6 +62,7 @@ import {CheckDeactivateBaseComponent} from '@app/library/deactivate/deactivate.c
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';
@Component({
selector: 'app-dataset-wizard-component',
@@ -96,6 +97,7 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme
itemId: string;
dmpId: string;
dmpSectionIndex: number;
+ availableDescriptionTemplates: DatasetProfileModel[] = [];
newDmpId: string;
publicId: string;
profileUpdateId: string;
@@ -172,7 +174,7 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme
const data: any = this.route.snapshot.data;
this.itemId = params['id'];
this.dmpId = params['dmpId'];
- this.dmpSectionIndex = params['dmpSectionIndex'];
+ this.dmpSectionIndex = parseInt(params['dmpSectionIndex']);
this.newDmpId = queryParams['newDmpId'];
this.publicId = params['publicId'];
this.profileUpdateId = params['updateId'];
@@ -270,6 +272,10 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme
this.datasetWizardModel.dmp = data;
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: ""})
+ }
this.formGroupRawValue = JSON.parse(JSON.stringify(this.formGroup.getRawValue()));
this.editMode = this.datasetWizardModel.status === DatasetStatus.Draft;
this.formGroup.get('dmp').disable();
@@ -278,7 +284,7 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme
minHeight: '200px',
restoreFocus: false,
data: {
- availableProfiles: this.formGroup.get('dmp').value.profiles,
+ availableProfiles: this.availableDescriptionTemplates,
},
panelClass: 'custom-modalbox'
});
diff --git a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor-blueprint.component.html b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor-blueprint.component.html
index 7a6652240..12f1dd67d 100644
--- a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor-blueprint.component.html
+++ b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor-blueprint.component.html
@@ -1,6 +1,6 @@