2018-01-30 10:35:26 +01:00
|
|
|
import { BaseErrorModel } from '../../models/error/BaseErrorModel';
|
|
|
|
import { SnackBarNotificationComponent } from '../../shared/components/notificaiton/snack-bar-notification.component';
|
|
|
|
import { DatasetProfileCriteria } from '../../models/criteria/dataset-profile/DatasetProfileCriteria';
|
|
|
|
import { DataManagementPlanModel } from '../../models/data-managemnt-plans/DataManagementPlanModel';
|
|
|
|
import { JsonSerializer } from '../../utilities/JsonSerializer';
|
|
|
|
import { DataManagementPlanCriteria } from '../../models/criteria/data-management-plan/DataManagementPlanCriteria';
|
|
|
|
import { RequestItem } from '../../models/criteria/RequestItem';
|
|
|
|
import { DatasetService } from '../../services/dataset/dataset.service';
|
|
|
|
import { ExternalSourcesItemModel } from '../../models/external-sources/ExternalSourcesItemModel';
|
|
|
|
import { DatasetProfileModel } from '../../models/datasetprofile/DatasetProfileModel';
|
|
|
|
import { DatasetProfileDefinitionModel } from '../../models/DatasetProfileDefinitionModel';
|
|
|
|
import { DatasetWizardModel } from '../../models/datasets/DatasetWizardModel';
|
|
|
|
import { DataManagementPlanService } from '../../services/data-management-plan/data-management-plan.service';
|
|
|
|
import { ExternalSourcesService } from '../../services/external-sources/external-sources.service';
|
|
|
|
import { DatasetWizardService } from '../../services/dataset-wizard/dataset-wizard.service';
|
2017-12-21 10:44:57 +01:00
|
|
|
import { TranslateService } from '@ngx-translate/core';
|
2018-01-12 11:17:37 +01:00
|
|
|
import { ActivatedRoute, Router, Params } from '@angular/router';
|
2018-05-28 11:50:42 +02:00
|
|
|
import { Component, ViewChild, OnInit, AfterViewInit, ViewEncapsulation, TemplateRef } from "@angular/core";
|
|
|
|
import { FormGroup, Validators, FormBuilder, FormArray } from "@angular/forms";
|
2018-03-05 17:18:45 +01:00
|
|
|
import * as FileSaver from 'file-saver';
|
2018-01-25 16:26:08 +01:00
|
|
|
import { MatPaginator, MatSort, MatSnackBar, MatStepper } from "@angular/material";
|
2018-05-28 11:50:42 +02:00
|
|
|
import { ExternalDatasetCriteria } from '../../models/criteria/external-dataset/ExternalDatasetCriteria';
|
|
|
|
import { ExternalDatasetModel } from '../../models/external-dataset/ExternalDatasetModel';
|
|
|
|
import { RegistryCriteria } from '../../models/criteria/registry/RegistryCriteria';
|
|
|
|
import { RegisterModel } from '../../models/registers/RegisterModel';
|
|
|
|
import { DataRepositoryCriteria } from '../../models/criteria/data-repository/DataRepositoryCriteria';
|
|
|
|
import { ServicesCriteria } from '../../models/criteria/services/ServicesCriteria';
|
|
|
|
import { ServiceModel } from '../../models/services/ServiceModel';
|
|
|
|
import { DataRepositoryModel } from '../../models/dataRepositories/DataRepositoryModel';
|
|
|
|
import { ExternalSourcesConfigurationService } from '../../services/external-sources/external-sources-configuration.service';
|
|
|
|
import { ExternalSourcesConfiguration } from '../../models/external-sources/ExternalSourcesConfiguration';
|
2018-06-28 11:28:16 +02:00
|
|
|
import { IBreadCrumbComponent } from '../../shared/components/breadcrumb/definition/IBreadCrumbComponent';
|
|
|
|
import { Observable } from 'rxjs/Observable';
|
|
|
|
import { BreadcrumbItem } from '../../shared/components/breadcrumb/definition/breadcrumb-item';
|
2018-07-11 15:47:36 +02:00
|
|
|
import { TagsCriteria } from '../../models/criteria/tags/TagsCriteria';
|
|
|
|
import { TagModel } from '../../models/tags/TagModel';
|
2018-07-24 13:19:52 +02:00
|
|
|
import { AutoCompleteConfiguration } from '../../shared/components/auto-complete/AutoCompleteConfiguration';
|
2017-12-19 14:57:07 +01:00
|
|
|
|
|
|
|
@Component({
|
2017-12-20 09:17:13 +01:00
|
|
|
selector: 'app-dataset-wizard-component',
|
|
|
|
templateUrl: 'dataset-wizard.component.html',
|
|
|
|
styleUrls: ['./dataset-wizard.component.scss'],
|
2017-12-19 14:57:07 +01:00
|
|
|
encapsulation: ViewEncapsulation.None
|
|
|
|
})
|
2018-06-28 11:28:16 +02:00
|
|
|
export class DatasetWizardComponent implements OnInit, IBreadCrumbComponent {
|
|
|
|
breadCrumbs: Observable<BreadcrumbItem[]>;
|
2018-03-05 17:18:45 +01:00
|
|
|
@ViewChild('stepper') stepper: MatStepper;
|
2017-12-19 14:57:07 +01:00
|
|
|
|
2018-05-28 11:50:42 +02:00
|
|
|
//autocomplete Display Functions;
|
2018-07-11 15:47:36 +02:00
|
|
|
externalDatasetDisplayFunc = (item) => item ? item.label : null;
|
|
|
|
registriesDisplayFunc = (item) => item ? item.label : null;
|
|
|
|
dataRepositoryDisplayFunc = (item) => item ? item.name : null;
|
|
|
|
servicesDisplayFunc = (item) => item ? item.label : null;
|
|
|
|
tagsDisplayFunc = (item) => item ? item.name : null;
|
|
|
|
|
|
|
|
|
|
|
|
//autocomplete Display Functions;
|
|
|
|
externalDatasetDisplaySubtitleFunc = (item) => item ? item.tag : null;
|
|
|
|
registriesDisplaySubtitleFunc = (item) => item ? item.tag : null;
|
|
|
|
dataRepositoryDisplaySubtitleFunc = (item) => item ? item.tag : null;
|
|
|
|
servicesDisplaySubtitleFunc = (item) => item ? item.tag : null;
|
|
|
|
tagsDisplaySubtitleFunc = (item) => item ? item.tag : null;
|
2018-05-28 11:50:42 +02:00
|
|
|
|
|
|
|
//autocomplete Configurations;
|
|
|
|
externalDatasetAutoCompleteConfiguration: AutoCompleteConfiguration;
|
|
|
|
registriesAutoCompleteConfiguration: AutoCompleteConfiguration;
|
|
|
|
dataRepositoriesAutoCompleteConfiguration: AutoCompleteConfiguration;
|
|
|
|
servicesAutoCompleteConfiguration: AutoCompleteConfiguration;
|
2018-07-11 15:47:36 +02:00
|
|
|
tagsAutoCompleteConfiguration: AutoCompleteConfiguration;
|
2018-05-28 11:50:42 +02:00
|
|
|
externalSourcesConfiguration: ExternalSourcesConfiguration;
|
|
|
|
|
2018-01-12 11:17:37 +01:00
|
|
|
datasetWizardModel: DatasetWizardModel;
|
2017-12-21 10:26:11 +01:00
|
|
|
isNew = true;
|
2018-01-12 11:17:37 +01:00
|
|
|
formGroup: FormGroup;
|
2018-01-26 15:24:23 +01:00
|
|
|
datasetProfileDefinitionModel: DatasetProfileDefinitionModel;
|
2018-01-17 12:57:41 +01:00
|
|
|
|
|
|
|
availableProfiles: DatasetProfileModel[] = [];
|
2018-03-05 17:18:45 +01:00
|
|
|
itemId: string
|
2017-12-19 14:57:07 +01:00
|
|
|
constructor(
|
2017-12-20 14:34:32 +01:00
|
|
|
private datasetWizardService: DatasetWizardService,
|
2017-12-21 10:26:11 +01:00
|
|
|
private formBuilder: FormBuilder,
|
|
|
|
private datasetService: DatasetService,
|
|
|
|
private route: ActivatedRoute,
|
2018-01-12 11:17:37 +01:00
|
|
|
public snackBar: MatSnackBar,
|
2017-12-21 10:26:11 +01:00
|
|
|
public router: Router,
|
2018-01-12 11:17:37 +01:00
|
|
|
public language: TranslateService,
|
2018-01-17 12:57:41 +01:00
|
|
|
public externalSourcesService: ExternalSourcesService,
|
2018-05-28 11:50:42 +02:00
|
|
|
public dataManagementPlanService: DataManagementPlanService,
|
|
|
|
public externalSourcesConfigurationService: ExternalSourcesConfigurationService
|
2017-12-19 14:57:07 +01:00
|
|
|
) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
isLinear = false;
|
2017-12-20 14:34:32 +01:00
|
|
|
firstStepFormGroup: FormGroup;
|
2017-12-19 14:57:07 +01:00
|
|
|
secondFormGroup: FormGroup;
|
|
|
|
|
|
|
|
ngOnInit() {
|
2017-12-20 14:34:32 +01:00
|
|
|
let dmpRequestItem: RequestItem<DataManagementPlanCriteria> = new RequestItem();
|
|
|
|
dmpRequestItem.criteria = new DataManagementPlanCriteria();
|
2018-01-25 09:14:43 +01:00
|
|
|
|
2018-05-28 11:50:42 +02:00
|
|
|
let externalDatasetRequestItem: RequestItem<ExternalDatasetCriteria> = new RequestItem();
|
|
|
|
externalDatasetRequestItem.criteria = new ExternalDatasetCriteria();
|
|
|
|
this.externalDatasetAutoCompleteConfiguration = new AutoCompleteConfiguration(this.externalSourcesService.searchDatasetSExternalDatasetservice.bind(this.externalSourcesService), externalDatasetRequestItem)
|
|
|
|
|
|
|
|
let registriesRequestItem: RequestItem<RegistryCriteria> = new RequestItem();
|
|
|
|
registriesRequestItem.criteria = new RegistryCriteria();
|
|
|
|
this.registriesAutoCompleteConfiguration = new AutoCompleteConfiguration(this.externalSourcesService.searchDatasetRegistry.bind(this.externalSourcesService), registriesRequestItem)
|
|
|
|
|
|
|
|
let dataRepositoriesRequestItem: RequestItem<DataRepositoryCriteria> = new RequestItem();
|
|
|
|
dataRepositoriesRequestItem.criteria = new DataRepositoryCriteria();
|
|
|
|
this.dataRepositoriesAutoCompleteConfiguration = new AutoCompleteConfiguration(this.externalSourcesService.searchDatasetRepository.bind(this.externalSourcesService), dataRepositoriesRequestItem)
|
2018-01-17 12:57:41 +01:00
|
|
|
|
2018-05-28 11:50:42 +02:00
|
|
|
let servicesRequestItem: RequestItem<ServicesCriteria> = new RequestItem();
|
|
|
|
servicesRequestItem.criteria = new ServicesCriteria();
|
|
|
|
this.servicesAutoCompleteConfiguration = new AutoCompleteConfiguration(this.externalSourcesService.searchDatasetService.bind(this.externalSourcesService), servicesRequestItem)
|
|
|
|
|
2018-07-11 15:47:36 +02:00
|
|
|
let tagsRequestItem: RequestItem<TagsCriteria> = new RequestItem();
|
|
|
|
tagsRequestItem.criteria = new TagsCriteria();
|
|
|
|
this.tagsAutoCompleteConfiguration = new AutoCompleteConfiguration(this.externalSourcesService.searchDatasetTags.bind(this.externalSourcesService), tagsRequestItem)
|
|
|
|
|
2018-05-28 11:50:42 +02:00
|
|
|
this.externalSourcesConfigurationService.getExternalSourcesConfiguration().subscribe(result => {
|
|
|
|
this.externalSourcesConfiguration = result;
|
2018-06-29 10:29:43 +02:00
|
|
|
this.externalSourcesConfiguration.dataRepositories.push({ key: '', label: "All" })
|
|
|
|
this.externalSourcesConfiguration.externalDatasets.push({ key: '', label: "All" })
|
|
|
|
this.externalSourcesConfiguration.registries.push({ key: '', label: "All" })
|
|
|
|
this.externalSourcesConfiguration.services.push({ key: '', label: "All" })
|
2018-07-11 15:47:36 +02:00
|
|
|
this.externalSourcesConfiguration.tags.push({ key: '', label: "All" })
|
2018-05-28 11:50:42 +02:00
|
|
|
})
|
|
|
|
let dmpAutoCompleteConfiguration = {}
|
2017-12-21 10:26:11 +01:00
|
|
|
this.route.params.subscribe((params: Params) => {
|
2018-03-05 17:18:45 +01:00
|
|
|
this.itemId = params['id'];
|
2018-01-17 12:57:41 +01:00
|
|
|
const dmpId = params['dmpId'];
|
2018-03-05 17:18:45 +01:00
|
|
|
if (this.itemId != null) {
|
2017-12-21 10:26:11 +01:00
|
|
|
this.isNew = false;
|
2018-03-05 17:18:45 +01:00
|
|
|
this.datasetWizardService.getSingle(this.itemId).map(data => data as DatasetWizardModel)
|
2017-12-21 10:26:11 +01:00
|
|
|
.subscribe(data => {
|
2018-01-03 17:36:31 +01:00
|
|
|
this.datasetWizardModel = JsonSerializer.fromJSONObject(data, DatasetWizardModel);
|
2018-06-28 11:28:16 +02:00
|
|
|
this.breadCrumbs = Observable.of([
|
|
|
|
{
|
|
|
|
parentComponentName: null,
|
|
|
|
label: "Datasets",
|
|
|
|
url: "/datasets",
|
|
|
|
notFoundResolver: [
|
|
|
|
{
|
|
|
|
parentComponentName: null,
|
|
|
|
label: this.datasetWizardModel.dmp.project.label,
|
|
|
|
url: "/projects/edit/" + this.datasetWizardModel.dmp.project.id
|
|
|
|
},
|
|
|
|
{
|
|
|
|
parentComponentName: null,
|
|
|
|
label: this.datasetWizardModel.dmp.label,
|
|
|
|
url: "/dmps/edit/" + this.datasetWizardModel.dmp.id,
|
|
|
|
},
|
|
|
|
]
|
2018-07-23 16:01:27 +02:00
|
|
|
}])
|
2017-12-22 14:42:47 +01:00
|
|
|
this.formGroup = this.datasetWizardModel.buildForm();
|
2018-01-25 09:14:43 +01:00
|
|
|
this.loadDatasetProfiles();
|
2018-01-17 12:57:41 +01:00
|
|
|
});
|
|
|
|
} else if (dmpId != null) {
|
|
|
|
this.isNew = true;
|
|
|
|
this.dataManagementPlanService.getSingle(dmpId).map(data => data as DataManagementPlanModel)
|
|
|
|
.subscribe(data => {
|
|
|
|
this.datasetWizardModel = new DatasetWizardModel();
|
|
|
|
setTimeout(() => {
|
|
|
|
this.datasetWizardModel.dmp = data;
|
|
|
|
this.formGroup = this.datasetWizardModel.buildForm();
|
|
|
|
this.loadDatasetProfiles();
|
2018-07-23 15:09:19 +02:00
|
|
|
|
|
|
|
this.breadCrumbs = Observable.of([
|
|
|
|
{
|
|
|
|
parentComponentName: null,
|
|
|
|
label: "Datasets",
|
|
|
|
url: "/datasets",
|
|
|
|
notFoundResolver: [
|
|
|
|
{
|
|
|
|
parentComponentName: null,
|
|
|
|
label: this.datasetWizardModel.dmp.project.label,
|
|
|
|
url: "/projects/edit/" + this.datasetWizardModel.dmp.project.id
|
|
|
|
},
|
|
|
|
{
|
|
|
|
parentComponentName: null,
|
|
|
|
label: this.datasetWizardModel.dmp.label,
|
|
|
|
url: "/dmps/edit/" + this.datasetWizardModel.dmp.id,
|
|
|
|
}]
|
|
|
|
}])
|
2018-01-12 11:17:37 +01:00
|
|
|
});
|
2017-12-21 10:26:11 +01:00
|
|
|
});
|
|
|
|
} else {
|
2018-01-17 12:57:41 +01:00
|
|
|
|
2017-12-21 10:26:11 +01:00
|
|
|
}
|
2017-12-19 14:57:07 +01:00
|
|
|
});
|
2018-01-12 11:17:37 +01:00
|
|
|
|
|
|
|
|
2017-12-19 14:57:07 +01:00
|
|
|
}
|
|
|
|
|
2018-01-25 16:26:08 +01:00
|
|
|
ngAfterViewInit() {
|
|
|
|
this.route.params.subscribe((params: Params) => {
|
|
|
|
let itemId = params['id'];
|
2018-03-05 17:18:45 +01:00
|
|
|
if (itemId != null) this.stepper.selectedIndex = 2;
|
2018-01-25 16:26:08 +01:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-01-17 12:57:41 +01:00
|
|
|
loadDatasetProfiles() {
|
|
|
|
let datasetProfileRequestItem: RequestItem<DatasetProfileCriteria> = new RequestItem();
|
|
|
|
datasetProfileRequestItem.criteria = new DatasetProfileCriteria();
|
|
|
|
datasetProfileRequestItem.criteria.id = this.datasetWizardModel.dmp.id;
|
|
|
|
this.datasetWizardService.getAvailableProfiles(datasetProfileRequestItem).subscribe(items => {
|
2018-01-19 14:48:40 +01:00
|
|
|
this.availableProfiles = JsonSerializer.fromJSONArray(items, DatasetProfileModel);
|
2018-01-17 12:57:41 +01:00
|
|
|
});
|
|
|
|
}
|
2017-12-19 14:57:07 +01:00
|
|
|
|
|
|
|
public cancel(): void {
|
|
|
|
//this.router.navigate(['/dataManagementPlans']);
|
|
|
|
}
|
2017-12-21 10:44:57 +01:00
|
|
|
|
2018-01-25 09:14:43 +01:00
|
|
|
getDefinition() {
|
2018-01-25 16:24:21 +01:00
|
|
|
if (this.isNew) {
|
|
|
|
this.datasetWizardService.getDefinition(this.formGroup.get("profile").get("id").value).subscribe(item => {
|
2018-03-05 17:18:45 +01:00
|
|
|
this.datasetWizardModel.datasetProfileDefinition = JsonSerializer.fromJSONObject(item, DatasetProfileDefinitionModel);
|
2018-01-30 10:35:26 +01:00
|
|
|
this.datasetProfileDefinitionModel = this.datasetWizardModel.datasetProfileDefinition;
|
2018-03-05 17:18:45 +01:00
|
|
|
this.formGroup.addControl("datasetProfileDefinition", this.datasetProfileDefinitionModel.buildForm())
|
2018-01-25 16:24:21 +01:00
|
|
|
})
|
|
|
|
}
|
2018-01-25 09:14:43 +01:00
|
|
|
}
|
|
|
|
|
2017-12-21 10:44:57 +01:00
|
|
|
|
|
|
|
formSubmit(): void {
|
|
|
|
if (!this.isFormValid()) { return; }
|
|
|
|
this.onSubmit();
|
|
|
|
}
|
|
|
|
|
|
|
|
public isFormValid() {
|
|
|
|
return this.formGroup.valid;
|
|
|
|
}
|
|
|
|
|
|
|
|
onSubmit(): void {
|
2017-12-22 14:42:47 +01:00
|
|
|
this.datasetWizardService.createDataset(this.formGroup.value).subscribe(
|
|
|
|
complete => {
|
|
|
|
this.datasetWizardService.getSingle(complete.id).subscribe(
|
2018-01-12 11:17:37 +01:00
|
|
|
result => {
|
|
|
|
this.datasetWizardModel = JsonSerializer.fromJSONObject(result, DatasetWizardModel);
|
2017-12-22 14:42:47 +01:00
|
|
|
}
|
|
|
|
)
|
|
|
|
this.onCallbackSuccess()
|
|
|
|
},
|
2017-12-21 10:44:57 +01:00
|
|
|
error => this.onCallbackError(error)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2018-01-25 16:26:08 +01:00
|
|
|
submit() {
|
2018-01-30 12:07:51 +01:00
|
|
|
this.datasetWizardService.createDataset(this.formGroup.value).subscribe(data => {
|
2018-01-30 10:35:26 +01:00
|
|
|
this.router.navigateByUrl("/datasets/dmp/" + this.datasetWizardModel.dmp.id);
|
2018-01-25 16:26:08 +01:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
save() {
|
2018-06-05 10:18:01 +02:00
|
|
|
if (!this.isFormValid()) { return; }
|
2018-03-05 17:18:45 +01:00
|
|
|
this.formGroup.get("status").setValue("0");
|
2018-01-25 16:26:08 +01:00
|
|
|
this.submit();
|
|
|
|
}
|
|
|
|
|
|
|
|
saveFinalize() {
|
2018-06-05 10:18:01 +02:00
|
|
|
if (!this.isFormValid()) { return; }
|
2018-03-05 17:18:45 +01:00
|
|
|
this.formGroup.get("status").setValue("1");
|
2018-01-25 16:26:08 +01:00
|
|
|
this.submit();
|
|
|
|
}
|
|
|
|
|
2017-12-21 10:44:57 +01:00
|
|
|
onCallbackSuccess(): void {
|
|
|
|
this.snackBar.openFromComponent(SnackBarNotificationComponent, {
|
|
|
|
data: { message: this.isNew ? 'GENERAL.SNACK-BAR.SUCCESSFUL-CREATION' : 'GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE', language: this.language },
|
|
|
|
duration: 3000,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
onCallbackError(error: any) {
|
|
|
|
this.setErrorModel(error.error);
|
|
|
|
}
|
|
|
|
|
|
|
|
public setErrorModel(errorModel: BaseErrorModel) {
|
|
|
|
Object.keys(errorModel).forEach(item => {
|
2017-12-22 14:42:47 +01:00
|
|
|
(<any>this.datasetWizardModel.errorModel)[item] = (<any>errorModel)[item];
|
2017-12-21 10:44:57 +01:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2018-03-05 17:18:45 +01:00
|
|
|
downloadPDF(): void {
|
|
|
|
this.datasetWizardService.downloadPDF(this.itemId).subscribe(response => {
|
|
|
|
const blob = new Blob([response.body], { type: 'application/pdf' })
|
|
|
|
const filename = this.getFilenameFromContentDispositionHeader(response.headers.get('Content-Disposition'));
|
|
|
|
|
|
|
|
FileSaver.saveAs(blob, filename)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2018-03-06 15:58:38 +01:00
|
|
|
downloadXML(): void {
|
|
|
|
this.datasetWizardService.downloadXML(this.itemId).subscribe(response => {
|
|
|
|
const blob = new Blob([response.body], { type: 'application/xml' })
|
|
|
|
const filename = this.getFilenameFromContentDispositionHeader(response.headers.get('Content-Disposition'));
|
|
|
|
|
|
|
|
FileSaver.saveAs(blob, filename)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2018-05-28 11:50:42 +02:00
|
|
|
getFilenameFromContentDispositionHeader(header: string): string {
|
2018-03-05 17:18:45 +01:00
|
|
|
const regex: RegExp = new RegExp(/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/g);
|
|
|
|
|
|
|
|
const matches = header.match(regex);
|
|
|
|
let filename: string;
|
|
|
|
for (let i = 0; i < matches.length; i++) {
|
|
|
|
const match = matches[i];
|
|
|
|
if (match.includes('filename="')) {
|
|
|
|
filename = match.substring(10, match.length - 1);
|
|
|
|
break;
|
|
|
|
} else if (match.includes('filename=')) {
|
|
|
|
filename = match.substring(9);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return filename;
|
|
|
|
}
|
2018-05-28 11:50:42 +02:00
|
|
|
|
|
|
|
public redirectToProject() {
|
|
|
|
this.router.navigate(["projects/edit/" + this.datasetWizardModel.dmp.project.id])
|
|
|
|
}
|
|
|
|
|
|
|
|
public redirectToDmp() {
|
|
|
|
this.router.navigate(["dmps/edit/" + this.datasetWizardModel.dmp.id])
|
|
|
|
}
|
|
|
|
|
|
|
|
externalDatasetsOnItemChange(event) {
|
|
|
|
let externalDatasetModel = new ExternalDatasetModel(event.id, event.abbreviation, event.label, event.reference);
|
|
|
|
(<FormArray>this.formGroup.get("externalDatasets")).push(externalDatasetModel.buildForm());
|
|
|
|
}
|
|
|
|
|
|
|
|
registriesOnItemChange(event) {
|
|
|
|
let registryModel = new RegisterModel(event.abbreviation, event.definition, event.id, event.label, event.reference, event.uri);
|
|
|
|
(<FormArray>this.formGroup.get("registries")).push(registryModel.buildForm());
|
|
|
|
}
|
|
|
|
|
|
|
|
servicesOnItemChange(event) {
|
|
|
|
let serviceModel = new ServiceModel(event.abbreviation, event.definition, event.id, event.label, event.reference, event.uri);
|
|
|
|
(<FormArray>this.formGroup.get("services")).push(serviceModel.buildForm());
|
|
|
|
}
|
|
|
|
|
2018-07-11 15:47:36 +02:00
|
|
|
tagsOnItemChange(event) {
|
|
|
|
let serviceModel = new TagModel(event.id, event.name);
|
|
|
|
(<FormArray>this.formGroup.get("tags")).push(serviceModel.buildForm());
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-05-28 11:50:42 +02:00
|
|
|
dataRepositoriesOnItemChange(event) {
|
|
|
|
let dataRepositoryModel = new DataRepositoryModel(event.id, event.name, event.pid, event.uri);
|
|
|
|
(<FormArray>this.formGroup.get("dataRepositories")).push(dataRepositoryModel.buildForm());
|
|
|
|
}
|
|
|
|
}
|