no message
This commit is contained in:
parent
e4276815a9
commit
81598f35e0
|
@ -1,5 +1,6 @@
|
|||
package eu.eudat.models.datasetwizard;
|
||||
|
||||
import eu.eudat.entities.DMP;
|
||||
import eu.eudat.entities.Dataset;
|
||||
import eu.eudat.models.DataModel;
|
||||
import eu.eudat.models.dataset.DataRepository;
|
||||
|
@ -10,10 +11,7 @@ import eu.eudat.models.dmp.DataManagementPlan;
|
|||
import eu.eudat.models.user.composite.DatasetProfile;
|
||||
import eu.eudat.utilities.builders.DomainModelConverter;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
@ -161,6 +159,7 @@ public class DatasetWizardModel implements DataModel<Dataset> {
|
|||
this.dataRepositories = new DomainModelConverter<eu.eudat.entities.DataRepository, DataRepository>().fromDataModel(entity.getDataRepositories().stream().collect(Collectors.toList()), DataRepository.class);
|
||||
this.services = new DomainModelConverter<eu.eudat.entities.Service, Service>().fromDataModel(entity.getServices().stream().collect(Collectors.toList()), Service.class);
|
||||
this.created = entity.getCreated();
|
||||
this.dmp = new DomainModelConverter<eu.eudat.entities.DMP, DataManagementPlan>().fromDataModel(Arrays.asList(entity.getDmp()), DataManagementPlan.class).get(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { DatasetProfileDefinitionModel } from '../models/DatasetProfileDefinitionModel';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { BaseErrorModel } from '../models/error/BaseErrorModel';
|
||||
import { ActivatedRoute, Router, Params} from '@angular/router';
|
||||
import { ActivatedRoute, Router, Params } from '@angular/router';
|
||||
import { DatasetService } from '../services/dataset/dataset.service';
|
||||
import { DatasetWizardModel } from '../models/datasets/DatasetWizardModel';
|
||||
import { DatasetProfileCriteria } from '../models/criteria/dataset-profile/DatasetProfileCriteria';
|
||||
|
@ -29,9 +29,9 @@ export class DatasetWizardComponent implements AfterViewInit {
|
|||
|
||||
dmpAutoCompleteConfiguration: AutoCompleteConfiguration;
|
||||
datasetProfileAutoCompleteConfiguration: AutoCompleteConfiguration;
|
||||
datasetWizardModel:DatasetWizardModel;
|
||||
datasetWizardModel: DatasetWizardModel;
|
||||
isNew = true;
|
||||
formGroup:FormGroup;
|
||||
formGroup: FormGroup;
|
||||
constructor(
|
||||
private datasetWizardService: DatasetWizardService,
|
||||
private formBuilder: FormBuilder,
|
||||
|
@ -64,20 +64,20 @@ export class DatasetWizardComponent implements AfterViewInit {
|
|||
this.datasetWizardModel = JsonSerializer.fromJSONObject(data, DatasetWizardModel);
|
||||
this.formGroup = this.datasetWizardModel.buildForm();
|
||||
this.datasetProfileAutoCompleteConfiguration = new AutoCompleteConfiguration(this.datasetWizardService.getAvailableProfiles.bind(this.datasetWizardService), datasetProfileRequestItem);
|
||||
this.formGroup.get("dmp").valueChanges.subscribe(change=>{
|
||||
this.datasetProfileAutoCompleteConfiguration.requestItem.criteria.id=change.id
|
||||
}
|
||||
);
|
||||
this.formGroup.get("dmp").valueChanges.subscribe(change => {
|
||||
this.formGroup.get('profile').setValue(null, { emitEvent: false });
|
||||
this.datasetProfileAutoCompleteConfiguration.requestItem.criteria.id = change.id
|
||||
});
|
||||
});
|
||||
} else {
|
||||
this.datasetWizardModel = new DatasetWizardModel();
|
||||
setTimeout(() => {
|
||||
this.formGroup = this.datasetWizardModel.buildForm();
|
||||
this.datasetProfileAutoCompleteConfiguration = new AutoCompleteConfiguration(this.datasetWizardService.getAvailableProfiles.bind(this.datasetWizardService), datasetProfileRequestItem);
|
||||
this.formGroup.get("dmp").valueChanges.subscribe(change=>{
|
||||
this.datasetProfileAutoCompleteConfiguration.requestItem.criteria.id=change.id
|
||||
}
|
||||
);
|
||||
this.formGroup.get("dmp").valueChanges.subscribe(change => {
|
||||
this.formGroup.get('profile').setValue(null, { emitEvent: false });
|
||||
this.datasetProfileAutoCompleteConfiguration.requestItem.criteria.id = change.id
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -125,8 +125,8 @@ export class DatasetWizardComponent implements AfterViewInit {
|
|||
this.datasetWizardService.createDataset(this.formGroup.value).subscribe(
|
||||
complete => {
|
||||
this.datasetWizardService.getSingle(complete.id).subscribe(
|
||||
result=>{
|
||||
this.datasetWizardModel = JsonSerializer.fromJSONObject(result,DatasetWizardModel);
|
||||
result => {
|
||||
this.datasetWizardModel = JsonSerializer.fromJSONObject(result, DatasetWizardModel);
|
||||
}
|
||||
)
|
||||
this.onCallbackSuccess()
|
||||
|
|
|
@ -126,6 +126,8 @@ export class AutocompleteComponent implements OnInit {
|
|||
optionSelected(event: any) {
|
||||
this.hasSelectedItem = true;
|
||||
this.control.setValue(event.option.value, { emitEvent: false });
|
||||
this.filteredItems = [event.option.value];
|
||||
|
||||
//this.selectedDropdownItemChange.emit(event.option.value);
|
||||
//this.form.updateValueAndValidity();
|
||||
//this.options = [event.option.value];
|
||||
|
|
Loading…
Reference in New Issue