-
+
@@ -8,25 +8,25 @@
{{'DMP-EDITOR.TITLE.EDIT-DMP' | translate}}
- +
{{ formGroup.get('label').value }} ({{'DMP-EDITOR.CHANGES' | translate}})
- + - - +
+
@@ -42,9 +42,18 @@
  • {{section.label}}
  • +
      +
    1. +
      +
      {{'DMP-EDITOR.STEPPER.DATASET' | translate}}: {{ dataset.get('label').value }}
      + close + check +
      +
    2. +
    -
    +
    0.1 Title of DMP *
    @@ -116,7 +125,7 @@
    -
    +
    - +
    - +
    - +
    @@ -294,7 +303,7 @@
    Description templates
    {{'DMP-EDITOR.FIELDS.SELECT-TEMPLATE' | translate}} - + {{formGroup.get('profiles').getError('backendError').message}} 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 8e0b97e36..3d4fd45d8 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 @@ -38,6 +38,10 @@ } } +.datasetsInSection { + counter-reset: item +} + .title { text-align: left; font-weight: 400; @@ -280,6 +284,24 @@ mat-icon.size-16 { margin: 3rem 0rem 3rem 0rem; } +.changes { + font-weight: 400; + color: #ffffff; +} + +.discard-btn { + background: transparent; + border: 1px solid #ffffff; + color: white; + border-radius: 30px; + opacity: 1; + width: 110px; + height: 40px; + display: flex; + justify-content: center; + align-items: center; +} + a { color: #000000; } 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 d81048a0f..b77b73ca1 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 @@ -13,7 +13,6 @@ 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 { AuthService } from '@app/core/services/auth/auth.service'; -import { BaseComponent } from '@common/base/base.component'; import { ConfigurationService } from '@app/core/services/configuration/configuration.service'; import { isNullOrUndefined } from '@app/utilities/enhancers/utils'; import { LanguageInfoService } from '@app/core/services/culture/language-info-service'; @@ -22,7 +21,7 @@ import { UserModel } from '@app/core/model/user/user'; import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/multiple/multiple-auto-complete-configuration'; import { TranslateService } from '@ngx-translate/core'; import { ExternalSourcesService } from '@app/core/services/external-sources/external-sources.service'; -import { Observable } from 'rxjs'; +import { Observable, interval } from 'rxjs'; import { ExternalSourceItemModel } from '@app/core/model/external-sources/external-source-item'; import { OrganisationService } from '@app/core/services/organisation/organisation.service'; import { MatDialog } from '@angular/material/dialog'; @@ -40,13 +39,22 @@ import { FormValidationErrorsDialogComponent } from '@common/forms/form-validati import { DmpStatus } from '@app/core/common/enum/dmp-status'; import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model'; import { DmpModel } from '@app/core/model/dmp/dmp'; -import { Router } from '@angular/router'; +import { ActivatedRoute, Params, Router } from '@angular/router'; import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component'; import { DmpToDatasetDialogComponent } from '../dmp-to-dataset/dmp-to-dataset-dialog.component'; import { UserInfoListingModel } from '@app/core/model/user/user-info-listing'; import { FormService } from '@common/forms/form-service'; import { DmpDatasetProfile } from '@app/core/model/dmp/dmp-dataset-profile/dmp-dataset-profile'; import { DmpDatasetProfileSectionsFormModel } from '@app/core/model/dmp/dmp-dataset-profile/dmp-dataset-profile-sections-form.model'; +import { MatomoService } from '@app/core/services/matomo/matomo-service'; +import { LockService } from '@app/core/services/lock/lock.service'; +import { Principal } from '@app/core/model/auth/principal'; +import { Role } from '@app/core/common/enum/role'; +import { LockModel } from '@app/core/model/lock/lock.model'; +import { Guid } from '@common/types/guid'; +import { PopupNotificationDialogComponent } from '@app/library/notification/popup/popup-notification.component'; +import { GrantEditorModel } from '@app/ui/grant/editor/grant-editor.model'; +import { CheckDeactivateBaseComponent } from '@app/library/deactivate/deactivate.component'; interface Visible { value: boolean; @@ -58,7 +66,11 @@ interface Visible { templateUrl: './dmp-editor-blueprint.component.html', styleUrls: ['./dmp-editor-blueprint.component.scss'] }) -export class DmpEditorBlueprintComponent extends BaseComponent implements OnInit { +export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent implements OnInit { + + canDeactivate(): boolean { + return !this.isDirty(); + } saving = false; @@ -78,10 +90,12 @@ export class DmpEditorBlueprintComponent extends BaseComponent implements OnInit dmpSectionIndex: number = 0; formGroup: FormGroup = null; formGroupRawValue: any; + datasets = new FormArray([]); associatedUsers: Array; people: Array; + lock: LockModel; lockStatus: Boolean = false; step: number = 0; @@ -114,6 +128,7 @@ export class DmpEditorBlueprintComponent extends BaseComponent implements OnInit constructor( private dmpProfileService: DmpProfileService, private authService: AuthService, + private route: ActivatedRoute, private router: Router, private configurationService: ConfigurationService, private languageInfoService: LanguageInfoService, @@ -123,54 +138,150 @@ export class DmpEditorBlueprintComponent extends BaseComponent implements OnInit private dmpService: DmpService, private uiNotificationService: UiNotificationService, private formService: FormService, - private dialog: MatDialog + private dialog: MatDialog, + private lockService: LockService, + private matomoService: MatomoService ) { super(); } ngOnInit(): void { - 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.extraProperties.visible = false; - this.dmp.extraProperties.contact = this.authService.current().id; - this.formGroup = this.dmp.buildForm(); + this.matomoService.trackPageView('DMP Editor'); + this.route.params + .pipe(takeUntil(this._destroyed)) + .subscribe((params: Params) => { + const itemId = params['id']; - this.formGroupRawValue = JSON.parse(JSON.stringify(this.formGroup.getRawValue())); + if (itemId != null) { + this.isNew = false; + 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; - if (this.formGroup.get('profile')) { this.selectedDmpBlueprintDefinition = this.formGroup.get('profile').value; } - this.registerFormEventsForDmpBlueprint(); + 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(); - if (!this.isUserOwner) { - this.formGroup.disable(); - } - if (isNullOrUndefined(this.formGroup.get('extraProperties').get('publicDate').value)) { - this.formGroup.get('extraProperties').get('publicDate').patchValue(new Date()); - } + this.datasets = this.formGroup.get('datasets') as FormArray; - const principal = this.authService.current(); - let associate: UserModel = { - id: principal.id, - name: principal.name, - appRoles: principal.authorities, - email: principal.email - }; - this.associates.push(associate); - if (isNullOrUndefined(this.formGroup.get('extraProperties').get('contact').value)) { - this.formGroup.get('extraProperties').get('contact').patchValue(associate.id); - } - if (isNullOrUndefined(this.formGroup.get('extraProperties').get('language').value)) { - this.formGroup.get('extraProperties').get('language').patchValue('en'); - } + this.formGroupRawValue = JSON.parse(JSON.stringify(this.formGroup.getRawValue())); + if (!isNullOrUndefined(this.formGroup.get('profile').value)) { + this.dmpProfileService.getSingleBlueprint(this.formGroup.get('profile').value.id) + .pipe(takeUntil(this._destroyed)) + .subscribe(result => { + this.selectedDmpBlueprintDefinition = result.definition; + this.formGroup.get('profile').setValue(result); + 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; - try{ - const profiles = this.formGroup.get('profiles').value as DmpDatasetProfile[]; - profiles.sort((a,b)=>a.label.localeCompare(b.label)); - }catch{ - console.info('Could not sort profiles'); - } + this.setIsUserOwner(); + if (!this.isUserOwner) { + + if(this.isUserMember()){ + this.router.navigate(['plans', 'overview', itemId]); + return; + } + this.isFinalized = true; + this.formGroup.disable(); + } + + 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'}); + } + }); + }); + } + else { + 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.extraProperties.visible = false; + this.dmp.extraProperties.contact = this.authService.current().id; + this.formGroup = this.dmp.buildForm(); + + this.formGroupRawValue = JSON.parse(JSON.stringify(this.formGroup.getRawValue())); + + if (!isNullOrUndefined(this.formGroup.get('profile').value)) { + this.dmpProfileService.getSingleBlueprint(this.formGroup.get('profile').value.id) + .pipe(takeUntil(this._destroyed)) + .subscribe(result => { + this.selectedDmpBlueprintDefinition = result.definition; + this.formGroup.get('profile').setValue(result); + this.maxStep = this.selectedDmpBlueprintDefinition.sections.length; + this.step = 1; + this.addProfiles(); + }); + } + this.registerFormEventsForDmpBlueprint(); + + if (!this.isUserOwner) { + this.formGroup.disable(); + } + if (isNullOrUndefined(this.formGroup.get('extraProperties').get('publicDate').value)) { + this.formGroup.get('extraProperties').get('publicDate').patchValue(new Date()); + } + + const principal = this.authService.current(); + let associate: UserModel = { + id: principal.id, + name: principal.name, + appRoles: principal.authorities, + email: principal.email + }; + this.associates.push(associate); + if (isNullOrUndefined(this.formGroup.get('extraProperties').get('contact').value)) { + this.formGroup.get('extraProperties').get('contact').patchValue(associate.id); + } + if (isNullOrUndefined(this.formGroup.get('extraProperties').get('language').value)) { + this.formGroup.get('extraProperties').get('language').patchValue('en'); + } + + try{ + const profiles = this.formGroup.get('profiles').value as DmpDatasetProfile[]; + profiles.sort((a,b)=>a.label.localeCompare(b.label)); + }catch{ + console.info('Could not sort profiles'); + } + } + }); + this.profilesAutoCompleteConfiguration = { filterFn: this.filterProfiles.bind(this), @@ -182,8 +293,104 @@ export class DmpEditorBlueprintComponent extends BaseComponent implements OnInit }; } + 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) ); + } + } + + 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 false; + } + } + + getUserFromDMP(): any { + if (this.dmp) { + const principal: Principal = this.authService.current(); + return this.dmp.users.find(x => x.id === principal.id); + } + } + + private pumpLock() { + this.lock.touchedAt = new Date(); + this.lockService.createOrUpdate(this.lock).pipe(takeUntil(this._destroyed)).subscribe(async result => this.lock.id = Guid.parse(result)); + } + + public isDirty(): boolean { + return this.formGroup && this.formGroup.dirty && this.hasChanges; + } + + public discard() { + let messageText = ""; + let confirmButtonText = ""; + let cancelButtonText = ""; + if (this.isNew) { + messageText = this.language.instant('DATASET-EDITOR.ACTIONS.DISCARD.DISCARD-NEW-MESSAGE'); + confirmButtonText = this.language.instant('DATASET-EDITOR.ACTIONS.DISCARD.DISCARD-NEW-CONFIRM'); + cancelButtonText = this.language.instant('DATASET-EDITOR.ACTIONS.DISCARD.DISCARD-NEW-DENY'); + } else { + messageText = this.language.instant('DATASET-EDITOR.ACTIONS.DISCARD.DISCARD-EDITED-MESSAGE'); + confirmButtonText = this.language.instant('DATASET-EDITOR.ACTIONS.DISCARD.DISCARD-EDITED-CONFIRM'); + cancelButtonText = this.language.instant('DATASET-EDITOR.ACTIONS.DISCARD.DISCARD-EDITED-DENY'); + } + const dialogRef = this.dialog.open(ConfirmationDialogComponent, { + restoreFocus: false, + data: { + message: messageText, + confirmButton: confirmButtonText, + cancelButton: cancelButtonText, + isDeleteConfirmation: true + }, + maxWidth: '40em' + }); + dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => { + if (result) { + // this.backToDmp(this.formGroup.get('dmp').value.id) + setTimeout(x => { + this.discardChanges(); + }); + } + }); + } + + public discardChanges() { + this.isDiscarded = true; + this.hasChanges = false; + if (!this.isNew) { + let grantControl; + if (this.formGroup.get('grant').get('existGrant')) { + grantControl = new GrantTabModel(); + grantControl.fromModel(this.formGroup.get('grant').get('existGrant').value); + } else { + grantControl = new GrantEditorModel(); + grantControl.fromModel(this.formGroup.get('grant').value); + } + grantControl.buildForm() + + this.formGroup.patchValue(JSON.parse(JSON.stringify(this.formGroupRawValue))); + + if (this.formGroup.get('grant').get('existGrant')) { + this.formGroup.get('grant').get('existGrant').setValue(grantControl.existGrant); + } else { + this.formGroup.get('grant').setValue(grantControl); + } + } else { + this.formGroup.reset(); + this.formGroup.get("status").setValue(DmpStatus.Draft); + this.formGroup.get('extraProperties').get('visible').setValue(false); + this.formGroup.get('extraProperties').get('contact').setValue(this.authService.current().id); + this.formGroup.get('associatedUsers').setValue([]); + } + this.isDiscarded = false; + } + save() { - this.formSubmit(true); + this.formSubmit(false); } formSubmit(addNew?: boolean, showAddDatasetDialog?: boolean): void { @@ -349,6 +556,9 @@ export class DmpEditorBlueprintComponent extends BaseComponent implements OnInit // 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){ + this.router.navigate(['/plans', 'edit', dmp.id]); + } let dmpEditorModel: DmpEditorModel; dmpEditorModel = new DmpEditorModel(); dmpEditorModel.grant = new GrantTabModel(); @@ -572,30 +782,7 @@ export class DmpEditorBlueprintComponent extends BaseComponent implements OnInit .subscribe(Option => { if (Option instanceof Object) { this.selectedDmpBlueprintDefinition = Option.definition; - 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 => { - section.descriptionTemplates.forEach(template => { - this.sectionTemplates[section.ordinal - 1].push({id: template.descriptionTemplateId, label: template.label, description: ""}) - let data: DmpDatasetProfileSectionsFormModel= new DmpDatasetProfileSectionsFormModel(); - data.dmpSectionIndex.push(section.ordinal - 1); - let profile: DmpDatasetProfile = { - id: template.descriptionTemplateId, - label: template.label, - data: data - }; - let found: DmpDatasetProfile = templates.find(dmpDatasetProfile => dmpDatasetProfile.id == profile.id); - if (found === undefined) { - templates.push(profile); - } - else { - found.data.dmpSectionIndex.push(section.ordinal - 1); - } - }); - }); - this.formGroup.get('profiles').setValue(templates); + this.addProfiles(); } else { this.selectedDmpBlueprintDefinition = null; @@ -603,6 +790,47 @@ export class DmpEditorBlueprintComponent extends BaseComponent implements OnInit }) } + private addProfiles(profiles?: DmpDatasetProfile[]) { + 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: ""})); + } + else { + section.descriptionTemplates.forEach(template => { + this.sectionTemplates[section.ordinal - 1].push({id: template.descriptionTemplateId, label: template.label, description: ""}) + let found: DmpDatasetProfile = templates.find(dmpDatasetProfile => dmpDatasetProfile.id == template.descriptionTemplateId); + if (found === undefined) { + 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, + descriptionTemplateId: template.descriptionTemplateId, + label: template.label, + data: data + }; + templates.push(profile); + } + else { + found.data.dmpSectionIndex.push(section.ordinal - 1); + } + }); + } + }); + (profiles !== undefined) ? this.formGroup.get('profiles').setValue(profiles) : this.formGroup.get('profiles').setValue(templates); + + } + dmpBlueprintAutoCompleteConfiguration: SingleAutoCompleteConfiguration = { filterFn: this.dmpBlueprintSearch.bind(this), initialItems: (extraData) => this.dmpBlueprintSearch(''), @@ -788,20 +1016,35 @@ export class DmpEditorBlueprintComponent extends BaseComponent implements OnInit } }); } - onOptionSelected(){ + onOptionSelected(event, sectionIndex: number){ try{ - const profiles = this.formGroup.get('profiles').value as {id:string, label:string}[]; - const profileCounts: Map = new Map(); - profiles.forEach((value) => profileCounts.set(value.id, (profileCounts.get(value.id) !== undefined ? profileCounts.get(value.id): 0 ) + 1)); - const duplicateProfiles = profiles.filter((value) => { - let isOk = profileCounts.get(value.id) > 1; - if (isOk) { - profileCounts.set(value.id, 0); + 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){ + found.data.dmpSectionIndex.push(sectionIndex); } - return isOk; - }); - duplicateProfiles.forEach((value) => profiles.splice(profiles.lastIndexOf(value), 1)); - profiles.sort((a,b)=> a.label.localeCompare(b.label)); + else{ + this.sectionTemplates[sectionIndex].pop(); + } + } + else{ + let dmpDatasetProfileSection: DmpDatasetProfileSectionsFormModel = new DmpDatasetProfileSectionsFormModel(); + dmpDatasetProfileSection.dmpSectionIndex = [sectionIndex]; + profiles.push({id: null, descriptionTemplateId: event.id, label: event.label, data: dmpDatasetProfileSection}); + } + this.formGroup.get('profiles').setValue(profiles); + // const profileCounts: Map = new Map(); + // profiles.forEach((value) => profileCounts.set(value.id, (profileCounts.get(value.id) !== undefined ? profileCounts.get(value.id): 0 ) + 1)); + // const duplicateProfiles = profiles.filter((value) => { + // let isOk = profileCounts.get(value.id) > 1; + // if (isOk) { + // profileCounts.set(value.id, 0); + // } + // return isOk; + // }); + // duplicateProfiles.forEach((value) => profiles.splice(profiles.lastIndexOf(value), 1)); + // profiles.sort((a,b)=> a.label.localeCompare(b.label)); }catch{ console.info('Could not sort Dataset Templates') } diff --git a/dmp-frontend/src/app/ui/dmp/dmp.routing.ts b/dmp-frontend/src/app/ui/dmp/dmp.routing.ts index 3f1ea17b8..3f8e41b86 100644 --- a/dmp-frontend/src/app/ui/dmp/dmp.routing.ts +++ b/dmp-frontend/src/app/ui/dmp/dmp.routing.ts @@ -35,7 +35,7 @@ const routes: Routes = [ }, { path: 'edit/:id', - component: DmpEditorComponent, + component: DmpEditorBlueprintComponent, data: { breadcrumb: true, title: 'GENERAL.TITLES.DMP-EDIT' @@ -75,16 +75,6 @@ const routes: Routes = [ // breadcrumbs: 'new' // } // }, - // { - // path: 'new', - // component: DmpEditorComponent, - // canActivate: [AuthGuard], - // data: { - // breadcrumbs: 'new', - // title: 'GENERAL.TITLES.DMP-NEW' - // }, - // canDeactivate:[CanDeactivateGuard] - // }, { path: 'new', component: DmpEditorBlueprintComponent, diff --git a/dmp-frontend/src/app/ui/quick-wizard/dmp-editor/dmp-editor-wizard-model.ts b/dmp-frontend/src/app/ui/quick-wizard/dmp-editor/dmp-editor-wizard-model.ts index 496ba5cb3..088f44d84 100644 --- a/dmp-frontend/src/app/ui/quick-wizard/dmp-editor/dmp-editor-wizard-model.ts +++ b/dmp-frontend/src/app/ui/quick-wizard/dmp-editor/dmp-editor-wizard-model.ts @@ -24,7 +24,7 @@ export class DmpEditorWizardModel { this.label = item.label; this.status = item.status; this.description = item.description; - this.datasetProfile = item.profiles[0]; + this.datasetProfile = {id: item.profiles[0].descriptionTemplateId, label: item.profiles[0].label, description: ""}; this.language = item.language; return this; }