diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/dataset-identifier/dataset-profile-editor-dataset-identifier-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/dataset-identifier/dataset-profile-editor-dataset-identifier-field.component.ts index 04858d755..74e0e9c12 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/dataset-identifier/dataset-profile-editor-dataset-identifier-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/dataset-identifier/dataset-profile-editor-dataset-identifier-field.component.ts @@ -1,5 +1,6 @@ import { Component, Input, OnInit } from '@angular/core'; import { FormGroup } from '@angular/forms'; +import { Router } from '@angular/router'; import { DatasetIdentifierDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/dataset-identifier-data-editor-models'; @Component({ @@ -12,8 +13,12 @@ export class DatasetProfileEditorDatasetIdentifierFieldComponent implements OnIn @Input() form: FormGroup; private data: DatasetIdentifierDataEditorModel = new DatasetIdentifierDataEditorModel(); + constructor(private router: Router) {} + ngOnInit() { - this.form.patchValue({'rdaCommonStandard': 'dataset.dataset_id'}); + if(this.router.url.includes('new')){ + this.form.patchValue({'rdaCommonStandard': 'dataset.dataset_id'}); + } if (!this.form.get('data')) { this.form.addControl('data', this.data.buildForm()); } } } diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/researchers/dataset-profile-editor-researchers-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/researchers/dataset-profile-editor-researchers-field.component.ts index aa1e4ef72..3e63c3ca6 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/researchers/dataset-profile-editor-researchers-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/researchers/dataset-profile-editor-researchers-field.component.ts @@ -7,6 +7,7 @@ import { RegistriesDataEditorModel } from '@app/ui/admin/dataset-profile/admin/f import { ServicesDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/services-data-editor-models'; import { TagsDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/tags-data-editor-models'; import { ResearchersDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/researchers-data-editor-models'; +import { Router } from '@angular/router'; @Component({ selector: 'app-dataset-profile-editor-researchers-field-component', @@ -18,8 +19,12 @@ export class DatasetProfileEditorResearchersFieldComponent implements OnInit { @Input() form: FormGroup; private data: ResearchersDataEditorModel = new ResearchersDataEditorModel(); + constructor(private router: Router) {} + ngOnInit() { - this.form.patchValue({'rdaCommonStandard': 'dmp.contributor'}); + if(this.router.url.includes('new')){ + this.form.patchValue({'rdaCommonStandard': 'dmp.contributor'}); + } if (!this.form.get('data')) { this.form.addControl('data', this.data.buildForm()); } } } diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/tags/dataset-profile-editor-tags-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/tags/dataset-profile-editor-tags-field.component.ts index 6a4aed0f5..a7b34aebf 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/tags/dataset-profile-editor-tags-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/tags/dataset-profile-editor-tags-field.component.ts @@ -6,6 +6,7 @@ import { DataRepositoriesDataEditorModel } from '@app/ui/admin/dataset-profile/a import { RegistriesDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/registries-data-editor-models'; import { ServicesDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/services-data-editor-models'; import { TagsDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/tags-data-editor-models'; +import { Router } from '@angular/router'; @Component({ selector: 'app-dataset-profile-editor-tags-field-component', @@ -17,8 +18,12 @@ export class DatasetProfileEditorTagsFieldComponent implements OnInit { @Input() form: FormGroup; private data: TagsDataEditorModel = new TagsDataEditorModel(); + constructor(private router: Router) {} + ngOnInit() { - this.form.patchValue({'rdaCommonStandard': 'dataset.keyword'}); + if(this.router.url.includes('new')){ + this.form.patchValue({'rdaCommonStandard': 'dataset.keyword'}); + } if (!this.form.get('data')) { this.form.addControl('data', this.data.buildForm()); } } }