diff --git a/dmp-frontend/src/app/datasets/dataset.component.css b/dmp-frontend/src/app/datasets/dataset.component.css
index 02c0d5c92..af312ae3f 100644
--- a/dmp-frontend/src/app/datasets/dataset.component.css
+++ b/dmp-frontend/src/app/datasets/dataset.component.css
@@ -47,3 +47,10 @@ tr.hover:hover > * {
}
+.ui-autocomplete-multiple {
+ width: 100% !important;
+}
+
+.ui-autocomplete-multiple-container {
+ width: 100% !important;
+}
\ 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 17d643d14..401f6a602 100644
--- a/dmp-frontend/src/app/datasets/dataset.component.ts
+++ b/dmp-frontend/src/app/datasets/dataset.component.ts
@@ -1,4 +1,4 @@
-import { Component, OnInit, Input, ViewChild, NgZone, Output, EventEmitter } from '@angular/core';
+import { Component, OnInit, Input, ViewChild, NgZone, Output, EventEmitter, ViewEncapsulation } from '@angular/core';
import { GoogleSignInSuccess } from 'angular-google-signin';
import { Router, ActivatedRoute } from '@angular/router';
import { ServerService } from '../../app/services/server.service';
@@ -22,7 +22,8 @@ declare function simple_notifier(type: string, title: string, message: string):
selector: 'datasets-table',
templateUrl: 'dataset.html',
styleUrls: ['./dataset.component.css'],
- providers: [ServerService]
+ providers: [ServerService],
+ encapsulation: ViewEncapsulation.None
})
export class DatasetsComponent implements OnInit {
diff --git a/dmp-frontend/src/app/datasets/dataset.html b/dmp-frontend/src/app/datasets/dataset.html
index e7e27c7cc..6a1944e98 100644
--- a/dmp-frontend/src/app/datasets/dataset.html
+++ b/dmp-frontend/src/app/datasets/dataset.html
@@ -136,19 +136,19 @@
diff --git a/dmp-frontend/src/app/dmps/dmp.component.css b/dmp-frontend/src/app/dmps/dmp.component.css
index 9c846c48e..a8cfa7f65 100644
--- a/dmp-frontend/src/app/dmps/dmp.component.css
+++ b/dmp-frontend/src/app/dmps/dmp.component.css
@@ -104,6 +104,13 @@ tr.hover:hover > * {
}
/* END OF HORIZONTALLY -COLLAPSING DIVS */
+.ui-autocomplete-multiple {
+ width: 100% !important;
+}
+
+.ui-autocomplete-multiple-container {
+ width: 100% !important;
+}
/*
diff --git a/dmp-frontend/src/app/dmps/dmp.component.ts b/dmp-frontend/src/app/dmps/dmp.component.ts
index b19f776a1..ecc8bd5ba 100644
--- a/dmp-frontend/src/app/dmps/dmp.component.ts
+++ b/dmp-frontend/src/app/dmps/dmp.component.ts
@@ -1,4 +1,4 @@
-import { Component, OnInit, Input, Output, EventEmitter, ViewChild } from '@angular/core';
+import { Component, OnInit, Input, Output, EventEmitter, ViewChild, ViewEncapsulation } from '@angular/core';
import { GoogleSignInSuccess } from 'angular-google-signin';
import { Router, ActivatedRoute } from '@angular/router';
import { ServerService } from '../../app/services/server.service';
@@ -12,29 +12,30 @@ import { DropdownField } from '../../app/form/fields/dropdown/field-dropdown';
import { Param } from '../entities/model/param';
import { ModalComponent } from '../modal/modal.component';
import { HttpErrorResponse } from '@angular/common/http';
-import { FormGroup, FormControl } from '@angular/forms'; //na dw an xreiazontai
+import { FormGroup, FormControl } from '@angular/forms'; //na dw an xreiazontai
import { NgForm } from '@angular/forms';
import { DatasetsComponent } from '../datasets/dataset.component';
import { StatusToString } from '../pipes/various/status-to-string';
-import {MenuItem} from 'primeng/primeng';
+import { MenuItem } from 'primeng/primeng';
-declare var $ :any;
+declare var $: any;
import '../../assets/custom.js';
-declare function simple_notifier(type: string, title: string, message:string): any;
+declare function simple_notifier(type: string, title: string, message: string): any;
@Component({
selector: 'dmps',
templateUrl: 'dmps.html',
styleUrls: ['./dmp.component.css'],
- providers: [ServerService]
+ providers: [ServerService],
+ encapsulation: ViewEncapsulation.None
})
-export class DmpComponent implements OnInit{
+export class DmpComponent implements OnInit {
//whole dmp data model
- tableData : any[] = new Array();
-
+ tableData: any[] = new Array();
+
//required by the table
public filterQuery = "";
public rowsOnPage = 10;
@@ -42,27 +43,29 @@ export class DmpComponent implements OnInit{
public sortOrder = "asc";
// for tableIds
- showIDs : boolean = false;
+ showIDs: boolean = false;
- dmp : any;
+ dmp: any;
- @Input() projectsDropDown:DropdownField;
+ @Input() projectsDropDown: DropdownField;
@Input() statusDropDown: DropdownField;
-
- @ViewChild(DatasetsComponent) datasetsComponent:DatasetsComponent;
-
- constructor(
+ @ViewChild(DatasetsComponent) datasetsComponent: DatasetsComponent;
+
+ filteredResearchers: any[];
+ filteredOrganizations: any[];
+
+ constructor(
private serverService: ServerService,
private route: ActivatedRoute,
- private router: Router){
- this.projectsDropDown = new DropdownField();
- this.projectsDropDown.options = [];
- this.statusDropDown = new DropdownField();
- this.statusDropDown.options= [{key:'', value:null},{key:'0', value:"Active"},{key:'1', value:"Inactive"}]
- //this.projects = [];
-
+ private router: Router) {
+ this.projectsDropDown = new DropdownField();
+ this.projectsDropDown.options = [];
+ this.statusDropDown = new DropdownField();
+ this.statusDropDown.options = [{ key: '', value: null }, { key: '0', value: "Active" }, { key: '1', value: "Inactive" }]
+ //this.projects = [];
+
}
@@ -71,18 +74,17 @@ export class DmpComponent implements OnInit{
this.dmp = {
id: null,
label: '',
- previous:'',
- version:'',
- //profileData:'',
- //project: '',
- //profile:{}
+ previous: '',
+ version: '',
+ organizations: [],
+ researchers: []
}
}
ngOnInit() {
- this.getDmps();
+ this.getDmps();
this.serverService.getAllProjects().subscribe(
response => {
@@ -96,90 +98,90 @@ export class DmpComponent implements OnInit{
},
(err: HttpErrorResponse) => {
- simple_notifier("danger",null,"Could not load User's Projects");
+ simple_notifier("danger", null, "Could not load User's Projects");
}
)
this.clearDmp();
-
+
}
- getDmps(muted? : boolean){
- this.serverService.getDmpOfUser().subscribe(
+ getDmps(muted?: boolean) {
+ this.serverService.getDmpOfUser().subscribe(
response => {
this.tableData = response;
- if(muted && muted!=true)
- simple_notifier("success",null,"Refreshed DMPs");
+ if (muted && muted != true)
+ simple_notifier("success", null, "Refreshed DMPs");
- this.tableData.forEach( dmp => {
- if(dmp.previous!=null)
- this.serverService.getDmp(dmp.previous).subscribe( previous => {dmp.previous = previous;});
+ this.tableData.forEach(dmp => {
+ if (dmp.previous != null)
+ this.serverService.getDmp(dmp.previous).subscribe(previous => { dmp.previous = previous; });
});
},
(err: HttpErrorResponse) => {
- simple_notifier("danger",null,"Could not refresh DMPs");
- }
- );
+ simple_notifier("danger", null, "Could not refresh DMPs");
+ }
+ );
}
- newDMP(){
+ newDMP() {
- this.dmp.project = {"id" : this.dmp.project};
+ this.dmp.project = { "id": this.dmp.project };
this.dmp["version"] = 1;
-
+
this.serverService.createDmpForCurrentUser(this.dmp)
- .subscribe(
- response =>{
- simple_notifier("success",null,"DMP created");
+ .subscribe(
+ response => {
+ simple_notifier("success", null, "DMP created");
this.getDmps();
},
error => {
- simple_notifier("danger",null,"Could not create the DMP");
+ simple_notifier("danger", null, "Could not create the DMP");
}
- );
+ );
$("#newDmpModal").modal("hide");
}
- updateDMP(){
+ updateDMP() {
- this.dmp.project = {"id":this.dmp.project};
- this.dmp.creator = {"id": this.dmp.creator};
- if(this.dmp.previous!=null)
+ this.dmp.project = { "id": this.dmp.project };
+ this.dmp.creator = { "id": this.dmp.creator };
+ if (this.dmp.previous != null)
this.dmp.previous = this.dmp.previous.id;
this.serverService.updateDmp(this.dmp)
- .subscribe(
- response =>{
- simple_notifier("success",null,"Edited the DMP");
- this.getDmps();
- },
- error =>{
- simple_notifier("danger",null,"Failed to edit the DMP");
- }
- );
- $("#newDmpModal").modal("hide");
- $("#newVersionDmpModal").modal("hide");
-
- }
-
- cloneDMP(dmp){
- dmp = {"id": dmp.id, "label": dmp.label};
- this.serverService.cloneDmp(dmp).subscribe(
+ .subscribe(
response => {
- simple_notifier("success",null,"Successfully cloned the DMP");
+ simple_notifier("success", null, "Edited the DMP");
this.getDmps();
},
error => {
- simple_notifier("danger",null,"Failed to clone the DMP");
+ simple_notifier("danger", null, "Failed to edit the DMP");
+ }
+ );
+ $("#newDmpModal").modal("hide");
+ $("#newVersionDmpModal").modal("hide");
+
+ }
+
+ cloneDMP(dmp) {
+ dmp = { "id": dmp.id, "label": dmp.label };
+ this.serverService.cloneDmp(dmp).subscribe(
+ response => {
+ simple_notifier("success", null, "Successfully cloned the DMP");
+ this.getDmps();
+ },
+ error => {
+ simple_notifier("danger", null, "Failed to clone the DMP");
}
);
$("#newVersionDmpModal").modal("hide");
}
- SaveDmp(){
+ SaveDmp() {
if (this.dmp.id == null)
this.newDMP();
else
@@ -187,100 +189,113 @@ export class DmpComponent implements OnInit{
}
- editDmp(item){
- this.dmp = Object.assign({}, item);
+ editDmp(item) {
+ this.dmp = Object.assign({}, item);
this.dmp.project = item.project.id;
- $("#newDmpModal").modal("show");
+ $("#newDmpModal").modal("show");
}
- cloneDmp(item){
- this.dmp = Object.assign({}, item);
+ cloneDmp(item) {
+ this.dmp = Object.assign({}, item);
this.dmp.project = item.project.id;
$("#newVersionDmpModal").modal("show");
}
- newDmpForm(item){
+ newDmpForm(item) {
this.clearDmp();
$("#newDmpModal").modal("show");
}
- markDMPForDelete(dmp){
+ markDMPForDelete(dmp) {
this.dmp = dmp;
}
- deleteDMP(confirmation){
- if(confirmation==true)
+ deleteDMP(confirmation) {
+ if (confirmation == true)
this.deleteRow(this.dmp);
}
- deleteRow(dmp){
+ deleteRow(dmp) {
- this.dmp = {"id": this.dmp.id}; //only id is needed to delete
-
+ this.dmp = { "id": this.dmp.id }; //only id is needed to delete
- this.serverService.deleteDmp(this.dmp).subscribe(
- response => {
- simple_notifier("success",null,"Successfully deleted the DMP");
+
+ this.serverService.deleteDmp(this.dmp).subscribe(
+ response => {
+ simple_notifier("success", null, "Successfully deleted the DMP");
this.getDmps();
},
(err: HttpErrorResponse) => {
- if(err.status>=200 && err.status<300)
- simple_notifier("success",null,"Successfully deleted the DMP");
+ if (err.status >= 200 && err.status < 300)
+ simple_notifier("success", null, "Successfully deleted the DMP");
else
- simple_notifier("danger",null,"Failed to delete the DMP");
+ simple_notifier("danger", null, "Failed to delete the DMP");
this.getDmps();
- }
+ }
);
}
- clickFilters(element){
- if(element.textContent == "More filters")
+ clickFilters(element) {
+ if (element.textContent == "More filters")
element.textContent = "Less Filters";
else
element.textContent = "More Filters";
- }
+ }
- SelectDMPStatus(dmp, event, oldValue){
+ SelectDMPStatus(dmp, event, oldValue) {
console.log(dmp);
- let cannotChangeStatus:boolean;
- if(dmp.status == 2){
+ let cannotChangeStatus: boolean;
+ if (dmp.status == 2) {
this.serverService.getDatasetForDmp({ "id": dmp.id }).subscribe(
response => {
response.forEach(dataset => {
- if(dataset.status !==2 || dataset.status !==3){
- cannotChangeStatus=true;
+ if (dataset.status !== 2 || dataset.status !== 3) {
+ cannotChangeStatus = true;
}
return;
});
- if(cannotChangeStatus == true){
+ if (cannotChangeStatus == true) {
dmp.status = 0;
$("#messageForChangingStatus").modal("show");
}
},
error => {
- console.log("could not retrieve dataset for dpm: "+dmp.id);
+ console.log("could not retrieve dataset for dpm: " + dmp.id);
}
);
}
-
+
}
- showDatasetsOfDmp(item){
- this.router.navigate(['/dataset'], { queryParams: { "dmpid":item.id , "label":item.label}});
+ showDatasetsOfDmp(item) {
+ this.router.navigate(['/dataset'], { queryParams: { "dmpid": item.id, "label": item.label } });
}
- viewDetailedDMP(dmp){
+ viewDetailedDMP(dmp) {
let random = Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 5);
- this.router.navigate(['/dmps/dmp'], { queryParams: { "dmpid":dmp.id, "label":dmp.label, random: random}});
+ this.router.navigate(['/dmps/dmp'], { queryParams: { "dmpid": dmp.id, "label": dmp.label, random: random } });
}
- viewDetailedProject(dmp){
+ viewDetailedProject(dmp) {
let random = Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 5);
- this.router.navigate(['/dmps/project'], { queryParams: { "projectid":dmp.project.id, "label":dmp.project.label, random: random }});
+ this.router.navigate(['/dmps/project'], { queryParams: { "projectid": dmp.project.id, "label": dmp.project.label, random: random } });
}
+ searchResearchers(event) {
+ let query = event.query;
+ this.serverService.searchDMPResearchers(query).subscribe(researchers => {
+ this.filteredResearchers = researchers;
+ });
+ }
+
+ searchOrganizations(event) {
+ let query = event.query;
+ this.serverService.searchDMPOrganizations(query).subscribe(organizations => {
+ this.filteredOrganizations = organizations;
+ });
+ }
}
diff --git a/dmp-frontend/src/app/dmps/dmps.html b/dmp-frontend/src/app/dmps/dmps.html
index 5b276d119..959fc9247 100644
--- a/dmp-frontend/src/app/dmps/dmps.html
+++ b/dmp-frontend/src/app/dmps/dmps.html
@@ -1,28 +1,28 @@
-
-
-
-
-
-
@@ -246,4 +265,5 @@
-
+
\ No newline at end of file
diff --git a/dmp-frontend/src/app/services/server.service.ts b/dmp-frontend/src/app/services/server.service.ts
index 2dcd2e613..94778be4c 100644
--- a/dmp-frontend/src/app/services/server.service.ts
+++ b/dmp-frontend/src/app/services/server.service.ts
@@ -184,4 +184,12 @@ export class ServerService {
public searchDatasetService(like: string) {
return this.restBase.get("external/services" + "?query=" + like);
}
+
+ public searchDMPResearchers(like: string) {
+ return this.restBase.get("external/researchers" + "?query=" + like);
+ }
+
+ public searchDMPOrganizations(like: string) {
+ return this.restBase.get("external/organisations" + "?query=" + like);
+ }
}
\ No newline at end of file