+
+ (inputChange)="filterProfiles($event)" requireMatch required>
{{chip.label.substring(0, 1).toUpperCase()}}
{{chip.label}}
@@ -37,9 +34,11 @@
- {{'GENERAL.VALIDATION.REQUIRED' | translate}}
+
+ {{'GENERAL.VALIDATION.REQUIRED' | translate}}
+
-
+
@@ -55,28 +54,35 @@
-
-
- {{chip.name.substring(0, 1).toUpperCase()}}
- {{chip.name}}
-
-
-
- {{option.name}}
-
-
-
-
+
+
+
+ {{chip.name.substring(0, 1).toUpperCase()}}
+ {{chip.name}}
+
+
+
+ {{option.name}}
+
+
+
+
+
+
+
+
- Associated Users
-
+ Associated Users
+
person
{{user.name}}
-
-
+
+
diff --git a/dmp-frontend/src/app/dmps/editor/dmp-editor.component.ts b/dmp-frontend/src/app/dmps/editor/dmp-editor.component.ts
index 9fed22ddd..a27c74f0a 100644
--- a/dmp-frontend/src/app/dmps/editor/dmp-editor.component.ts
+++ b/dmp-frontend/src/app/dmps/editor/dmp-editor.component.ts
@@ -1,5 +1,5 @@
import { Component, ViewChild, OnInit, AfterViewInit, ViewEncapsulation } from "@angular/core";
-import { MatPaginator, MatSort, MatSnackBar } from "@angular/material";
+import { MatPaginator, MatSort, MatSnackBar, MatDialog } from "@angular/material";
import { Router, ActivatedRoute, Params } from "@angular/router";
import { TranslateService } from "@ngx-translate/core";
import { DataSource } from "@angular/cdk/table";
@@ -20,6 +20,7 @@ import { AutoCompleteConfiguration } from "../../shared/components/autocomplete/
import { ProjectCriteria } from "../../models/criteria/project/ProjectCriteria";
import { ProjectService } from "../../services/project/project.service";
import { DmpUsersModel } from "@app/models/dmpUsers/DmpUsersModel";
+import { AddResearchersComponent } from "@app/add-researchers/add-researchers.component";
@@ -56,7 +57,8 @@ export class DataManagementPlanEditorComponent implements AfterViewInit {
public snackBar: MatSnackBar,
public router: Router,
public language: TranslateService,
- private _service: DataManagementPlanService
+ private _service: DataManagementPlanService,
+ public dialog: MatDialog
) {
}
@@ -209,4 +211,15 @@ export class DataManagementPlanEditorComponent implements AfterViewInit {
}
}
+ addResearcher(rowId: any, rowName: any) {
+ let dialogRef = this.dialog.open(AddResearchersComponent, {
+ height: '255px',
+ width: '700px',
+ data: {
+ dmpId: rowId,
+ dmpName: rowName
+ }
+ });
+ }
+
}
\ No newline at end of file
diff --git a/dmp-frontend/src/app/models/researcher/ResearcherModel.ts b/dmp-frontend/src/app/models/researcher/ResearcherModel.ts
index 03cbace90..8ad928280 100644
--- a/dmp-frontend/src/app/models/researcher/ResearcherModel.ts
+++ b/dmp-frontend/src/app/models/researcher/ResearcherModel.ts
@@ -1,8 +1,10 @@
import { Serializable } from "../Serializable";
+import { FormGroup, FormBuilder } from '@angular/forms';
export class ResearcherModel implements Serializable {
public id: String;
public name: String;
+ public lastName: String;
public uri: String;
public email: String;
@@ -14,4 +16,14 @@ export class ResearcherModel implements Serializable {
return this;
}
+
+ buildForm(): FormGroup {
+ let formGroup = new FormBuilder().group({
+ firstName:[this.name],
+ lastName:[this.lastName]
+ })
+
+ return formGroup;
+ }
+
}
\ No newline at end of file
diff --git a/dmp-frontend/src/app/services/researchers/researchers.service.ts b/dmp-frontend/src/app/services/researchers/researchers.service.ts
new file mode 100644
index 000000000..07a0dbaaa
--- /dev/null
+++ b/dmp-frontend/src/app/services/researchers/researchers.service.ts
@@ -0,0 +1,31 @@
+import { Invitation } from '../../models/invitation/Invitation';
+import { UserInvitationCriteria } from '../../models/criteria/invitation/UserInvitationCriteria';
+import { User } from '../../models/invitation/User';
+import { HostConfiguration } from '../../app.constants';
+import { BaseHttpService } from '../../utilities/cite-http-service-module/base-http.service';
+import { Injectable } from "@angular/core";
+import { HttpHeaders } from '@angular/common/http';
+import { Observable } from 'rxjs/Observable';
+import { RequestItem } from '../../models/criteria/RequestItem';
+import { ResearcherModel } from '@app/models/researcher/ResearcherModel';
+
+@Injectable()
+export class ResearcherService {
+
+ private actionUrl: string;
+ private headers: HttpHeaders;
+
+ constructor(private http: BaseHttpService) {
+
+ this.actionUrl = HostConfiguration.Server + 'researchers/';
+
+ this.headers = new HttpHeaders();
+ this.headers = this.headers.set('Content-Type', 'application/json');
+ this.headers = this.headers.set('Accept', 'application/json');
+ }
+
+ public createResearcher(researcher: ResearcherModel) {
+ return this.http.post(this.actionUrl + "create", researcher, { headers: this.headers });
+ }
+
+}
\ No newline at end of file
diff --git a/dmp-frontend/src/assets/lang/en.json b/dmp-frontend/src/assets/lang/en.json
index 4ec10f343..43cc7e433 100644
--- a/dmp-frontend/src/assets/lang/en.json
+++ b/dmp-frontend/src/assets/lang/en.json
@@ -199,5 +199,14 @@
"USER": "User",
"MANAGER": "Manager"
}
- }
+ },
+ "ADDRESEARCHERS-EDITOR": {
+ "TITLE": "Add a Researcher",
+ "FIRST_NAME": "First Name",
+ "LAST_NAME": "Last Name",
+ "ACTIONS": {
+ "SAVE": "Save",
+ "CANCEL": "Cancel"
+ }
+ }
}
\ No newline at end of file