Changes on dataset comp

This commit is contained in:
Nikolaos Laskaris 2017-11-07 12:13:54 +02:00
parent b4fb82d5f4
commit ab0faf998a
2 changed files with 14 additions and 44 deletions

View File

@ -73,15 +73,7 @@ export class DatasetsComponent implements OnInit {
private route: ActivatedRoute,
private router: Router,
private ngZone: NgZone) {
this.dataset = {
id: null,
label: '',
reference: '',
uri: '',
properties: '',
profile: { "id": '' },
dmp: { "id": '' }
}
this.dataset = this.createEmptyDataset();
this.datasetProfileDropDown = new DropdownField();
this.datasetProfileDropDown.options = [];
@ -114,6 +106,17 @@ export class DatasetsComponent implements OnInit {
)
}
createEmptyDataset(){
return {
id: null,
label: '',
reference: '',
uri: '',
properties: '',
profile: { "id": '' },
dmp: { "id": '' }
}
}
SaveDataset(){
if(this.dataset.id ==null){
@ -180,10 +183,9 @@ export class DatasetsComponent implements OnInit {
}
newDataset() {
this.dataset.label = "";
this.dataset.uri = "";
this.dataset = this.createEmptyDataset();
this.dataset.dmp =this.dmpLabelforDatasets;
this.dataset.profile = "";
this.dataset.status = 0;
$("#newDatasetModal").modal("show");
}

View File

@ -1,32 +0,0 @@
/*
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
//import {DataTableModule } from 'angular-4-data-table-bootstrap-4';
import {DataTableModule} from 'angular2-datatable';
import { DmpComponent } from './dmp.component';
import { DmpTableFilterPipe } from '../pipes/dmp-table-filter.pipe';
import { DmpVersionFilterPipe } from '../pipes/dmp-version-filter.pipe';
import { DmpRoutingModule } from './dmp-routing.module';
import { DatasetsModule } from '../datasets/dataset.module';
@NgModule({
imports: [
CommonModule,
FormsModule,
DmpRoutingModule,
DataTableModule,
DatasetsModule
],
declarations: [
DmpTableFilterPipe,
DmpVersionFilterPipe,
DmpComponent
],
providers: [ ]
})
export class DmpModule {}
*/