diff --git a/dmp-frontend/.angular-cli.json b/dmp-frontend/.angular-cli.json
index 9e16abc32..fa49c8f03 100644
--- a/dmp-frontend/.angular-cli.json
+++ b/dmp-frontend/.angular-cli.json
@@ -25,7 +25,8 @@
"scripts": [
"./../node_modules/jquery/dist/jquery.min.js",
"./../node_modules/bootstrap/dist/js/bootstrap.min.js",
- "./assets/xml2json.min.js"
+ "./assets/xml2json.min.js",
+ "./assets/jquery.scrollTo.min.js"
],
"environmentSource": "environments/environment.ts",
"environments": {
diff --git a/dmp-frontend/package-lock.json b/dmp-frontend/package-lock.json
index d4ec05e5d..68c51283c 100644
--- a/dmp-frontend/package-lock.json
+++ b/dmp-frontend/package-lock.json
@@ -248,9 +248,9 @@
}
},
"@types/node": {
- "version": "6.0.88",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-6.0.88.tgz",
- "integrity": "sha512-bYDPZTX0/s1aihdjLuAgogUAT5M+TpoWChEMea2p0yOcfn5bu3k6cJb9cp6nw268XeSNIGGr+4+/8V5K6BGzLQ=="
+ "version": "6.0.90",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-6.0.90.tgz",
+ "integrity": "sha512-tXoGRVdi7wZX7P1VWoV9Wfk0uYDOAHdEYXAttuWgSrN76Q32wQlSrMX0Rgyv3RTEaQY2ZLQrzYHVM2e8rfo8sA=="
},
"@types/q": {
"version": "0.0.32",
@@ -581,6 +581,21 @@
"typescript": "2.3.4"
}
},
+<<<<<<< HEAD
+ "angular2-draggable": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/angular2-draggable/-/angular2-draggable-1.0.7.tgz",
+ "integrity": "sha1-NeH4HIzPPdljDyMmVYuILMEvDyk="
+=======
+ "angular2-datatable": {
+ "version": "0.6.0",
+ "resolved": "https://registry.npmjs.org/angular2-datatable/-/angular2-datatable-0.6.0.tgz",
+ "integrity": "sha1-ygCPdAh/DLh9pXCe0vLR0GF3JjI=",
+ "requires": {
+ "lodash": "4.17.4"
+ }
+>>>>>>> 573e1fd92cc726405b415b5214ed96fa1a0ce420
+ },
"ansi-escapes": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-2.0.0.tgz",
@@ -3174,6 +3189,14 @@
"pinkie-promise": "2.0.1"
}
},
+ "flat": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/flat/-/flat-4.0.0.tgz",
+ "integrity": "sha512-ji/WMv2jdsE+LaznpkIF9Haax0sdpTBozrz/Dtg4qSRMfbs8oVg4ypJunIRYPiMLvH/ed6OflXbnbTIKJhtgeg==",
+ "requires": {
+ "is-buffer": "1.1.5"
+ }
+ },
"flatten": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/flatten/-/flatten-1.0.2.tgz",
@@ -4095,8 +4118,7 @@
"is-buffer": {
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz",
- "integrity": "sha1-Hzsm72E7IUuIy8ojzGwB2Hlh7sw=",
- "dev": true
+ "integrity": "sha1-Hzsm72E7IUuIy8ojzGwB2Hlh7sw="
},
"is-builtin-module": {
"version": "1.0.0",
@@ -4900,8 +4922,7 @@
"lodash": {
"version": "4.17.4",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz",
- "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=",
- "dev": true
+ "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4="
},
"lodash._arraycopy": {
"version": "3.0.0",
@@ -5934,7 +5955,7 @@
"resolved": "https://registry.npmjs.org/parse5/-/parse5-3.0.2.tgz",
"integrity": "sha1-Be/1fw70V3+xRKefi5qWemzERRA=",
"requires": {
- "@types/node": "6.0.88"
+ "@types/node": "6.0.90"
}
},
"parsejson": {
@@ -6670,7 +6691,7 @@
"integrity": "sha1-myIXQXCaTGLVzVPGqt1UpxE36V8=",
"dev": true,
"requires": {
- "@types/node": "6.0.88",
+ "@types/node": "6.0.90",
"@types/q": "0.0.32",
"@types/selenium-webdriver": "2.53.42",
"blocking-proxy": "0.0.5",
diff --git a/dmp-frontend/package.json b/dmp-frontend/package.json
index 46f4eb9c6..5f2527d94 100644
--- a/dmp-frontend/package.json
+++ b/dmp-frontend/package.json
@@ -24,8 +24,14 @@
"angular-2-data-table": "^0.1.2",
"angular-4-data-table-bootstrap-4": "^0.2.0",
"angular-google-signin": "^0.1.5",
+<<<<<<< HEAD
+ "angular2-draggable": "^1.0.7",
+=======
+ "angular2-datatable": "^0.6.0",
+>>>>>>> 573e1fd92cc726405b415b5214ed96fa1a0ce420
"bootstrap": "^3.3.7",
"core-js": "^2.4.1",
+ "flat": "^4.0.0",
"jquery": "^3.2.1",
"ngx-webstorage": "^1.8.0",
"rxjs": "^5.4.2",
@@ -37,7 +43,7 @@
"@angular/language-service": "^4.3.6",
"@types/jasmine": "~2.5.53",
"@types/jasminewd2": "~2.0.2",
- "@types/node": "^6.0.88",
+ "@types/node": "^6.0.90",
"angular-ide": "^0.9.31",
"codelyzer": "~3.1.1",
"jasmine-core": "~2.6.2",
diff --git a/dmp-frontend/src/app/app.module.ts b/dmp-frontend/src/app/app.module.ts
index 5e2e28c5a..2d7b67aee 100644
--- a/dmp-frontend/src/app/app.module.ts
+++ b/dmp-frontend/src/app/app.module.ts
@@ -4,7 +4,10 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { HttpClientModule } from '@angular/common/http';
import { HttpModule } from '@angular/http';
import { RouterModule, Routes, Router } from '@angular/router';
-import {DataTableModule } from 'angular-4-data-table-bootstrap-4';
+//import {DataTableModule } from 'angular-4-data-table-bootstrap-4';
+import { DataTableModule } from "angular2-datatable";
+
+//import { OrganisationTableFilterPipe } from './pipes/organisation-table-filter.pipe';
import { AppComponent } from './app.component';
import { RestBase } from './services/rest-base';
@@ -28,6 +31,8 @@ import { GlobalInterceptor } from './services/interceptor';
import { DatasetsModule } from './datasets/dataset.module';
import { DmpModule } from './dmps/dmp.module';
import { TabModule } from './tabs/tab.module';
+import { AngularDraggableModule } from 'angular2-draggable';
+
import { HTTP_INTERCEPTORS } from '@angular/common/http';
@@ -53,15 +58,15 @@ import { HTTP_INTERCEPTORS } from '@angular/common/http';
DmpModule,
DatasetsModule,
AppRoutingModule,
+ AngularDraggableModule,
DataTableModule
],
- providers: [
- // {
- // provide: HTTP_INTERCEPTORS,
- // useClass: GlobalInterceptor,
- // multi: true,
- // },
+ providers: [{
+ provide: HTTP_INTERCEPTORS,
+ useClass: GlobalInterceptor,
+ multi: true,
+ },
ServerService, dataModelBuilder, AuthGuard, PaginationService, TokenService, LocalStorageService, RestBase, EestoreService
],
bootstrap: [AppComponent]
diff --git a/dmp-frontend/src/app/datasets/dataset.component.css b/dmp-frontend/src/app/datasets/dataset.component.css
new file mode 100644
index 000000000..7b60f54c0
--- /dev/null
+++ b/dmp-frontend/src/app/datasets/dataset.component.css
@@ -0,0 +1,39 @@
+.invisible {
+ display:none;
+}
+
+.visible {
+ display:block;
+}
+
+tr.hover:hover > * {
+ background-color: #eeeeee;
+}
+
+.editor-container{
+ padding-top: 10px;
+ padding-right: 10px;
+ padding-bottom: 10px;
+ padding-left: 10px;
+}
+
+.button-150px {
+ max-width: 150px;
+}
+
+.ng-template{
+ text-align: right;
+}
+
+.grayout-empty-table {
+ opacity: 0.6; /* Real browsers */
+ filter: alpha(opacity = 60); /* MSIE */
+ text-align: center;
+ vertical-align: middle;
+}
+
+.btncustom{
+ background-color:#337ab7;
+ color:white;
+ margin-top:15px;
+}
\ No newline at end of file
diff --git a/dmp-frontend/src/app/datasets/dataset.component.ts b/dmp-frontend/src/app/datasets/dataset.component.ts
index 2bb5d26b8..e700b37a2 100644
--- a/dmp-frontend/src/app/datasets/dataset.component.ts
+++ b/dmp-frontend/src/app/datasets/dataset.component.ts
@@ -5,7 +5,8 @@ import { ServerService } from '../../app/services/server.service';
import { Project } from '../entities/model/project';
import { Dataset } from '../entities/model/dataset';
import { Dmp } from '../entities/model/dmp';
-import { DataTable, DataTableTranslations, DataTableResource } from 'angular-4-data-table-bootstrap-4';
+//import { DataTable, DataTableTranslations, DataTableResource } from 'angular-4-data-table-bootstrap-4';
+import {DataTable} from 'angular2-datatable';
import { DropdownField } from '../../app/form/fields/dropdown/field-dropdown';
import { Param } from '../entities/model/param';
@@ -14,32 +15,40 @@ declare var $: any;
@Component({
selector: 'datasets-table',
templateUrl: 'dataset.html',
- // template: `
- //
Projects
-
- //
-
- //
- // `,
+ styleUrls: ['./dataset.component.css'],
providers: [ServerService]
})
export class DatasetsComponent implements OnInit {
+ // Start ALTERNATIVE
+ //whole dmp data model
+ tableData : any[] = new Array();
+
+ //organisation editor data model
+ editingOrganisation: any = {};
+ organisationEditorForm : any;
+
+ //required by the table
+ public filterQuery = "";
+ public rowsOnPage = 10;
+ //public sortBy = "email";
+ public sortOrder = "asc";
+
+ //visibility rules for containers
+ tableVisible: boolean = true;
+ editorVisible: boolean = false;
+
+
+ // for tableIds
+ showIDs : boolean = false;
+// END ALTERNATIVE
+
returnUrl: string;
@Input() datasets: Dataset[];
@Input() datasetProfileDropDown: DropdownField;
- datasetResource: DataTableResource;
@Input() datasetCount = 0;
@Input() dmpIdforDatasets: string;
- @Input() dmpLabelforDatasets: string;
dataset: any;
//@ViewChild(DataTable) projectsTable;
@@ -80,9 +89,10 @@ export class DatasetsComponent implements OnInit {
ngOnInit() {
//this.projects = this.serverService.getDummyProjects();
this.datasets = [];
- console.log(this.dmpIdforDatasets);
+ console.log(this.dmpIdforDatasets);debugger;
this.serverService.getDatasetForDmp({ "id": this.dmpIdforDatasets }).subscribe(
response => {
+<<<<<<< HEAD
console.log("response");
console.log(response);
@@ -92,7 +102,7 @@ export class DatasetsComponent implements OnInit {
dt.id = resp.id;
dt.name = resp.label;
dt.uriDataset = resp.uri;
- dt.dmp = this.dmpLabelforDatasets; //to pairnw apo to datatable tou dmp
+ dt.dmp = resp.dmp.label;
dt.profile = resp.profile.label;
dt.profileId = resp.profile.id;
this.datasets.push(dt);
@@ -100,6 +110,9 @@ export class DatasetsComponent implements OnInit {
this.afterLoad();
this.datasetResource.query(params).then(datasets => this.datasets = datasets);
});
+=======
+ this.tableData = response;
+>>>>>>> 573e1fd92cc726405b415b5214ed96fa1a0ce420
}
);
@@ -119,8 +132,9 @@ export class DatasetsComponent implements OnInit {
)
}
+<<<<<<< HEAD
reloadDatasets(params) {
- // this.datasetResource = new DataTableResource(this.datasets);
+ this.datasetResource = new DataTableResource(this.datasets);
this.datasetResource.query(params).then(datasets => this.datasets = datasets);
}
@@ -129,11 +143,14 @@ export class DatasetsComponent implements OnInit {
this.datasetResource.count().then(count => this.datasetCount = count);
}
+ selectDataset(item) {debugger;
+=======
selectDataset(item) {
+>>>>>>> 573e1fd92cc726405b415b5214ed96fa1a0ce420
this.ngZone.run(() => this.router.navigate(['dynamic-form', {id: item.profileId, datasetId:item.id, datasetProperties:item.properties}]));
}
- SaveNewDataset() {
+ SaveNewDataset() {
this.dataset.dmp = { "id": this.dmpIdforDatasets }
this.dataset.profile = { "id": this.dataset.profile }
this.serverService.createDatasetForDmp(this.dataset).subscribe(
@@ -143,54 +160,25 @@ export class DatasetsComponent implements OnInit {
}
)
$("#newDatasetModal").modal("hide");
- this.CallDatasets();
- }
-
- SaveEditedDataset(){
- this.dataset.dmp = { "id": this.dmpIdforDatasets }
- this.dataset.profile = { "id": this.dataset.profile }
- this.serverService.updateDatsetsProfile(this.dataset).subscribe(
- response => {
- console.log(response);
-
- }
- )
- $("#newDatasetModal").modal("hide");
- this.CallDatasets();
- }
-
- SaveDataset(){debugger;
- if(this.dataset.id ==null)
- this.SaveNewDataset();
- else
- this.SaveEditedDataset();
- }
-
- CallDatasets(){
this.serverService.getDatasetForDmp({ "id": this.dmpIdforDatasets }).subscribe(
response => {
-
+
console.log("response");
console.log(response);
this.datasets = [];
response.forEach(resp => {
-
+
let dt = new Dataset();
dt.id = resp.id;
dt.name = resp.label;
dt.uriDataset = resp.uri;
- dt.dmp = resp.dmp.label;
- dt.profile = resp.profile.label;
- dt.profileId = resp.profile.id;
this.datasets.push(dt);
- var params = { limit: 8, offset: 0, sortAsc: false }
- this.afterLoad();
- this.datasetResource.query(params).then(datasets => this.datasets = datasets);
});
}
);
}
-
+<<<<<<< HEAD
+
// special params:
translations = {
indexColumn: 'Index column',
@@ -199,6 +187,9 @@ export class DatasetsComponent implements OnInit {
paginationLimit: 'Max results',
paginationRange: 'Result range'
};
+=======
+
+>>>>>>> 573e1fd92cc726405b415b5214ed96fa1a0ce420
getDatasetForDmpMethod(dmpid) {
this.serverService.getDatasetForDmp({ "id": dmpid }).subscribe(
@@ -214,20 +205,16 @@ export class DatasetsComponent implements OnInit {
dt.name = resp.label;
dt.uriDataset = resp.uri;
this.datasets.push(dt);
- var params = { limit: 8, offset: 0, sortAsc: false }
- this.afterLoad();
- this.datasetResource.query(params).then(datasets => this.datasets = datasets);
});
}
);
}
- editRow(item) { debugger;
- this.dataset.label = item.name;
+ editRow(item) {
+ this.dataset.label = item.label;
this.dataset.uri = item.uriDataset;
this.dataset.dmp = item.dmp;
this.dataset.profile = item.profileId;
- this.dataset.id = item.id;
$("#newDatasetModal").modal("show");
}
diff --git a/dmp-frontend/src/app/datasets/dataset.html b/dmp-frontend/src/app/datasets/dataset.html
index 7d9ef8edd..8119957f2 100644
--- a/dmp-frontend/src/app/datasets/dataset.html
+++ b/dmp-frontend/src/app/datasets/dataset.html
@@ -1,6 +1,7 @@
+<<<<<<< HEAD
@@ -26,7 +27,7 @@
Edit
-
+
@@ -38,12 +39,85 @@
+=======
+
+
+
+
+
+
+>>>>>>> 573e1fd92cc726405b415b5214ed96fa1a0ce420
diff --git a/dmp-frontend/src/app/datasets/dataset.module.ts b/dmp-frontend/src/app/datasets/dataset.module.ts
index 3ac3b0f5f..331b28929 100644
--- a/dmp-frontend/src/app/datasets/dataset.module.ts
+++ b/dmp-frontend/src/app/datasets/dataset.module.ts
@@ -1,7 +1,8 @@
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 { DatasetTableFilterPipe } from '../pipes/dataset-table-filter.pipe';
import { DatasetsComponent } from './dataset.component';
@@ -16,7 +17,8 @@ import { DatasetRoutingModule } from './dataset-routing.module';
DataTableModule
],
declarations: [
- DatasetsComponent
+ DatasetsComponent,
+ DatasetTableFilterPipe
//ProjectDetailComponent
],
providers: [ ],
diff --git a/dmp-frontend/src/app/dmps/dmp.component.css b/dmp-frontend/src/app/dmps/dmp.component.css
new file mode 100644
index 000000000..7b60f54c0
--- /dev/null
+++ b/dmp-frontend/src/app/dmps/dmp.component.css
@@ -0,0 +1,39 @@
+.invisible {
+ display:none;
+}
+
+.visible {
+ display:block;
+}
+
+tr.hover:hover > * {
+ background-color: #eeeeee;
+}
+
+.editor-container{
+ padding-top: 10px;
+ padding-right: 10px;
+ padding-bottom: 10px;
+ padding-left: 10px;
+}
+
+.button-150px {
+ max-width: 150px;
+}
+
+.ng-template{
+ text-align: right;
+}
+
+.grayout-empty-table {
+ opacity: 0.6; /* Real browsers */
+ filter: alpha(opacity = 60); /* MSIE */
+ text-align: center;
+ vertical-align: middle;
+}
+
+.btncustom{
+ background-color:#337ab7;
+ color:white;
+ margin-top:15px;
+}
\ No newline at end of file
diff --git a/dmp-frontend/src/app/dmps/dmp.component.ts b/dmp-frontend/src/app/dmps/dmp.component.ts
index 495df576c..7d1458cd0 100644
--- a/dmp-frontend/src/app/dmps/dmp.component.ts
+++ b/dmp-frontend/src/app/dmps/dmp.component.ts
@@ -5,7 +5,8 @@ import { ServerService } from '../../app/services/server.service';
import { Dmp } from '../entities/model/dmp';
import { Dataset } from '../entities/model/dataset';
import { Project } from '../entities/model/project';
-import { DataTable, DataTableTranslations, DataTableResource } from 'angular-4-data-table-bootstrap-4';
+//import { DataTable, DataTableTranslations, DataTableResource } from 'angular-4-data-table-bootstrap-4';
+import {DataTable} from 'angular2-datatable';
import { DropdownField } from '../../app/form/fields/dropdown/field-dropdown';
import { Param } from '../entities/model/param';
import { ModalComponent } from '../modal/modal.component';
@@ -19,41 +20,71 @@ declare var $ :any;
@Component({
selector: 'dmps',
templateUrl: 'dmps.html',
+ styleUrls: ['./dmp.component.css'],
providers: [ServerService]
})
export class DmpComponent implements OnInit{
+
+// Start ALTERNATIVE
+ //whole dmp data model
+ tableData : any[] = new Array();
+
+ //organisation editor data model
+ editingOrganisation: any = {};
+ organisationEditorForm : any;
+
+ //required by the table
+ public filterQuery = "";
+ public rowsOnPage = 10;
+ //public sortBy = "email";
+ public sortOrder = "asc";
+
+ //visibility rules for containers
+ tableVisible: boolean = true;
+ editorVisible: boolean = false;
+
+
+ // for tableIds
+ showIDs : boolean = false;
+// END ALTERNATIVE
+
+
+
+
@Input() dmps: Dmp[];
dmp:any;
- dmpResource :DataTableResource
;
- dmpIdforDatasets: string;
- dmpLabelforDatasets:string;
@Input() dmpCount = 0;
@Input() projectsDropDown:DropdownField;
@Input() dataSetVisibe:boolean;
- @Input() projects: Project[];
-
-
+ @Input() projects: Project[];
+ dmpIdforDatasets: string;
+ dmpLabelforDatasets:string;
+ @ViewChild(DatasetsComponent) datasetsComponent:DatasetsComponent;
+ /*dmpResource :DataTableResource;
+
@ViewChild(DataTable) dmpsTable;
@ViewChild(DataTable) datasetsTable;
- @ViewChild(DatasetsComponent) datasetsComponent:DatasetsComponent;
- @ViewChild('isignOutBtn') isignOutBtn;
+
+ */
+ @ViewChild('isignOutBtn') isignOutBtn;
constructor(
private serverService: ServerService,
private route: ActivatedRoute,
private router: Router){
this.projectsDropDown = new DropdownField();
this.projectsDropDown.options = [];
- this.projects = [];
+ //this.projects = [];
this.dataSetVisibe = false;
this.dmp = {
+ id:null,
label: '',
- //previous:'',
+ previous:'',
version:'',
profileData:'',
- //profile:''
- }
+ profile:''
+ }
}
ngOnInit() {
@@ -63,26 +94,27 @@ export class DmpComponent implements OnInit{
});
this.dmps = [];
this.serverService.getDmpOfUser().subscribe(
- response => {
+ response => {
+ this.tableData = response;
console.log(response);
response.forEach(resp => {
- let dmp = new Dmp();
- dmp.id = resp.id;
- dmp.label = resp.label;
- dmp.version = resp.version;
- dmp.dataset = resp.dataset;
- dmp.projectLabel = resp.project.label;
- dmp.projectid = resp.project.id;
- dmp.previous = resp.previous;
- dmp.profile = resp.profile;
- dmp.profileData = resp.profileData;
- this.dmps.push(dmp);
- var params = {limit:8,offset:0, sortAsc:false}
- this.afterLoad();
- this.dmpResource.query(params).then(dmps => this.dmps = dmps);
+ // let dmp = new Dmp();
+ // dmp.id = resp.id;
+ // dmp.label = resp.label;
+ // dmp.version = resp.version;
+ // dmp.dataset = resp.dataset;
+ // dmp.projectLabel = resp.project.label;
+ // dmp.projectid = resp.project.id;
+ // dmp.previous = resp.previous;
+ // dmp.profile = resp.profile;
+ // dmp.profileData = resp.profileData;
+ // this.dmps.push(dmp);
+ // var params = {limit:8,offset:0, sortAsc:false}
+ //this.afterLoad();
+ //this.dmpResource.query(params).then(dmps => this.dmps = dmps);
}
);
- (err: HttpErrorResponse) => {debugger;
+ (err: HttpErrorResponse) => {
if (err.error instanceof Error) {
// A client-side or network error occurred. Handle it accordingly.
console.log('An error occurred:', err.error.message);
@@ -113,37 +145,28 @@ export class DmpComponent implements OnInit{
)
}
-reloadDmps(params) {
- //this.dmpResource = new DataTableResource(this.dmps);
- this.dmpResource.query(params).then(projects => this.dmps = projects);
-}
-afterLoad(){
- this.dmpResource = new DataTableResource(this.dmps);
- this.dmpResource.count().then(count => this.dmpCount = count);
+CallDmps(){
+ this.serverService.getDmpOfUser().subscribe(
+ response => {
+ response.forEach(resp => {
+ let dmp = new Dmp();
+ dmp.id = resp.id;
+ dmp.label = resp.label;
+ dmp.version = resp.version;
+ dmp.dataset = resp.dataset;
+ dmp.projectLabel = resp.project.label;
+ this.dmps.push(dmp);
+ var params = {limit:8,offset:0, sortAsc:false}
+ //this.afterLoad();
+ //this.dmpResource.query(params).then(dmps => this.dmps = dmps);
+ }
+ );
+ });
}
-filterGrid() {
- var input, filter, table, tr, td, i;
- input = document.getElementById("myInput");
- filter = input.value.toUpperCase();
- table = document.getElementById("dmps-grid");
- tr = table.getElementsByTagName("tr");
- for (i = 0; i < tr.length; i++) {
- td = tr[i].getElementsByTagName("td")[4];
- if (td) {
- if (td.innerText.toUpperCase().indexOf(filter) > -1) {
- tr[i].style.display = "";
- } else {
- tr[i].style.display = "none";
- }
- }
- }
-}
-
-
SaveNewDmp(){
- console.log(this.dmp, this.dmp.projectsDropDownKey);
+ console.log(this.dmp, this.dmp.projectsDropDownKey); debugger;
//this.http.post('http://someurl', JSON.stringify(this.project))
this.dmp.project = {"id":this.dmp.project};
@@ -155,71 +178,92 @@ SaveNewDmp(){
console.log("response");
console.log(response);
this.dmps = [];
- this.serverService.getDmpOfUser().subscribe(
- response => {
- response.forEach(resp => {
- let dmp = new Dmp();
- dmp.id = resp.id;
- dmp.label = resp.label;
- dmp.version = resp.version;
- dmp.dataset = resp.dataset;
- dmp.projectLabel = resp.project.label;
- this.dmps.push(dmp);
- var params = {limit:8,offset:0, sortAsc:false}
- this.afterLoad();
- this.dmpResource.query(params).then(dmps => this.dmps = dmps);
- }
- );
- });
+ this.CallDmps();
}
);
-
$("#newDmpModal").modal("hide");
}
- // special params:
- translations = {
- indexColumn: 'Index column',
- expandColumn: 'Expand column',
- selectColumn: 'Select column',
- paginationLimit: 'Max results',
- paginationRange: 'Result range'
-};
+SaveUpdatesDmp(){
+ console.log(this.dmp, this.dmp.projectsDropDownKey);
+ //this.http.post('http://someurl', JSON.stringify(this.project))
+
+ this.dmp.project = {"id":this.dmp.project};
+ this.dmp["version"] = 1;
+
+ this.serverService.updateDmpForCurrentUser(this.dmp)
+ .subscribe(
+ response =>{
+ console.log("response");
+ console.log(response);
+ this.dmps = [];
+ this.CallDmps();
+ }
+ );
+ $("#newDmpModal").modal("hide");
+}
+
+SaveDmp(){ debugger;
+ if (this.dmp.id == null)
+ this.SaveNewDmp();
+ else
+ this.SaveUpdatesDmp();
+}
signOut() {
this.serverService.logOut();
}
-selectDmp(rowEvent){
- this.dmpIdforDatasets = rowEvent.row.item.id;
- this.dmpLabelforDatasets = rowEvent.row.item.label;
+selectDmp(item){
+ this.dmpIdforDatasets = item.id;
+ this.dmpLabelforDatasets = item.label;
if(this.dataSetVisibe == false)
this.dataSetVisibe = true;
else
- this.datasetsComponent.getDatasetForDmpMethod(rowEvent.row.item.id);
+ this.datasetsComponent.getDatasetForDmpMethod(item.id);
}
-editRow(item){
- this.dmp.label = item.label;
- this.dmp.previous = item.previous;
- this.dmp.version = item.version;
- this.dmp.profile = item.profile;
- this.dmp.profileData = item.profileData;
- this.dmp.id = item.id;
- this.dmp.project = item.projectid;
- this.dmp.projectid = item.projectid;
- $("#newDmpModal").modal("show");
+editRow(item, event){
+ if (event.toElement.id == "editDMP"){
+ this.dmp.label = item.label;
+ this.dmp.previous = item.previous;
+ this.dmp.version = item.version;
+ this.dmp.profile = item.profile;
+ this.dmp.profileData = item.profileData;
+ this.dmp.id = item.id;
+ this.dmp.project = item.project.id;
+ $("#newDmpModal").modal("show");
+ }
+ if(event.toElement.id == "changeVersionDMP"){
+ this.dmp.label = item.label;
+ this.dmp.previous = item.previous;
+ this.dmp.version = item.version;
+ this.dmp.profile = item.profile;
+ this.dmp.profileData = item.profileData;
+ this.dmp.id = item.id;
+ this.dmp.project = item.project.id;
+ $("#newVersionDmpModal").modal("show");
+ }
+
+ if(event.toElement.id == "showDatasets"){
+ this.selectDmp(item);
+
+ }
+
}
newDmp(item){
this.dmp.label = "";
- //this.dmp.previous = "";
+ this.dmp.previous = "";
this.dmp.version = "";
- // this.dmp.profile = "";
+ this.dmp.profile = "";
this.dmp.profileData = "";
this.dmp.project = "";
$("#newDmpModal").modal("show");
}
+refreshTable(){
+ this.CallDmps();
+}
}
diff --git a/dmp-frontend/src/app/dmps/dmp.module.ts b/dmp-frontend/src/app/dmps/dmp.module.ts
index 704ced605..8c27edce2 100644
--- a/dmp-frontend/src/app/dmps/dmp.module.ts
+++ b/dmp-frontend/src/app/dmps/dmp.module.ts
@@ -1,10 +1,13 @@
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 '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';
@@ -17,6 +20,8 @@ import { DatasetsModule } from '../datasets/dataset.module';
DatasetsModule
],
declarations: [
+ DmpTableFilterPipe,
+ DmpVersionFilterPipe,
DmpComponent
],
providers: [ ]
diff --git a/dmp-frontend/src/app/dmps/dmps.html b/dmp-frontend/src/app/dmps/dmps.html
index 9bcf850b9..bca27c6e2 100644
--- a/dmp-frontend/src/app/dmps/dmps.html
+++ b/dmp-frontend/src/app/dmps/dmps.html
@@ -1,67 +1,81 @@
-
-
- Filter:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Active
-
-
-
-
-
-
-
-
-
-
- Actions
-
-
-
-
-
-
-
-
- Selected:
-
-
-
New Dmp
-
+
+
+
+
+
+
+
-
+
-
Sign out
+
Sign out
\ No newline at end of file
diff --git a/dmp-frontend/src/app/form/dynamic-form.component.html b/dmp-frontend/src/app/form/dynamic-form.component.html
index f9d128b70..b907376e2 100644
--- a/dmp-frontend/src/app/form/dynamic-form.component.html
+++ b/dmp-frontend/src/app/form/dynamic-form.component.html
@@ -36,17 +36,36 @@
Form value: {{ form.value | json }}
-
+
+
+
+
+
Table of contents:
+
+
+
+
+
+
+
+
+
+
+