|
|
|
@ -1,46 +1,47 @@
|
|
|
|
|
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 { DatasetProfileModel } from '../../models/datasetprofile/DatasetProfileModel';
|
|
|
|
|
import { DatasetProfileDefinitionModel } from '../../models/DatasetProfileDefinitionModel';
|
|
|
|
|
import { DatasetWizardModel, DatasetStatus } 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';
|
|
|
|
|
import { AfterViewInit, Component, OnInit, ViewChild, ViewEncapsulation } from '@angular/core';
|
|
|
|
|
import { FormArray, FormBuilder, FormGroup } from '@angular/forms';
|
|
|
|
|
import { MatDialog, MatSnackBar, MatStepper } from '@angular/material';
|
|
|
|
|
import { ActivatedRoute, Params, Router } from '@angular/router';
|
|
|
|
|
import { TranslateService } from '@ngx-translate/core';
|
|
|
|
|
import { ActivatedRoute, Router, Params } from '@angular/router';
|
|
|
|
|
import { Component, ViewChild, OnInit, AfterViewInit, ViewEncapsulation, TemplateRef, ChangeDetectionStrategy } from '@angular/core';
|
|
|
|
|
import { FormGroup, FormBuilder, FormArray } from '@angular/forms';
|
|
|
|
|
import * as FileSaver from 'file-saver';
|
|
|
|
|
import { MatSnackBar, MatStepper, MatDialog } from '@angular/material';
|
|
|
|
|
import { BehaviorSubject, Observable } from 'rxjs';
|
|
|
|
|
import { takeUntil } from 'rxjs/operators';
|
|
|
|
|
import { BaseComponent } from '../../core/common/base/base.component';
|
|
|
|
|
import { DataManagementPlanCriteria } from '../../models/criteria/data-management-plan/DataManagementPlanCriteria';
|
|
|
|
|
import { DataRepositoryCriteria } from '../../models/criteria/data-repository/DataRepositoryCriteria';
|
|
|
|
|
import { DatasetProfileCriteria } from '../../models/criteria/dataset-profile/DatasetProfileCriteria';
|
|
|
|
|
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 { RequestItem } from '../../models/criteria/RequestItem';
|
|
|
|
|
import { ServicesCriteria } from '../../models/criteria/services/ServicesCriteria';
|
|
|
|
|
import { ServiceModel } from '../../models/services/ServiceModel';
|
|
|
|
|
import { TagsCriteria } from '../../models/criteria/tags/TagsCriteria';
|
|
|
|
|
import { DataManagementPlanListingModel } from '../../models/data-managemnt-plans/DataManagementPlanListingModel';
|
|
|
|
|
import { DataManagementPlanModel } from '../../models/data-managemnt-plans/DataManagementPlanModel';
|
|
|
|
|
import { DataRepositoryModel } from '../../models/dataRepositories/DataRepositoryModel';
|
|
|
|
|
import { ExternalSourcesConfigurationService } from '../../services/external-sources/external-sources-configuration.service';
|
|
|
|
|
import { DatasetProfileModel } from '../../models/datasetprofile/DatasetProfileModel';
|
|
|
|
|
import { DatasetProfileDefinitionModel } from '../../models/DatasetProfileDefinitionModel';
|
|
|
|
|
import { DatasetStatus, DatasetWizardModel } from '../../models/datasets/DatasetWizardModel';
|
|
|
|
|
import { BaseErrorModel } from '../../models/error/BaseErrorModel';
|
|
|
|
|
import { ExternalDatasetModel } from '../../models/external-dataset/ExternalDatasetModel';
|
|
|
|
|
import { ExternalSourcesConfiguration } from '../../models/external-sources/ExternalSourcesConfiguration';
|
|
|
|
|
import { IBreadCrumbComponent } from '../../shared/components/breadcrumb/definition/IBreadCrumbComponent';
|
|
|
|
|
import { Observable } from 'rxjs';
|
|
|
|
|
import { BreadcrumbItem } from '../../shared/components/breadcrumb/definition/breadcrumb-item';
|
|
|
|
|
import { TagsCriteria } from '../../models/criteria/tags/TagsCriteria';
|
|
|
|
|
import { RegisterModel } from '../../models/registers/RegisterModel';
|
|
|
|
|
import { ServiceModel } from '../../models/services/ServiceModel';
|
|
|
|
|
import { TagModel } from '../../models/tags/TagModel';
|
|
|
|
|
import { DataManagementPlanService } from '../../services/data-management-plan/data-management-plan.service';
|
|
|
|
|
import { DatasetWizardService } from '../../services/dataset-wizard/dataset-wizard.service';
|
|
|
|
|
import { DatasetService } from '../../services/dataset/dataset.service';
|
|
|
|
|
import { ExternalSourcesConfigurationService } from '../../services/external-sources/external-sources-configuration.service';
|
|
|
|
|
import { ExternalSourcesService } from '../../services/external-sources/external-sources.service';
|
|
|
|
|
import { AutoCompleteConfiguration } from '../../shared/components/auto-complete/AutoCompleteConfiguration';
|
|
|
|
|
import { SingleAutoCompleteConfiguration } from '../../shared/components/autocompletes/single/single-auto-complete-configuration';
|
|
|
|
|
import { DataManagementPlanListingModel } from '../../models/data-managemnt-plans/DataManagementPlanListingModel';
|
|
|
|
|
import { BreadcrumbItem } from '../../shared/components/breadcrumb/definition/breadcrumb-item';
|
|
|
|
|
import { IBreadCrumbComponent } from '../../shared/components/breadcrumb/definition/IBreadCrumbComponent';
|
|
|
|
|
import { SnackBarNotificationComponent } from '../../shared/components/notificaiton/snack-bar-notification.component';
|
|
|
|
|
import { JsonSerializer } from '../../utilities/JsonSerializer';
|
|
|
|
|
import { DataRepositoryReferencedModelHelperComponent } from '../dataset-referenced-models-helper/datarepository/datarepository-referenced-model-helper.component';
|
|
|
|
|
import { RegistryReferencedModelHelperComponent } from '../dataset-referenced-models-helper/registry/registry-referenced-model-helper.component';
|
|
|
|
|
import { ExternalDatasetReferencedModelHelperComponent } from '../dataset-referenced-models-helper/externalDataset/externaldataset-referenced-model-helper.component';
|
|
|
|
|
import { RegistryReferencedModelHelperComponent } from '../dataset-referenced-models-helper/registry/registry-referenced-model-helper.component';
|
|
|
|
|
import { ServicesReferencedModelHelperComponent } from '../dataset-referenced-models-helper/services/services-referenced-model-helper.component';
|
|
|
|
|
import { BehaviorSubject } from 'rxjs';
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'app-dataset-wizard-component',
|
|
|
|
@ -48,7 +49,7 @@ import { BehaviorSubject } from 'rxjs';
|
|
|
|
|
styleUrls: ['./dataset-wizard.component.scss'],
|
|
|
|
|
encapsulation: ViewEncapsulation.None,
|
|
|
|
|
})
|
|
|
|
|
export class DatasetWizardComponent implements OnInit, AfterViewInit, IBreadCrumbComponent {
|
|
|
|
|
export class DatasetWizardComponent extends BaseComponent implements OnInit, AfterViewInit, IBreadCrumbComponent {
|
|
|
|
|
breadCrumbs: Observable<BreadcrumbItem[]>;
|
|
|
|
|
viewOnly = false;
|
|
|
|
|
@ViewChild('stepper') stepper: MatStepper;
|
|
|
|
@ -101,13 +102,14 @@ export class DatasetWizardComponent implements OnInit, AfterViewInit, IBreadCrum
|
|
|
|
|
public dialog: MatDialog,
|
|
|
|
|
public externalSourcesConfigurationService: ExternalSourcesConfigurationService
|
|
|
|
|
) {
|
|
|
|
|
|
|
|
|
|
super();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
|
this.route
|
|
|
|
|
.data
|
|
|
|
|
.pipe(takeUntil(this._destroyed))
|
|
|
|
|
.subscribe(v => this.viewOnly = v['public']);
|
|
|
|
|
|
|
|
|
|
const dmpRequestItem: RequestItem<DataManagementPlanCriteria> = new RequestItem();
|
|
|
|
@ -138,14 +140,16 @@ export class DatasetWizardComponent implements OnInit, AfterViewInit, IBreadCrum
|
|
|
|
|
this.tagsAutoCompleteConfiguration = new AutoCompleteConfiguration(this.externalSourcesService.searchDatasetTags.bind(this.externalSourcesService),
|
|
|
|
|
tagsRequestItem, new BehaviorSubject(false));
|
|
|
|
|
|
|
|
|
|
this.externalSourcesConfigurationService.getExternalSourcesConfiguration().subscribe(result => {
|
|
|
|
|
this.externalSourcesConfiguration = result;
|
|
|
|
|
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' });
|
|
|
|
|
this.externalSourcesConfiguration.tags.push({ key: '', label: 'All' });
|
|
|
|
|
});
|
|
|
|
|
this.externalSourcesConfigurationService.getExternalSourcesConfiguration()
|
|
|
|
|
.pipe(takeUntil(this._destroyed))
|
|
|
|
|
.subscribe(result => {
|
|
|
|
|
this.externalSourcesConfiguration = result;
|
|
|
|
|
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' });
|
|
|
|
|
this.externalSourcesConfiguration.tags.push({ key: '', label: 'All' });
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
this.dmpAutoCompleteConfiguration = {
|
|
|
|
|
filterFn: this.searchDmp.bind(this),
|
|
|
|
@ -161,6 +165,7 @@ export class DatasetWizardComponent implements OnInit, AfterViewInit, IBreadCrum
|
|
|
|
|
if (this.itemId != null) {
|
|
|
|
|
this.isNew = false;
|
|
|
|
|
this.datasetWizardService.getSingle(this.itemId).map(data => data as DatasetWizardModel)
|
|
|
|
|
.pipe(takeUntil(this._destroyed))
|
|
|
|
|
.subscribe(data => {
|
|
|
|
|
this.datasetWizardModel = JsonSerializer.fromJSONObject(data, DatasetWizardModel);
|
|
|
|
|
this.breadCrumbs = Observable.of([
|
|
|
|
@ -193,6 +198,7 @@ export class DatasetWizardComponent implements OnInit, AfterViewInit, IBreadCrum
|
|
|
|
|
} else if (dmpId != null) {
|
|
|
|
|
this.isNew = true;
|
|
|
|
|
this.dataManagementPlanService.getSingle(dmpId).map(data => data as DataManagementPlanModel)
|
|
|
|
|
.pipe(takeUntil(this._destroyed))
|
|
|
|
|
.subscribe(data => {
|
|
|
|
|
this.datasetWizardModel = new DatasetWizardModel();
|
|
|
|
|
setTimeout(() => {
|
|
|
|
@ -232,17 +238,21 @@ export class DatasetWizardComponent implements OnInit, AfterViewInit, IBreadCrum
|
|
|
|
|
this.viewOnly = true;
|
|
|
|
|
}
|
|
|
|
|
if (this.viewOnly) { this.formGroup.disable(); }
|
|
|
|
|
this.formGroup.get('dmp').valueChanges.subscribe(x => {
|
|
|
|
|
this.loadDatasetProfiles();
|
|
|
|
|
});
|
|
|
|
|
this.formGroup.get('dmp').valueChanges
|
|
|
|
|
.pipe(takeUntil(this._destroyed))
|
|
|
|
|
.subscribe(x => {
|
|
|
|
|
this.loadDatasetProfiles();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ngAfterViewInit() {
|
|
|
|
|
this.route.params.subscribe((params: Params) => {
|
|
|
|
|
const itemId = params['id'];
|
|
|
|
|
if (itemId != null) { this.stepper.selectedIndex = 2; }
|
|
|
|
|
});
|
|
|
|
|
this.route.params
|
|
|
|
|
.pipe(takeUntil(this._destroyed))
|
|
|
|
|
.subscribe((params: Params) => {
|
|
|
|
|
const itemId = params['id'];
|
|
|
|
|
if (itemId != null) { this.stepper.selectedIndex = 2; }
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
searchDmp(query: string): Observable<DataManagementPlanListingModel[]> {
|
|
|
|
@ -257,9 +267,11 @@ export class DatasetWizardComponent implements OnInit, AfterViewInit, IBreadCrum
|
|
|
|
|
datasetProfileRequestItem.criteria = new DatasetProfileCriteria();
|
|
|
|
|
datasetProfileRequestItem.criteria.id = this.formGroup.get('dmp').value.id;
|
|
|
|
|
if (datasetProfileRequestItem.criteria.id) {
|
|
|
|
|
this.datasetWizardService.getAvailableProfiles(datasetProfileRequestItem).subscribe(items => {
|
|
|
|
|
this.availableProfiles = JsonSerializer.fromJSONArray(items, DatasetProfileModel);
|
|
|
|
|
});
|
|
|
|
|
this.datasetWizardService.getAvailableProfiles(datasetProfileRequestItem)
|
|
|
|
|
.pipe(takeUntil(this._destroyed))
|
|
|
|
|
.subscribe(items => {
|
|
|
|
|
this.availableProfiles = JsonSerializer.fromJSONArray(items, DatasetProfileModel);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -270,11 +282,13 @@ export class DatasetWizardComponent implements OnInit, AfterViewInit, IBreadCrum
|
|
|
|
|
getDefinition() {
|
|
|
|
|
if (this.formGroup.invalid) { this.stepper.selectedIndex = 0; return; }
|
|
|
|
|
if (this.isNew) {
|
|
|
|
|
this.datasetWizardService.getDefinition(this.formGroup.get('profile').get('id').value).subscribe(item => {
|
|
|
|
|
this.datasetWizardModel.datasetProfileDefinition = JsonSerializer.fromJSONObject(item, DatasetProfileDefinitionModel);
|
|
|
|
|
this.datasetProfileDefinitionModel = this.datasetWizardModel.datasetProfileDefinition;
|
|
|
|
|
this.formGroup.addControl('datasetProfileDefinition', this.datasetProfileDefinitionModel.buildForm());
|
|
|
|
|
});
|
|
|
|
|
this.datasetWizardService.getDefinition(this.formGroup.get('profile').get('id').value)
|
|
|
|
|
.pipe(takeUntil(this._destroyed))
|
|
|
|
|
.subscribe(item => {
|
|
|
|
|
this.datasetWizardModel.datasetProfileDefinition = JsonSerializer.fromJSONObject(item, DatasetProfileDefinitionModel);
|
|
|
|
|
this.datasetProfileDefinitionModel = this.datasetWizardModel.datasetProfileDefinition;
|
|
|
|
|
this.formGroup.addControl('datasetProfileDefinition', this.datasetProfileDefinitionModel.buildForm());
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -289,23 +303,29 @@ export class DatasetWizardComponent implements OnInit, AfterViewInit, IBreadCrum
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onSubmit(): void {
|
|
|
|
|
this.datasetWizardService.createDataset(this.formGroup.value).subscribe(
|
|
|
|
|
complete => {
|
|
|
|
|
this.datasetWizardService.getSingle(complete.id).subscribe(
|
|
|
|
|
result => {
|
|
|
|
|
this.datasetWizardModel = JsonSerializer.fromJSONObject(result, DatasetWizardModel);
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
this.onCallbackSuccess();
|
|
|
|
|
},
|
|
|
|
|
error => this.onCallbackError(error)
|
|
|
|
|
);
|
|
|
|
|
this.datasetWizardService.createDataset(this.formGroup.value)
|
|
|
|
|
.pipe(takeUntil(this._destroyed))
|
|
|
|
|
.subscribe(
|
|
|
|
|
complete => {
|
|
|
|
|
this.datasetWizardService.getSingle(complete.id)
|
|
|
|
|
.pipe(takeUntil(this._destroyed))
|
|
|
|
|
.subscribe(
|
|
|
|
|
result => {
|
|
|
|
|
this.datasetWizardModel = JsonSerializer.fromJSONObject(result, DatasetWizardModel);
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
this.onCallbackSuccess();
|
|
|
|
|
},
|
|
|
|
|
error => this.onCallbackError(error)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
submit() {
|
|
|
|
|
this.datasetWizardService.createDataset(this.formGroup.value).subscribe(data => {
|
|
|
|
|
this.router.navigateByUrl('/datasets/dmp/' + this.formGroup.get('dmp').value.id);
|
|
|
|
|
});
|
|
|
|
|
this.datasetWizardService.createDataset(this.formGroup.value)
|
|
|
|
|
.pipe(takeUntil(this._destroyed))
|
|
|
|
|
.subscribe(data => {
|
|
|
|
|
this.router.navigateByUrl('/datasets/dmp/' + this.formGroup.get('dmp').value.id);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -339,21 +359,25 @@ export class DatasetWizardComponent implements OnInit, AfterViewInit, IBreadCrum
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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'));
|
|
|
|
|
this.datasetWizardService.downloadPDF(this.itemId)
|
|
|
|
|
.pipe(takeUntil(this._destroyed))
|
|
|
|
|
.subscribe(response => {
|
|
|
|
|
const blob = new Blob([response.body], { type: 'application/pdf' });
|
|
|
|
|
const filename = this.getFilenameFromContentDispositionHeader(response.headers.get('Content-Disposition'));
|
|
|
|
|
|
|
|
|
|
FileSaver.saveAs(blob, filename);
|
|
|
|
|
});
|
|
|
|
|
FileSaver.saveAs(blob, filename);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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'));
|
|
|
|
|
this.datasetWizardService.downloadXML(this.itemId)
|
|
|
|
|
.pipe(takeUntil(this._destroyed))
|
|
|
|
|
.subscribe(response => {
|
|
|
|
|
const blob = new Blob([response.body], { type: 'application/xml' });
|
|
|
|
|
const filename = this.getFilenameFromContentDispositionHeader(response.headers.get('Content-Disposition'));
|
|
|
|
|
|
|
|
|
|
FileSaver.saveAs(blob, filename);
|
|
|
|
|
});
|
|
|
|
|
FileSaver.saveAs(blob, filename);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getFilenameFromContentDispositionHeader(header: string): string {
|
|
|
|
@ -416,11 +440,13 @@ export class DatasetWizardComponent implements OnInit, AfterViewInit, IBreadCrum
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
dialogRef.afterClosed().subscribe(result => {
|
|
|
|
|
if (!result) { return; }
|
|
|
|
|
const dataRepositoryModel = new DataRepositoryModel(result.id, result.label, result.pid, result.uri, result.reference);
|
|
|
|
|
(<FormArray>this.formGroup.get('dataRepositories')).push(dataRepositoryModel.buildForm());
|
|
|
|
|
});
|
|
|
|
|
dialogRef.afterClosed()
|
|
|
|
|
.pipe(takeUntil(this._destroyed))
|
|
|
|
|
.subscribe(result => {
|
|
|
|
|
if (!result) { return; }
|
|
|
|
|
const dataRepositoryModel = new DataRepositoryModel(result.id, result.label, result.pid, result.uri, result.reference);
|
|
|
|
|
(<FormArray>this.formGroup.get('dataRepositories')).push(dataRepositoryModel.buildForm());
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
addRegistry() {
|
|
|
|
@ -431,11 +457,13 @@ export class DatasetWizardComponent implements OnInit, AfterViewInit, IBreadCrum
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
dialogRef.afterClosed().subscribe(result => {
|
|
|
|
|
if (!result) { return; }
|
|
|
|
|
const registryModel = new RegisterModel(result.abbreviation, result.definition, result.id, result.label, result.reference, result.uri);
|
|
|
|
|
(<FormArray>this.formGroup.get('registries')).push(registryModel.buildForm());
|
|
|
|
|
});
|
|
|
|
|
dialogRef.afterClosed()
|
|
|
|
|
.pipe(takeUntil(this._destroyed))
|
|
|
|
|
.subscribe(result => {
|
|
|
|
|
if (!result) { return; }
|
|
|
|
|
const registryModel = new RegisterModel(result.abbreviation, result.definition, result.id, result.label, result.reference, result.uri);
|
|
|
|
|
(<FormArray>this.formGroup.get('registries')).push(registryModel.buildForm());
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
addExternalDataset() {
|
|
|
|
@ -446,11 +474,13 @@ export class DatasetWizardComponent implements OnInit, AfterViewInit, IBreadCrum
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
dialogRef.afterClosed().subscribe(result => {
|
|
|
|
|
if (!result) { return; }
|
|
|
|
|
const externalDatasetModel = new ExternalDatasetModel(result.id, result.abbreviation, result.label, result.reference);
|
|
|
|
|
(<FormArray>this.formGroup.get('externalDatasets')).push(externalDatasetModel.buildForm());
|
|
|
|
|
});
|
|
|
|
|
dialogRef.afterClosed()
|
|
|
|
|
.pipe(takeUntil(this._destroyed))
|
|
|
|
|
.subscribe(result => {
|
|
|
|
|
if (!result) { return; }
|
|
|
|
|
const externalDatasetModel = new ExternalDatasetModel(result.id, result.abbreviation, result.label, result.reference);
|
|
|
|
|
(<FormArray>this.formGroup.get('externalDatasets')).push(externalDatasetModel.buildForm());
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
addService() {
|
|
|
|
@ -461,11 +491,13 @@ export class DatasetWizardComponent implements OnInit, AfterViewInit, IBreadCrum
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
dialogRef.afterClosed().subscribe(result => {
|
|
|
|
|
if (!result) { return; }
|
|
|
|
|
const serviceModel = new ServiceModel(result.id, result.abbreviation, result.definition, result.uri, result.label, result.reference);
|
|
|
|
|
(<FormArray>this.formGroup.get('services')).push(serviceModel.buildForm());
|
|
|
|
|
});
|
|
|
|
|
dialogRef.afterClosed()
|
|
|
|
|
.pipe(takeUntil(this._destroyed))
|
|
|
|
|
.subscribe(result => {
|
|
|
|
|
if (!result) { return; }
|
|
|
|
|
const serviceModel = new ServiceModel(result.id, result.abbreviation, result.definition, result.uri, result.label, result.reference);
|
|
|
|
|
(<FormArray>this.formGroup.get('services')).push(serviceModel.buildForm());
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public enableForm() {
|
|
|
|
@ -474,13 +506,15 @@ export class DatasetWizardComponent implements OnInit, AfterViewInit, IBreadCrum
|
|
|
|
|
this.viewOnly = false;
|
|
|
|
|
this.formGroup.enable();
|
|
|
|
|
} else {
|
|
|
|
|
this.datasetWizardService.unlock(this.formGroup.get('id').value).subscribe(x => {
|
|
|
|
|
this.editMode = true;
|
|
|
|
|
this.viewOnly = false;
|
|
|
|
|
this.datasetWizardModel.status = DatasetStatus.Draft;
|
|
|
|
|
this.formGroup.get('status').patchValue(DatasetStatus.Draft);
|
|
|
|
|
this.formGroup.enable();
|
|
|
|
|
});
|
|
|
|
|
this.datasetWizardService.unlock(this.formGroup.get('id').value)
|
|
|
|
|
.pipe(takeUntil(this._destroyed))
|
|
|
|
|
.subscribe(x => {
|
|
|
|
|
this.editMode = true;
|
|
|
|
|
this.viewOnly = false;
|
|
|
|
|
this.datasetWizardModel.status = DatasetStatus.Draft;
|
|
|
|
|
this.formGroup.get('status').patchValue(DatasetStatus.Draft);
|
|
|
|
|
this.formGroup.enable();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|