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 @@
+======= + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ ID + + Label + + DMP + + Uri + + Profile + + Description + + Actions +
No elements
{{dmp.id}}{{dmp?.label}}{{dmp?.version}}{{dmp?.previous}}{{dmp?.project?.label}}{{dmp?.description}} + +
+ + +
+ + +>>>>>>> 573e1fd92cc726405b415b5214ed96fa1a0ce420 +
    diff --git a/dmp-frontend/src/app/form/dynamic-form.component.ts b/dmp-frontend/src/app/form/dynamic-form.component.ts index 754335fe2..a66e0dff5 100644 --- a/dmp-frontend/src/app/form/dynamic-form.component.ts +++ b/dmp-frontend/src/app/form/dynamic-form.component.ts @@ -13,9 +13,22 @@ import { GroupBase } from './dynamic-form-group/group-base'; import { PaginationService } from '../../app/services/pagination.service'; import { TokenService, TokenProvider } from '../services/token.service'; +import { AngularDraggableModule } from 'angular2-draggable'; + import './../../assets/xml2json.min.js'; declare var X2JS: any; + +var flatten = require('flat'); + + +import * as $ from '../../../node_modules/jquery/dist/jquery' + +import * as scroll from '../../assets/jquery.scrollTo.min.js'; + + + + @Component({ selector: 'dynamic-form', templateUrl: './dynamic-form.component.html', @@ -31,11 +44,14 @@ export class DynamicFormComponent implements OnInit { @Input() pagination: any = {}; id:string; datasetId:string; - datasetProperties:string; + //datasetProperties:string; private fragment: string; xml2jsonOBJ: any; + + + constructor(private qcs: FieldControlService, private serverService: ServerService, private dataModelService: dataModelBuilder, private router: Router, private route: ActivatedRoute, private pagerService: PaginationService, private tokenService : TokenService) { this.form = this.qcs.toFormGroup(new Array(), new Array()); @@ -57,10 +73,10 @@ export class DynamicFormComponent implements OnInit { let sub = this.route.params.subscribe(params => { this.id = params.id; this.datasetId = params.datasetId; - this.datasetProperties = params.datasetProperties + //this.datasetProperties = params.datasetProperties }); - this.serverService.getDatsetsProfile(this.id).subscribe( + this.serverService.getDatasetProfileByID(this.id).subscribe( response => { @@ -132,8 +148,53 @@ export class DynamicFormComponent implements OnInit { } ); + + this.serverService.getDatasetByID(this.datasetId).subscribe( + (data) => { + + if(data.properties){ + console.log("Found already submitted form, loading that one!"); + + //console.log(data.properties) + //console.log(JSON.parse(data.properties)) + + let formValues = JSON.parse(data.properties); + + var flatList = flatten(formValues); + + this.patchForm(flatList); + + } + + }, + (err) => { + + }); + + } + + scrollToElemID(elemID){ + scroll("#"+elemID); + } + + + private patchForm(flatList : any){ + + for (var prop in flatList) { + if (flatList.hasOwnProperty(prop)) { + if(prop.endsWith('.id')||prop.endsWith('.answer')||prop.endsWith('.value')) continue; + //console.log("updating value of "+prop +" to "+flatList[prop].valueOf()) + this.form.get(prop).setValue(flatList[prop].valueOf()); + } + } + //this.form.get("namingConventionGroup.nonamingConventionA213").setValue("TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT"); + } + + + + ngAfterViewChecked(): void { //navigate to certain section of the page try { document.querySelector('#' + this.fragment).scrollIntoView(); @@ -141,6 +202,30 @@ export class DynamicFormComponent implements OnInit { } onSubmit() { + + + this.serverService.getDatasetByID(this.datasetId).subscribe( + (data) => { + + //is xml, so transform them to xml (it's json) + //data.properties = this.xml2jsonOBJ.json2xml_str(JSON.stringify(this.form.value)); + data.properties = JSON.stringify(this.form.value); + + this.serverService.setDataset(data).subscribe( (data) => { + console.log("Updated dataset"); + + //VALE EDW NA SE PIGAINEI PISW KAI NA SOU VGAZEI ENA MHNYMA SUCCESS... (to success tha to valw egw an thes) + + }, + (err) => { + + }); + }, + (err) => { + + }); + + this.payLoad = JSON.stringify(this.form.value); } diff --git a/dmp-frontend/src/app/form/tableOfContents/toc.component.html b/dmp-frontend/src/app/form/tableOfContents/toc.component.html index 1377a1088..40eeacfc3 100644 --- a/dmp-frontend/src/app/form/tableOfContents/toc.component.html +++ b/dmp-frontend/src/app/form/tableOfContents/toc.component.html @@ -4,15 +4,16 @@
  • + {{group.title}} + +
  • + +
diff --git a/dmp-frontend/src/app/form/tableOfContents/toc.component.ts b/dmp-frontend/src/app/form/tableOfContents/toc.component.ts index 12aa99c8b..fd5ef2715 100644 --- a/dmp-frontend/src/app/form/tableOfContents/toc.component.ts +++ b/dmp-frontend/src/app/form/tableOfContents/toc.component.ts @@ -1,12 +1,17 @@ import { Component, OnInit, Input } from '@angular/core'; import { DataModel } from '../../entities/DataModel'; +//import * as $ from '../../../../node_modules/jquery/dist/jquery' + +import * as scroll from '../../../assets/jquery.scrollTo.min.js'; + @Component({ selector: 'toc', templateUrl: '/toc.component.html', providers: [] }) -export class TocComponent implements OnInit{ +export class TocComponent implements OnInit{ + @Input() dataModel: DataModel; private headers = new Array(); @@ -18,4 +23,9 @@ export class TocComponent implements OnInit{ } + scrollToElemID(elemID){ + console.log("going to id:"+elemID) + scroll("#"+elemID); + } + } \ No newline at end of file diff --git a/dmp-frontend/src/app/modal/modal.component.ts b/dmp-frontend/src/app/modal/modal.component.ts index ad8ac94c6..cb135700c 100644 --- a/dmp-frontend/src/app/modal/modal.component.ts +++ b/dmp-frontend/src/app/modal/modal.component.ts @@ -97,7 +97,8 @@ export class ModalComponent implements OnInit { this.show = false; } - showDatasets(dmpId, event) { + showDatasets(dmpId, event) { + debugger; this.dataSetVisibe = true; $("#exampleModalDmps").modal("hide"); this.show = false; diff --git a/dmp-frontend/src/app/pipes/dataset-table-filter.pipe.ts b/dmp-frontend/src/app/pipes/dataset-table-filter.pipe.ts new file mode 100644 index 000000000..690a91256 --- /dev/null +++ b/dmp-frontend/src/app/pipes/dataset-table-filter.pipe.ts @@ -0,0 +1,29 @@ +import * as _ from "lodash"; +import {Pipe, PipeTransform} from "@angular/core"; + +@Pipe({ + name: "dmpTableFilter" +}) +export class DatasetTableFilterPipe implements PipeTransform { + + transform(array: any[], query: string): any { + + if (query) { + + return _.filter(array, row => { + if (row.uri == null) row.uri = ""; + if (row.label == null) row.label = ""; + if (row.id == null) row.id = ""; + return ( + + row.label.indexOf(query) > -1 || + + //row.version == query || + row.id.indexOf(query) > -1 + ) + }); + + } + return array; + } +} \ No newline at end of file diff --git a/dmp-frontend/src/app/pipes/dmp-table-filter.pipe.ts b/dmp-frontend/src/app/pipes/dmp-table-filter.pipe.ts new file mode 100644 index 000000000..9b5f08f0b --- /dev/null +++ b/dmp-frontend/src/app/pipes/dmp-table-filter.pipe.ts @@ -0,0 +1,29 @@ +import * as _ from "lodash"; +import {Pipe, PipeTransform} from "@angular/core"; + +@Pipe({ + name: "dmpTableFilter" +}) +export class DmpTableFilterPipe implements PipeTransform { + + transform(array: any[], query: string): any { + + if (query) { + + return _.filter(array, row => { + if (row.uri == null) row.uri = ""; + if (row.label == null) row.label = ""; + if (row.id == null) row.id = ""; + return ( + + row.label.indexOf(query) > -1 || + + //row.version == query || + row.id.indexOf(query) > -1 + ) + }); + + } + return array; + } +} \ No newline at end of file diff --git a/dmp-frontend/src/app/pipes/dmp-version-filter.pipe.ts b/dmp-frontend/src/app/pipes/dmp-version-filter.pipe.ts new file mode 100644 index 000000000..0ce5c54f8 --- /dev/null +++ b/dmp-frontend/src/app/pipes/dmp-version-filter.pipe.ts @@ -0,0 +1,22 @@ +import * as _ from "lodash"; +import {Pipe, PipeTransform} from "@angular/core"; + +@Pipe({ + name: "dmpVersionFilter" +}) +export class DmpVersionFilterPipe implements PipeTransform { + + transform(array: any[], version: number): any { + + if (version) { + + return _.filter(array, row => { + return ( + row.version == version + ) + }); + + } + return array; + } + } \ No newline at end of file diff --git a/dmp-frontend/src/app/services/rest-base.ts b/dmp-frontend/src/app/services/rest-base.ts index efa349361..3f010fabc 100644 --- a/dmp-frontend/src/app/services/rest-base.ts +++ b/dmp-frontend/src/app/services/rest-base.ts @@ -16,16 +16,24 @@ export class RestBase { } - /* protocol: string = "http"; +<<<<<<< HEAD + /* +======= +>>>>>>> 573e1fd92cc726405b415b5214ed96fa1a0ce420 + protocol: string = "http"; hostname: string ="dl010.madgik.di.uoa.gr" ;//"localhost";//"dl010.madgik.di.uoa.gr";// port: number = 8080;//8080;// - webappname: string = "dmp-backend";//"dmp-backend-new";//*/ + webappname: string = "dmp-backend";//"dmp-backend-new";// +<<<<<<< HEAD + */ +======= +>>>>>>> 573e1fd92cc726405b415b5214ed96fa1a0ce420 - protocol: string = "http"; + /*protocol: string = "http"; hostname: string = "dionysus.di.uoa.gr" ; port: number = 7070; - webappname: string = "dmp-backend"; + webappname: string = "dmp-backend";*/ proxyPath : string = this.protocol+"://"+this.hostname+":"+this.port+"/"+this.webappname+"/proxy/"; diff --git a/dmp-frontend/src/app/services/server.service.ts b/dmp-frontend/src/app/services/server.service.ts index 63184c66c..041738dde 100644 --- a/dmp-frontend/src/app/services/server.service.ts +++ b/dmp-frontend/src/app/services/server.service.ts @@ -46,10 +46,14 @@ export class ServerService { return this.restBase.get("getAllDatasets"); } - public getAllDatasetIDs(datasetId: string){ - return this.restBase.get("dataset/"+datasetId); + public getDatasetByID(datasetId: string){ + return this.restBase.get("datasets/"+datasetId); } + public setDataset(dataset){ + return this.restBase.post("dataset/update", dataset); + + } public getAllDmps(){ return this.restBase.get("dmp/getAll"); @@ -109,8 +113,12 @@ export class ServerService { return this.restBase.post("dmp/createofuser", data); } + public updateDmpForCurrentUser(data:any){ + return this.restBase.post("dmp/update", data); +} + public getDatasetForDmp(data:any){ - return this.restBase.post("dmp/getdatasets", data); + return this.restBase.post("/dmp/getdatasets", data); } public createDatasetForDmp(data:any){ @@ -121,13 +129,9 @@ public getAllDatsetsProfile(){ return this.restBase.get("datasetprofile/getAll"); } -public getDatsetsProfile(id){ +public getDatasetProfileByID(id){ return this.restBase.get("datasetprofiles/"+id); } - -public updateDatsetsProfile(data:any){ - return this.restBase.post("dataset/update", data); -} logOut() { diff --git a/dmp-frontend/src/app/tabs/tabs.component.ts b/dmp-frontend/src/app/tabs/tabs.component.ts index e48e6bd6c..0351f59ee 100644 --- a/dmp-frontend/src/app/tabs/tabs.component.ts +++ b/dmp-frontend/src/app/tabs/tabs.component.ts @@ -5,7 +5,7 @@ import { Component } from '@angular/core'; template: `