From 4bd70ffdfb6515bac143fb4deefa0e2f9168c43a Mon Sep 17 00:00:00 2001 From: annampak Date: Tue, 23 Jan 2018 15:46:38 +0200 Subject: [PATCH] dmp associated users --- .../app/dmps/editor/dmp-editor.component.html | 12 ++++++------ .../src/app/dmps/editor/dmp-editor.component.ts | 4 +++- .../DataManagementPlanModel.ts | 7 ++++++- .../src/app/models/dmpUsers/DmpUsersModel.ts | 16 ++++++++++++++++ 4 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 dmp-frontend/src/app/models/dmpUsers/DmpUsersModel.ts diff --git a/dmp-frontend/src/app/dmps/editor/dmp-editor.component.html b/dmp-frontend/src/app/dmps/editor/dmp-editor.component.html index fcab0ad9c..f2ed12c21 100644 --- a/dmp-frontend/src/app/dmps/editor/dmp-editor.component.html +++ b/dmp-frontend/src/app/dmps/editor/dmp-editor.component.html @@ -67,12 +67,12 @@ - -

Associated Users

- - person -
{{user.name}}
-
+ +

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 b52dd50eb..713806339 100644 --- a/dmp-frontend/src/app/dmps/editor/dmp-editor.component.ts +++ b/dmp-frontend/src/app/dmps/editor/dmp-editor.component.ts @@ -19,6 +19,7 @@ import { DatasetProfileModel } from "../../models/datasets/DatasetProfileModel"; import { AutoCompleteConfiguration } from "../../shared/components/autocomplete/AutoCompleteConfiguration"; import { ProjectCriteria } from "../../models/criteria/project/ProjectCriteria"; import { ProjectService } from "../../services/project/project.service"; +import { DmpUsersModel } from "@app/models/dmpUsers/DmpUsersModel"; @@ -45,7 +46,7 @@ export class DataManagementPlanEditorComponent implements AfterViewInit { projectAutoCompleteConfiguration: AutoCompleteConfiguration; createNewVersion; - associatedUsers = [{name:"Ioannis Kalyvas"}]; + associatedUsers: Array constructor( private dataManagementPlanService: DataManagementPlanService, @@ -74,6 +75,7 @@ export class DataManagementPlanEditorComponent implements AfterViewInit { .subscribe(data => { this.dataManagementPlan = JsonSerializer.fromJSONObject(data, DataManagementPlanModel); this.formGroup = this.dataManagementPlan.buildForm(); + this.associatedUsers = data.associatedUsers; }); } else { this.dataManagementPlan = new DataManagementPlanModel(); diff --git a/dmp-frontend/src/app/models/data-managemnt-plans/DataManagementPlanModel.ts b/dmp-frontend/src/app/models/data-managemnt-plans/DataManagementPlanModel.ts index 7ce3d5ea3..6046e9ec8 100644 --- a/dmp-frontend/src/app/models/data-managemnt-plans/DataManagementPlanModel.ts +++ b/dmp-frontend/src/app/models/data-managemnt-plans/DataManagementPlanModel.ts @@ -10,6 +10,7 @@ import { ResearcherModel } from "../researcher/ResearcherModel"; import { JsonSerializer } from "../../utilities/JsonSerializer"; import { ProfileModel } from "../profile/ProfileModel"; import { Status } from "../Status"; +import { DmpUsersModel } from "@app/models/dmpUsers/DmpUsersModel"; export class DataManagementPlanModel implements Serializable { public id: String; @@ -22,6 +23,7 @@ export class DataManagementPlanModel implements Serializable { + public id: String; + public email: String; + public name: String; + + fromJSONObject(item: any): DmpUsersModel { + this.id = item.id; + this.email = item.label; + this.name = item.abbreviation; + + return this; + } +} \ No newline at end of file