From bf6247a09153ef8f06a4b0cbbd1706728c6de5c2 Mon Sep 17 00:00:00 2001 From: Diamadis Tziotzios Date: Mon, 18 Dec 2017 13:24:12 +0200 Subject: [PATCH] no message --- dmp-frontend/.angular-cli.json | 9 ++-- .../datasets_new/dataset-listing.component.ts | 2 +- .../app/dmps/editor/dmp-editor.component.html | 48 +++++++++++------ .../app/dmps/editor/dmp-editor.component.ts | 53 ++++++++++++++----- .../DataManagementPlanModel.ts | 12 +++-- .../ExternalSourcesItemModel.ts | 5 ++ .../external-sources.service.ts | 21 ++++---- dmp-frontend/src/assets/lang/en.json | 19 ++++++- dmp-frontend/src/styles.scss | 47 +++++++++++++++- 9 files changed, 164 insertions(+), 52 deletions(-) create mode 100644 dmp-frontend/src/app/models/external-sources/ExternalSourcesItemModel.ts diff --git a/dmp-frontend/.angular-cli.json b/dmp-frontend/.angular-cli.json index b6bd82a36..8c4a25f1f 100644 --- a/dmp-frontend/.angular-cli.json +++ b/dmp-frontend/.angular-cli.json @@ -19,12 +19,13 @@ "testTsconfig": "tsconfig.spec.json", "prefix": "app", "styles": [ + "./../node_modules/bootstrap/dist/css/bootstrap.min.css", "styles.scss" ], "scripts": [ - "./../node_modules/bootstrap/dist/js/bootstrap.min.js", - "./assets/xml2json.min.js" - ], + "./../node_modules/bootstrap/dist/js/bootstrap.min.js", + "./assets/xml2json.min.js" + ], "environmentSource": "environments/environment.ts", "environments": { "dev": "environments/environment.ts", @@ -60,4 +61,4 @@ "styleExt": "css", "component": {} } -} +} \ No newline at end of file diff --git a/dmp-frontend/src/app/datasets_new/dataset-listing.component.ts b/dmp-frontend/src/app/datasets_new/dataset-listing.component.ts index e9068fac5..1688fc92a 100644 --- a/dmp-frontend/src/app/datasets_new/dataset-listing.component.ts +++ b/dmp-frontend/src/app/datasets_new/dataset-listing.component.ts @@ -97,7 +97,7 @@ export class DatasetDataSource extends DataSource { }); const startIndex = this._paginator.pageIndex * this._paginator.pageSize; const request = new DataTableRequest(startIndex, this._paginator.pageSize); - request.projectCriteria = this._criteria.getFormData(); + request.criteria = this._criteria.getFormData(); return this._service.getPaged(request); }) .catch((error: any) => { 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 510f59135..177130ba3 100644 --- a/dmp-frontend/src/app/dmps/editor/dmp-editor.component.html +++ b/dmp-frontend/src/app/dmps/editor/dmp-editor.component.html @@ -1,26 +1,25 @@
- {{'PROJECT-EDITOR.TITLE.NEW' | translate}} - {{'PROJECT-EDITOR.TITLE.EDIT' | translate}} {{project.label}} + {{'DMP-EDITOR.TITLE.NEW' | translate}} + {{'DMP-EDITOR.TITLE.EDIT' | translate}} {{project.label}} - + {{baseErrorModel.label}} {{'GENERAL.VALIDATION.REQUIRED' | translate}} @@ -29,7 +28,7 @@ - @@ -39,7 +38,7 @@ - @@ -51,33 +50,48 @@ --> - {{errorModel.description}} {{'GENERAL.VALIDATION.REQUIRED' | translate}} - + - +
{{chip.name.substring(0, 1).toUpperCase()}}
{{chip.name}}
- {{option.name}} + {{option.name}}
-
+
+ + +
{{chip.name.substring(0, 1).toUpperCase()}}
+ {{chip.name}} +
+ +
+ {{option.name}} +
+
+ +
+
- - - + + +
+
{{ formGroup.value | json }}
\ No newline at end of file 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 5cb78099b..f728b5edc 100644 --- a/dmp-frontend/src/app/dmps/editor/dmp-editor.component.ts +++ b/dmp-frontend/src/app/dmps/editor/dmp-editor.component.ts @@ -12,6 +12,7 @@ import { DataManagementPlanService } from "../../services/data-management-plan/d import { DataManagementPlanModel } from "../../models/data-managemnt-plans/DataManagementPlanModel"; import { ServerService } from "../../services/server.service"; import { ExternalSourcesService } from "../../services/external-sources/external-sources.service"; +import { ExternalSourcesItemModel } from "../../models/external-sources/ExternalSourcesItemModel"; @@ -30,20 +31,8 @@ export class DataManagementPlanEditorComponent implements AfterViewInit { filteringOrganisationsAsync: boolean = false; filteringResearchersAsync: boolean = false; - filteredOrganisations: string[]; - filteredResearchers: string[]; - - filterOrganisations(value: string): void { - this.filteredOrganisations = undefined; - if (value) { - this.filteringOrganisationsAsync = true; - - this.externalSourcesService.searchDMPOrganizations(value).subscribe(organizations => { - this.filteredOrganisations = organizations; - this.filteringOrganisationsAsync = false; - }); - } - } + filteredOrganisations: ExternalSourcesItemModel[]; + filteredResearchers: ExternalSourcesItemModel[]; constructor( private dataManagementPlanService: DataManagementPlanService, @@ -116,4 +105,40 @@ export class DataManagementPlanEditorComponent implements AfterViewInit { public cancel(): void { this.router.navigate(['/dataManagementPlans']); } + + filterOrganisations(value: string): void { + + this.filteredOrganisations = undefined; + if (value) { + this.filteringOrganisationsAsync = true; + + this.externalSourcesService.searchDMPOrganizations(value).subscribe(items => { + this.filteredOrganisations = items; + this.filteringOrganisationsAsync = false; + + // this.filteredOrganisations = items.filter((filteredObj: any) => { + // return this.objectsModel ? this.objectsModel.indexOf(filteredObj) < 0 : true; + // }); + + }); + } + } + + filterResearchers(value: string): void { + + this.filteredResearchers = undefined; + if (value) { + this.filteringResearchersAsync = true; + + this.externalSourcesService.searchDMPResearchers(value).subscribe(items => { + this.filteredResearchers = items; + this.filteringResearchersAsync = false; + + // this.filteredOrganisations = items.filter((filteredObj: any) => { + // return this.objectsModel ? this.objectsModel.indexOf(filteredObj) < 0 : true; + // }); + + }); + } + } } \ No newline at end of file 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 ba8ad860b..ba2d6ebeb 100644 --- a/dmp-frontend/src/app/models/data-managemnt-plans/DataManagementPlanModel.ts +++ b/dmp-frontend/src/app/models/data-managemnt-plans/DataManagementPlanModel.ts @@ -4,6 +4,7 @@ import { FormGroup, FormBuilder, FormControl, Validators } from "@angular/forms" import { BackendErrorValidator } from "../../utilities/validators/BackendErrorValidator"; import { BaseErrorModel } from "../error/BaseErrorModel"; import { AutoCompleteItem } from "../../shared/components/autocomplete/AutoCompleteItem"; +import { ExternalSourcesItemModel } from "../external-sources/ExternalSourcesItemModel"; export class DataManagementPlanModel implements Serializable { public id: String; @@ -13,9 +14,8 @@ export class DataManagementPlanModel implements Serializable