diff --git a/dmp-frontend/src/app/datasets/dataset-listing.component.ts b/dmp-frontend/src/app/datasets/dataset-listing.component.ts index 0ee505e33..29d0402da 100644 --- a/dmp-frontend/src/app/datasets/dataset-listing.component.ts +++ b/dmp-frontend/src/app/datasets/dataset-listing.component.ts @@ -11,7 +11,7 @@ import { DataTableRequest } from "../models/data-table/DataTableRequest"; import { SnackBarNotificationComponent } from "../shared/components/notificaiton/snack-bar-notification.component"; import { DatasetService } from "../services/dataset/dataset.service"; import { DatasetListingModel } from "../models/datasets/DatasetListingModel"; - +import {PageEvent} from '@angular/material'; @Component({ @@ -28,7 +28,8 @@ export class DatasetListingComponent implements OnInit { dataSource: DatasetDataSource | null; displayedColumns: String[] = ['label','dmp' ,'profile' , 'dataRepositories', 'registries','services', 'status', 'description', 'created', 'actions']; - + pageEvent: PageEvent; + statuses = [ {value: '0', viewValue: 'Active'}, {value: '1', viewValue: 'Inactive'} @@ -41,7 +42,8 @@ export class DatasetListingComponent implements OnInit { public snackBar: MatSnackBar, ) { - } + } + ngOnInit() { this.criteria.setCriteria(this.getDefaultCriteria()); 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 3edddc208..4a94d5764 100644 --- a/dmp-frontend/src/app/dmps/editor/dmp-editor.component.html +++ b/dmp-frontend/src/app/dmps/editor/dmp-editor.component.html @@ -18,6 +18,20 @@ {{'GENERAL.VALIDATION.REQUIRED' | translate}} + + +
{{chip.name.substring(0, 1).toUpperCase()}}
+ {{chip.name}} +
+ +
+ {{option.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 bfa8284e2..58f378c2e 100644 --- a/dmp-frontend/src/app/dmps/editor/dmp-editor.component.ts +++ b/dmp-frontend/src/app/dmps/editor/dmp-editor.component.ts @@ -30,8 +30,10 @@ export class DataManagementPlanEditorComponent implements AfterViewInit { filteringOrganisationsAsync: boolean = false; filteringResearchersAsync: boolean = false; + filteredProfilesAsync: boolean = false; filteredOrganisations: ExternalSourcesItemModel[]; filteredResearchers: ExternalSourcesItemModel[]; + filteredProfiles: ExternalSourcesItemModel[]; constructor( private dataManagementPlanService: DataManagementPlanService, @@ -140,4 +142,23 @@ export class DataManagementPlanEditorComponent implements AfterViewInit { }); } } + + filterProfiles(value: string): void { + + this.filteredProfiles = undefined; + if (value) { + this.filteredProfilesAsync = true; + + this.externalSourcesService.searchDMPProfiles(value).subscribe(items => { + this.filteredProfiles = items; + this.filteredProfilesAsync = 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 4d8fb963f..b52463f67 100644 --- a/dmp-frontend/src/app/models/data-managemnt-plans/DataManagementPlanModel.ts +++ b/dmp-frontend/src/app/models/data-managemnt-plans/DataManagementPlanModel.ts @@ -8,6 +8,7 @@ import { ProjectModel } from "../projects/ProjectModel"; import { OrganisationModel } from "../organisation/OrganisationModel"; import { ResearcherModel } from "../researcher/ResearcherModel"; import { JsonSerializer } from "../../utilities/JsonSerializer"; +import { ProfileModel } from "../profile/ProfileModel"; export class DataManagementPlanModel implements Serializable { public id: String; @@ -19,6 +20,7 @@ export class DataManagementPlanModel implements Serializable().fromJSONObject(item.project, ProjectModel); this.organisations = new JsonSerializer().fromJSONArray(item.organisations, OrganisationModel); this.researchers = new JsonSerializer().fromJSONArray(item.researchers, ResearcherModel); + this.profiles = new JsonSerializer().fromJSONArray(item.profiles, ProfileModel); return this; } @@ -49,6 +52,7 @@ export class DataManagementPlanModel implements Serializable { + public id: String; + public name: String; + public description: String; + public reference: String; + + fromJSONObject(item: any): ProfileModel { + this.id = item.id; + this.name = item.name; + this.description = item.abbreviation; + this.reference = item.reference; + + return this; + } +} \ No newline at end of file diff --git a/dmp-frontend/src/app/services/external-sources/external-sources.service.ts b/dmp-frontend/src/app/services/external-sources/external-sources.service.ts index 73b0f17f8..dbf380b31 100644 --- a/dmp-frontend/src/app/services/external-sources/external-sources.service.ts +++ b/dmp-frontend/src/app/services/external-sources/external-sources.service.ts @@ -41,4 +41,8 @@ export class ExternalSourcesService { public searchDMPOrganizations(like: string): Observable { return this.http.get(this.actionUrl + "organisations" + "?query=" + like, { headers: this.headers }); } + + public searchDMPProfiles(like: string): Observable { + return this.http.get(this.actionUrl + "profiles/get" + "?query=" + like, { headers: this.headers }); + } } diff --git a/dmp-frontend/src/assets/lang/en.json b/dmp-frontend/src/assets/lang/en.json index d1197085d..2b9903bd6 100644 --- a/dmp-frontend/src/assets/lang/en.json +++ b/dmp-frontend/src/assets/lang/en.json @@ -79,7 +79,8 @@ "NAME": "Name", "DESCRIPTION": "Description", "ORGANISATIONS": "Organisations", - "RESEARCHERS": "Researchers" + "RESEARCHERS": "Researchers", + "PROFILES":"Profiles" }, "ACTIONS": { "SAVE": "Save",