From 32eff9b523a088028c205a1d74fed1ac41d62026 Mon Sep 17 00:00:00 2001 From: Ioannis Kalyvas Date: Tue, 24 Jul 2018 14:19:52 +0300 Subject: [PATCH] no message --- .../eu/eudat/controllers/Organisations.java | 2 +- .../dataset-wizard.component.ts | 2 +- .../app/dmps/editor/dmp-editor.component.html | 88 ++++----- .../app/dmps/editor/dmp-editor.component.ts | 101 ++++++---- .../dynamic-field-project.component.ts | 2 +- .../editor/dmp-wizard-editor.component.html | 151 ++++++++------- .../editor/dmp-wizard-editor.component.ts | 24 ++- .../autocomplete-remote.component.ts | 2 +- .../src/app/models/projects/ProjectModel.ts | 2 +- .../editor/project-editor.component.html | 4 +- .../AutoCompleteConfiguration.ts | 0 .../auto-complete/auto-complete.component.ts | 2 +- .../autocomplete/autocomplete.component.html | 40 ---- .../autocomplete/autocomplete.component.scss | 30 --- .../autocomplete/autocomplete.component.ts | 172 ------------------ .../multiple-auto-complete-configuration.ts | 20 ++ .../multiple-auto-complete.component.html | 20 ++ .../multiple-auto-complete.component.scss | 14 ++ .../multiple-auto-complete.component.ts | 163 +++++++++++++++++ .../single-auto-complete-configuration.ts | 20 ++ .../single-auto-complete.component.html | 15 ++ .../single-auto-complete.component.scss | 17 ++ .../single/single-auto-complete.component.ts | 120 ++++++++++++ .../external-item-listing.component.ts | 2 +- .../external-item/external-item.component.ts | 2 +- dmp-frontend/src/app/shared/shared.module.ts | 16 +- dmp-frontend/src/assets/lang/en.json | 2 +- 27 files changed, 598 insertions(+), 435 deletions(-) rename dmp-frontend/src/app/shared/components/{autocomplete => auto-complete}/AutoCompleteConfiguration.ts (100%) delete mode 100644 dmp-frontend/src/app/shared/components/autocomplete/autocomplete.component.html delete mode 100644 dmp-frontend/src/app/shared/components/autocomplete/autocomplete.component.scss delete mode 100644 dmp-frontend/src/app/shared/components/autocomplete/autocomplete.component.ts create mode 100644 dmp-frontend/src/app/shared/components/autocompletes/multiple/multiple-auto-complete-configuration.ts create mode 100644 dmp-frontend/src/app/shared/components/autocompletes/multiple/multiple-auto-complete.component.html create mode 100644 dmp-frontend/src/app/shared/components/autocompletes/multiple/multiple-auto-complete.component.scss create mode 100644 dmp-frontend/src/app/shared/components/autocompletes/multiple/multiple-auto-complete.component.ts create mode 100644 dmp-frontend/src/app/shared/components/autocompletes/single/single-auto-complete-configuration.ts create mode 100644 dmp-frontend/src/app/shared/components/autocompletes/single/single-auto-complete.component.html create mode 100644 dmp-frontend/src/app/shared/components/autocompletes/single/single-auto-complete.component.scss create mode 100644 dmp-frontend/src/app/shared/components/autocompletes/single/single-auto-complete.component.ts diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/Organisations.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/Organisations.java index 25c7dbc38..7af94126b 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/Organisations.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/Organisations.java @@ -33,7 +33,7 @@ public class Organisations extends BaseController { try { List> remoteRepos = this.getApiContext().getOperationsContext().getRemoteFetcher().getOrganisations(query,type); OrganisationsExternalSourcesModel projectsExternalSourcesModel = new OrganisationsExternalSourcesModel().fromExternalItem(remoteRepos); - return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem().payload(projectsExternalSourcesModel).status(ApiMessageCode.SUCCESS_MESSAGE)); + return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem().payload(projectsExternalSourcesModel).status(ApiMessageCode.NO_MESSAGE)); } catch (NoURLFound ex) { return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem().status(ApiMessageCode.ERROR_MESSAGE).message("External Url Not Found")); } catch (HugeResultSet ex) { diff --git a/dmp-frontend/src/app/datasets/dataset-wizard/dataset-wizard.component.ts b/dmp-frontend/src/app/datasets/dataset-wizard/dataset-wizard.component.ts index 56161dea6..5472a51b3 100644 --- a/dmp-frontend/src/app/datasets/dataset-wizard/dataset-wizard.component.ts +++ b/dmp-frontend/src/app/datasets/dataset-wizard/dataset-wizard.component.ts @@ -19,7 +19,6 @@ import { Component, ViewChild, OnInit, AfterViewInit, ViewEncapsulation, Templat import { FormGroup, Validators, FormBuilder, FormArray } from "@angular/forms"; import * as FileSaver from 'file-saver'; import { MatPaginator, MatSort, MatSnackBar, MatStepper } from "@angular/material"; -import { AutoCompleteConfiguration } from '../../shared/components/autocomplete/AutoCompleteConfiguration'; import { ExternalDatasetCriteria } from '../../models/criteria/external-dataset/ExternalDatasetCriteria'; import { ExternalDatasetModel } from '../../models/external-dataset/ExternalDatasetModel'; import { RegistryCriteria } from '../../models/criteria/registry/RegistryCriteria'; @@ -35,6 +34,7 @@ import { Observable } from 'rxjs/Observable'; import { BreadcrumbItem } from '../../shared/components/breadcrumb/definition/breadcrumb-item'; import { TagsCriteria } from '../../models/criteria/tags/TagsCriteria'; import { TagModel } from '../../models/tags/TagModel'; +import { AutoCompleteConfiguration } from '../../shared/components/auto-complete/AutoCompleteConfiguration'; @Component({ selector: 'app-dataset-wizard-component', 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 8eb65f4e3..c521caed1 100644 --- a/dmp-frontend/src/app/dmps/editor/dmp-editor.component.html +++ b/dmp-frontend/src/app/dmps/editor/dmp-editor.component.html @@ -44,67 +44,45 @@ {{'GENERAL.VALIDATION.REQUIRED' | translate}} - - - +
+ + +
- - - -
{{chip.label.substring(0, 1).toUpperCase()}}
- {{chip.label}} -
- -
- {{option.label}} +
+
+ + +
+
- - - - {{'GENERAL.VALIDATION.REQUIRED' | translate}} - - +
+
- View All - - - - -
{{chip.name.substring(0, 1).toUpperCase()}}
- {{chip.name}} -
- -
- {{option.name}} -
-
- -
- - -
{{chip.name.substring(0, 1).toUpperCase()}}
- {{chip.name}} -
- -
- {{option.name}} -
-
- -
- - + + +
+
+
+
+ + +
+
+ +
+

{{'DMP-EDITOR.FIELDS.PROFILE' | translate}}

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 a462f6859..6d89edf16 100644 --- a/dmp-frontend/src/app/dmps/editor/dmp-editor.component.ts +++ b/dmp-frontend/src/app/dmps/editor/dmp-editor.component.ts @@ -16,7 +16,6 @@ import { RequestItem } from "../../models/criteria/RequestItem"; import { DatasetProfileCriteria } from "../../models/criteria/dataset/DatasetProfileCriteria"; import { DataManagementPlanCriteriaComponent } from "../../shared/components/criteria/data-management-plan/dmp-criteria.component"; 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 "../../models/dmpUsers/DmpUsersModel"; @@ -32,6 +31,8 @@ import { DataManagementPlanProfile } from "../../models/data-management-plan-pro import { LanguageResolverService } from "../../services/language-resolver/language-resolver.service"; import { IBreadCrumbComponent } from "../../shared/components/breadcrumb/definition/IBreadCrumbComponent"; import { BreadcrumbItem } from "../../shared/components/breadcrumb/definition/breadcrumb-item"; +import { SingleAutoCompleteConfiguration } from "../../shared/components/autocompletes/single/single-auto-complete-configuration"; +import { MultipleAutoCompleteConfiguration } from "../../shared/components/autocompletes/multiple/multiple-auto-complete-configuration"; @Component({ selector: 'app-dmp-editor-component', @@ -55,7 +56,11 @@ export class DataManagementPlanEditorComponent implements AfterViewInit, IBreadC filteredResearchers: ExternalSourcesItemModel[]; filteredProfiles: DatasetProfileModel[]; - projectAutoCompleteConfiguration: AutoCompleteConfiguration; + projectAutoCompleteConfiguration: SingleAutoCompleteConfiguration; + profilesAutoCompleteConfiguration: MultipleAutoCompleteConfiguration; + organisationsAutoCompleteConfiguration: MultipleAutoCompleteConfiguration; + researchersAutoCompleteConfiguration: MultipleAutoCompleteConfiguration; + createNewVersion; associatedUsers: Array filteredOptions: Observable @@ -86,7 +91,42 @@ export class DataManagementPlanEditorComponent implements AfterViewInit, IBreadC projectRequestItem.criteria = new ProjectCriteria(); let organisationRequestItem: RequestItem = new RequestItem(); organisationRequestItem.criteria = new BaseCriteria(); - this.projectAutoCompleteConfiguration = new AutoCompleteConfiguration(this.projectService.getWithExternal.bind(this.projectService), projectRequestItem); + //this.projectAutoCompleteConfiguration = new AutoCompleteConfiguration(this.projectService.getWithExternal.bind(this.projectService), projectRequestItem); + + + this.projectAutoCompleteConfiguration = { + filterFn: this.searchProject.bind(this), + items: this.searchProject(''), + displayFn: (item) => item["label"], + titleFn: (item) => item["label"], + //mapFn: (item) => new JsonSerializer().fromJSONArray(item, ProjectReference).map(item => item.toDropdownList()), + loadDataOnStart: true + }; + + this.profilesAutoCompleteConfiguration = { + filterFn: this.filterProfiles.bind(this), + initialItems: (excludedItems: any[]) => this.filterProfiles('').map(result => result.filter(x => excludedItems.map(x => x.id).indexOf(x.id) == -1)), + displayFn: (item) => item["label"], + titleFn: (item) => item["label"], + //mapFn: (item) => new JsonSerializer().fromJSONArray(item, ProjectReference).map(item => item.toDropdownList()), + loadDataOnStart: true + }; + + this.organisationsAutoCompleteConfiguration = { + filterFn: this.filterOrganisations.bind(this), + initialItems: (excludedItems: any[]) => this.filterOrganisations('').map(result => result.filter(x => excludedItems.map(x => x.id).indexOf(x.id) == -1)), + displayFn: (item) => item["name"], + titleFn: (item) => item["name"], + loadDataOnStart: true + }; + + this.researchersAutoCompleteConfiguration = { + filterFn: this.filterResearchers.bind(this), + initialItems: (excludedItems: any[]) => this.filterResearchers('').map(result => result.filter(x => excludedItems.map(x => x.id).indexOf(x.id) == -1)), + displayFn: (item) => item["name"], + titleFn: (item) => item["name"], + loadDataOnStart: true + }; if (itemId != null) { this.isNew = false; @@ -133,6 +173,13 @@ export class DataManagementPlanEditorComponent implements AfterViewInit, IBreadC }); } + searchProject(query: string) { + let projectRequestItem: RequestItem = new RequestItem(); + projectRequestItem.criteria = new ProjectCriteria(); + projectRequestItem.criteria.like = query; + return this.projectService.getWithExternal(projectRequestItem); + } + formSubmit(): void { //this.touchAllFormFields(this.formGroup); if (!this.isFormValid()) { return; } @@ -177,54 +224,32 @@ export class DataManagementPlanEditorComponent implements AfterViewInit, IBreadC this.router.navigate(['/invite/' + this.dataManagementPlan.id]); } - filterOrganisations(value: string): void { + filterOrganisations(value: string): Observable { this.filteredOrganisations = undefined; - if (value) { - this.filteringOrganisationsAsync = true; + 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; - // }); - - }); - - } + return this.externalSourcesService.searchDMPOrganizations(value) } - filterResearchers(value: string): void { + filterResearchers(value: string): Observable { this.filteredResearchers = undefined; - if (value) { - this.filteringResearchersAsync = true; + this.filteringResearchersAsync = true; - this.externalSourcesService.searchDMPResearchers({ criteria: { name: value, like: null } }).subscribe(items => { - this.filteredResearchers = items; - this.filteringResearchersAsync = false; - - }); - } + return this.externalSourcesService.searchDMPResearchers({ criteria: { name: value, like: null } }) } - filterProfiles(value: string): void { + filterProfiles(value: string): Observable { this.filteredProfiles = undefined; - if (value) { - this.filteredProfilesAsync = true; + this.filteredProfilesAsync = true; - const request = new RequestItem(); - let criteria = new DatasetProfileCriteria(); - criteria.like = value; - request.criteria = criteria; - this._service.searchDMPProfiles(request).subscribe(items => { - this.filteredProfiles = items; - this.filteredProfilesAsync = false; - }); - } + const request = new RequestItem(); + let criteria = new DatasetProfileCriteria(); + criteria.like = value; + request.criteria = criteria; + return this._service.searchDMPProfiles(request) } addResearcher(rowId: any, rowName: any) { diff --git a/dmp-frontend/src/app/dmps/editor/dynamic-fields-project/dynamic-field-project/dynamic-field-project.component.ts b/dmp-frontend/src/app/dmps/editor/dynamic-fields-project/dynamic-field-project/dynamic-field-project.component.ts index c1ceb8688..f394def31 100644 --- a/dmp-frontend/src/app/dmps/editor/dynamic-fields-project/dynamic-field-project/dynamic-field-project.component.ts +++ b/dmp-frontend/src/app/dmps/editor/dynamic-fields-project/dynamic-field-project/dynamic-field-project.component.ts @@ -1,12 +1,12 @@ import { Component, ViewEncapsulation, OnInit, Input, ViewChild } from "@angular/core"; import { FormGroup } from "@angular/forms"; import { DataManagementPlanService } from "../../../../services/data-management-plan/data-management-plan.service"; -import { AutoCompleteConfiguration } from "../../../../shared/components/autocomplete/AutoCompleteConfiguration"; import { RequestItem } from "../../../../models/criteria/RequestItem"; import { DynamicFieldProjectCriteria, DynamicFieldProjectCriteriaDependencies } from "../../../../models/dynamic-field-project/DynamicFieldProjectCriteria"; import { AutoCompleteComponent } from "../../../../shared/components/auto-complete/auto-complete.component"; import { DynamicFieldDependency } from "../../../../models/data-managemnt-plans/DynamicFieldDependency"; import { LanguageResolverService } from "../../../../services/language-resolver/language-resolver.service"; +import { AutoCompleteConfiguration } from "../../../../shared/components/auto-complete/AutoCompleteConfiguration"; @Component({ selector: 'app-dynamic-field-project', diff --git a/dmp-frontend/src/app/dmps/wizard/editor/dmp-wizard-editor.component.html b/dmp-frontend/src/app/dmps/wizard/editor/dmp-wizard-editor.component.html index 7ec69416c..0568134d9 100644 --- a/dmp-frontend/src/app/dmps/wizard/editor/dmp-wizard-editor.component.html +++ b/dmp-frontend/src/app/dmps/wizard/editor/dmp-wizard-editor.component.html @@ -1,86 +1,83 @@
-
- - - - - {{baseErrorModel.label}} - {{'GENERAL.VALIDATION.REQUIRED' | translate}} - + + + + + + {{baseErrorModel.label}} + {{'GENERAL.VALIDATION.REQUIRED' | translate}} + - - - {{errorModel.description}} - {{'GENERAL.VALIDATION.REQUIRED' | translate}} - + + + {{errorModel.description}} + {{'GENERAL.VALIDATION.REQUIRED' | translate}} + - - - - -
{{chip.label.substring(0, 1).toUpperCase()}}
- {{chip.label}} -
- -
- {{option.label}} -
-
- - {{'GENERAL.VALIDATION.REQUIRED' | translate}} -
+ + - + + +
{{chip.label.substring(0, 1).toUpperCase()}}
+ {{chip.label}} +
+ +
+ {{option.label}} +
+
+ + {{'GENERAL.VALIDATION.REQUIRED' | translate}} +
- - -
{{chip.name.substring(0, 1).toUpperCase()}}
- {{chip.name}} -
- -
- {{option.name}} -
-
- -
+ + +
{{chip.name.substring(0, 1).toUpperCase()}}
+ {{chip.name}} +
+ +
+ {{option.name}} +
+
+ +
- - -
{{chip.name.substring(0, 1).toUpperCase()}}
- {{chip.name}} -
- -
- {{option.name}} -
-
- -
+ + +
{{chip.name.substring(0, 1).toUpperCase()}}
+ {{chip.name}} +
+ +
+ {{option.name}} +
+
+ +
- - - - + + + + - -

Associated Users

- - person -
{{user.name}}
-
-
-
-
- - -
\ No newline at end of file + +

Associated Users

+ + person +
{{user.name}}
+
+
+ + + + +
diff --git a/dmp-frontend/src/app/dmps/wizard/editor/dmp-wizard-editor.component.ts b/dmp-frontend/src/app/dmps/wizard/editor/dmp-wizard-editor.component.ts index c2ac40210..6fa424831 100644 --- a/dmp-frontend/src/app/dmps/wizard/editor/dmp-wizard-editor.component.ts +++ b/dmp-frontend/src/app/dmps/wizard/editor/dmp-wizard-editor.component.ts @@ -6,7 +6,6 @@ import { JsonSerializer } from '../../../utilities/JsonSerializer'; import { RequestItem } from '../../../models/criteria/RequestItem'; import { ProjectCriteria } from '../../../models/criteria/project/ProjectCriteria'; import { DmpUsersModel } from '../../../models/dmpUsers/DmpUsersModel'; -import { AutoCompleteConfiguration } from '../../../shared/components/autocomplete/AutoCompleteConfiguration'; import { ExternalSourcesItemModel } from '../../../models/external-sources/ExternalSourcesItemModel'; import { DataManagementPlanModel } from '../../../models/data-managemnt-plans/DataManagementPlanModel'; import { ProjectService } from '../../../services/project/project.service'; @@ -20,6 +19,8 @@ import { DataSource } from "@angular/cdk/table"; import { Observable } from "rxjs/Observable"; import { FormGroup } from '@angular/forms'; import { BaseCriteria } from '../../../models/criteria/BaseCriteria'; +import { SingleAutoCompleteConfiguration } from '../../../shared/components/autocompletes/single/single-auto-complete-configuration'; +import { LanguageResolverService } from '../../../services/language-resolver/language-resolver.service'; @Component({ @@ -41,7 +42,7 @@ export class DataManagementPlanWizardEditorComponent implements AfterViewInit { filteredResearchers: ExternalSourcesItemModel[]; filteredProfiles: DatasetProfileModel[]; - projectAutoCompleteConfiguration: AutoCompleteConfiguration; + projectAutoCompleteConfiguration: SingleAutoCompleteConfiguration; createNewVersion; associatedUsers: Array labelDisabled: boolean = false; @@ -54,7 +55,8 @@ export class DataManagementPlanWizardEditorComponent implements AfterViewInit { public snackBar: MatSnackBar, public router: Router, public language: TranslateService, - private _service: DataManagementPlanService + private _service: DataManagementPlanService, + private languageResolverService: LanguageResolverService ) { } @@ -63,7 +65,14 @@ export class DataManagementPlanWizardEditorComponent implements AfterViewInit { let projectRequestItem: RequestItem = new RequestItem(); projectRequestItem.criteria = new ProjectCriteria(); - this.projectAutoCompleteConfiguration = new AutoCompleteConfiguration(this.projectService.getWithExternal.bind(this.projectService), projectRequestItem); + this.projectAutoCompleteConfiguration = { + filterFn: this.searchProject.bind(this.projectService), + items: this.searchProject(''), + displayFn: (item) => item["label"], + titleFn: (item) => item["label"], + //mapFn: (item) => new JsonSerializer().fromJSONArray(item, ProjectReference).map(item => item.toDropdownList()), + loadDataOnStart: true + }; let organisationRequestItem: RequestItem = new RequestItem(); organisationRequestItem.criteria = new BaseCriteria(); @@ -76,6 +85,13 @@ export class DataManagementPlanWizardEditorComponent implements AfterViewInit { }) } + searchProject(query: string) { + let projectRequestItem: RequestItem = new RequestItem(); + projectRequestItem.criteria = new ProjectCriteria(); + projectRequestItem.criteria.like = query; + return this.projectService.getWithExternal(projectRequestItem); + } + formSubmit(): void { //this.touchAllFormFields(this.formGroup); if (!this.isFormValid()) { return; } diff --git a/dmp-frontend/src/app/form/dynamic-fields/dynamic-field-autocomplete/autocomplete-remote.component.ts b/dmp-frontend/src/app/form/dynamic-fields/dynamic-field-autocomplete/autocomplete-remote.component.ts index 9b097916d..c0ab5edd7 100644 --- a/dmp-frontend/src/app/form/dynamic-fields/dynamic-field-autocomplete/autocomplete-remote.component.ts +++ b/dmp-frontend/src/app/form/dynamic-fields/dynamic-field-autocomplete/autocomplete-remote.component.ts @@ -3,10 +3,10 @@ import { Component, OnInit, Input, Output, EventEmitter, forwardRef, ViewEncapsu import { ControlValueAccessor, FormControl, FormGroup, NG_VALUE_ACCESSOR, Validators } from '@angular/forms'; import { DatasetProfileService } from '../../../services/dataset-profile.service'; import { ActivatedRoute } from '@angular/router'; -import { AutoCompleteConfiguration } from '../../../shared/components/autocomplete/AutoCompleteConfiguration'; import { RequestItem } from '../../../models/criteria/RequestItem'; import { BaseCriteria } from '../../../models/criteria/BaseCriteria'; import { AutocompleteLookupItem } from '../../../models/auto-complete/AutocompleteLookupItem'; +import { AutoCompleteConfiguration } from '../../../shared/components/auto-complete/AutoCompleteConfiguration'; declare var $: any; diff --git a/dmp-frontend/src/app/models/projects/ProjectModel.ts b/dmp-frontend/src/app/models/projects/ProjectModel.ts index 3b7cb5727..e2ee423ba 100644 --- a/dmp-frontend/src/app/models/projects/ProjectModel.ts +++ b/dmp-frontend/src/app/models/projects/ProjectModel.ts @@ -66,7 +66,7 @@ export class ProjectModel implements Serializable { const baseContext: ValidationContext = new ValidationContext(); baseContext.validation.push({ key: 'id', validators: [] }); baseContext.validation.push({ key: 'label', validators: [Validators.required, BackendErrorValidator(this.errorModel, 'label')] }); - baseContext.validation.push({ key: 'abbreviation', validators: [Validators.required, BackendErrorValidator(this.errorModel, 'abbreviation')] }); + baseContext.validation.push({ key: 'abbreviation', validators: [BackendErrorValidator(this.errorModel, 'abbreviation')] }); baseContext.validation.push({ key: 'uri', validators: [BackendErrorValidator(this.errorModel, 'uri')] }); baseContext.validation.push({ key: 'type', validators: [BackendErrorValidator(this.errorModel, 'type')] }); baseContext.validation.push({ key: 'status', validators: [] }); diff --git a/dmp-frontend/src/app/projects/editor/project-editor.component.html b/dmp-frontend/src/app/projects/editor/project-editor.component.html index 6a7270a7f..d42b296f5 100644 --- a/dmp-frontend/src/app/projects/editor/project-editor.component.html +++ b/dmp-frontend/src/app/projects/editor/project-editor.component.html @@ -28,10 +28,8 @@ - + {{baseErrorModel.abbreviation}} - {{'GENERAL.VALIDATION.REQUIRED' | translate}} diff --git a/dmp-frontend/src/app/shared/components/autocomplete/AutoCompleteConfiguration.ts b/dmp-frontend/src/app/shared/components/auto-complete/AutoCompleteConfiguration.ts similarity index 100% rename from dmp-frontend/src/app/shared/components/autocomplete/AutoCompleteConfiguration.ts rename to dmp-frontend/src/app/shared/components/auto-complete/AutoCompleteConfiguration.ts diff --git a/dmp-frontend/src/app/shared/components/auto-complete/auto-complete.component.ts b/dmp-frontend/src/app/shared/components/auto-complete/auto-complete.component.ts index ce290362c..5dbe8b5ec 100644 --- a/dmp-frontend/src/app/shared/components/auto-complete/auto-complete.component.ts +++ b/dmp-frontend/src/app/shared/components/auto-complete/auto-complete.component.ts @@ -1,7 +1,7 @@ import { Input, OnInit, Component, AfterViewInit, Output, EventEmitter, OnChanges } from '@angular/core'; import { FormGroup, FormControl, FormGroupDirective, NgForm } from '@angular/forms'; import { ErrorStateMatcher } from '@angular/material'; -import { AutoCompleteConfiguration } from '../autocomplete/AutoCompleteConfiguration'; +import { AutoCompleteConfiguration } from './AutoCompleteConfiguration'; @Component({ selector: 'app-auto-complete', diff --git a/dmp-frontend/src/app/shared/components/autocomplete/autocomplete.component.html b/dmp-frontend/src/app/shared/components/autocomplete/autocomplete.component.html deleted file mode 100644 index 4e7fec9a9..000000000 --- a/dmp-frontend/src/app/shared/components/autocomplete/autocomplete.component.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - {{'GENERAL.VALIDATION.REQUIRED' | translate}} - - - - {{item[titleKey]}} - {{item[subtitleKey]}} - - - - diff --git a/dmp-frontend/src/app/shared/components/autocomplete/autocomplete.component.scss b/dmp-frontend/src/app/shared/components/autocomplete/autocomplete.component.scss deleted file mode 100644 index 6e7ec5cf9..000000000 --- a/dmp-frontend/src/app/shared/components/autocomplete/autocomplete.component.scss +++ /dev/null @@ -1,30 +0,0 @@ -.autocomplete-input { - width: 100%; -} - -.autocomplete-progress { - overflow: initial !important; -} - -.autocomplete { - mat-form-field { - width: 100%; - padding: 3px; - } - - .mat-card { - margin: 16px 0; - } - - .left-button { - float: left; - } -} - -.input-table { - table-layout: fixed; -} - -.full-width { - width: 100%; -} diff --git a/dmp-frontend/src/app/shared/components/autocomplete/autocomplete.component.ts b/dmp-frontend/src/app/shared/components/autocomplete/autocomplete.component.ts deleted file mode 100644 index d37539754..000000000 --- a/dmp-frontend/src/app/shared/components/autocomplete/autocomplete.component.ts +++ /dev/null @@ -1,172 +0,0 @@ -import { any } from 'codelyzer/util/function'; -import { FormControl, FormGroupDirective, NgForm, FormGroup, FormBuilder } from '@angular/forms'; -import { Observable } from 'rxjs/Rx'; -import { setTimeout } from 'timers'; -import { Component, EventEmitter, Input, OnInit, Output, ViewChild, ElementRef } from '@angular/core'; -import 'rxjs/add/operator/debounceTime'; -import 'rxjs/add/operator/map'; -import { AutoCompleteConfiguration } from './AutoCompleteConfiguration'; -import { ErrorStateMatcher, MatInput } from '@angular/material'; - -@Component({ - selector: 'auto-complete', - templateUrl: './autocomplete.component.html', - styleUrls: ['./autocomplete.component.scss'] -}) -export class AutocompleteComponent implements OnInit { - - @Input() - disabled = false; - - @Input() - public configuration: AutoCompleteConfiguration; - - @Input() - titleKey: String; - - @Input() - subtitleKey: String; - - @Input() - delay: number = 700; - - @Input() - placeholder: String; - - filteredItems: any[]; - - // @Input() - // validationErrorString: String; - - // public errorStateMatcher: AutoCompleteErrorStateMatcher = new AutoCompleteErrorStateMatcher(); - - @Input() - required: boolean; - - // @Input() selectedDropdownItem: AutoCompleteItem; - // @Output() selectedDropdownItemChange = new EventEmitter(); - - // @Output() - // output: EventEmitter = new EventEmitter(); - - @Input() control: FormControl; - - // @Input() createNew = false; - // //term = new FormControl(); - // @Input() - // ClickFunctionCall: Function; - - loading = false; - hasSelectedItem = false; - - - constructor() { - - } - - ngOnInit() { - - const valueChanges = this.control.valueChanges.share(); - valueChanges.subscribe(searchTerm => { - if (this.hasSelectedItem) { - this.resetFormControlValue(); - } else { - this.loading = true; - } - }); - valueChanges - .debounceTime(this.delay) - .distinctUntilChanged() - .switchMap(val => { - if (this.hasSelectedItem) { - this.loading = false; - return []; - } - - this.configuration.requestItem.criteria.like = this.control.value; - return this.configuration.callback(this.configuration.requestItem).map(result => { - this.filteredItems = (result) - this.loading = false; - }) - }).subscribe() - - // this.filteredItems = this.inputField.nativeElement.valueChanges.startWith(null) - // .debounceTime(this.delay) - // .finally(() => this.loading = false) - // .distinctUntilChanged() - // .switchMap(val => { - // this.configuration.requestItem.criteria.like = val; - // return this.configuration.callback(this.configuration.requestItem) - // }) - // const valueChanges = this.form.controls['text'].valueChanges.share(); - // valueChanges.subscribe(searchTerm => { - // this.loading = true; - // if (this.form.controls['value'].value) { - // this.resetFormGroupValue(); - // } - // }); - - // valueChanges - // .debounceTime(this.typeaheadMS) - // .subscribe(searchTerm => { - // if (typeof searchTerm === 'string') { - // this.inputOnChange(searchTerm) - // } - // }); - } - - resetFormControlValue() { - this.hasSelectedItem = false; - //this.control.setValue(null, { emitEvent: false }); - } - - // // listingItemToDropDown(item: DropdownListingItem): AutoCompleteItem { - // // return (item as DropdownListingItem).toDropdownList(); - // // } - - optionSelected(event: any) { - this.hasSelectedItem = true; - this.control.setValue(event.option.value, { emitEvent: false }); - this.filteredItems = [event.option.value]; - - //this.selectedDropdownItemChange.emit(event.option.value); - //this.form.updateValueAndValidity(); - //this.options = [event.option.value]; - //this.loading = false; - } - - // inputOnChange(term: string) { - // //this.form.patchValue({ value: null, description: '', text: '' }); - // //this.form.updateValueAndValidity(); - // this.configuration.criteria.like = term; - // this.configuration.callback(this.configuration.criteria) - // .map((res: any) => this.mapper(res)) - // .subscribe( - // (res: AutoCompleteItem[]) => { - // this.options = res; - // }, - // null, - // () => { this.loading = false }); - // } - - displayWith(value: any): String { - if (!value) return ''; - return value['' + this.titleKey]; - } - // displayFn(item: AutoCompleteItem): string { - // return item.text ? item.text : ''; - // } - - //fieldHasErrors(control: FormControl, form: FormGroupDirective | NgForm): boolean { - // return this.errorStateMatcher(control, form); - // } -} - -export class AutoCompleteErrorStateMatcher implements ErrorStateMatcher { - isErrorState(control: FormControl | null, form: FormGroupDirective | NgForm | null): boolean { - const isFormSubmitted = form && form.submitted; - const isControlInvalid = control && control.invalid && (control.dirty || control.touched || isFormSubmitted); - const isFormInvalid = form && form.enabled && form.invalid && (form.dirty || form.touched || isFormSubmitted) - return !!(isControlInvalid || isFormInvalid); - } -} \ No newline at end of file diff --git a/dmp-frontend/src/app/shared/components/autocompletes/multiple/multiple-auto-complete-configuration.ts b/dmp-frontend/src/app/shared/components/autocompletes/multiple/multiple-auto-complete-configuration.ts new file mode 100644 index 000000000..986d6e97f --- /dev/null +++ b/dmp-frontend/src/app/shared/components/autocompletes/multiple/multiple-auto-complete-configuration.ts @@ -0,0 +1,20 @@ +import { Observable } from 'rxjs'; + +export interface MultipleAutoCompleteConfiguration { + // Delay for performing the request. Default: 200ms. + requestDelay?: number; + // Min characters for the filtering to be applied. Default: 3. + minFilteringChars?: number; + // Load and present items from start, without user query. Default: true. + loadDataOnStart?: boolean; + // Static or initial items. + initialItems?: (excludedItems: any[]) => Observable; + // Data retrieval function + filterFn?: (searchQuery: string, excludedItems: any[]) => Observable; + // Property formating for input + displayFn?: (item: any) => string; + // Property formating for dropdown + titleFn?: (item: any) => string; + // Property formating for dropdown + subtitleFn?: (item: any) => string; +} diff --git a/dmp-frontend/src/app/shared/components/autocompletes/multiple/multiple-auto-complete.component.html b/dmp-frontend/src/app/shared/components/autocompletes/multiple/multiple-auto-complete.component.html new file mode 100644 index 000000000..b277251ea --- /dev/null +++ b/dmp-frontend/src/app/shared/components/autocompletes/multiple/multiple-auto-complete.component.html @@ -0,0 +1,20 @@ + + + + {{this._displayFn(selectedItem)}} + cancel + + + + {{validationErrorString}} + {{'GENERAL.VALIDATION.REQUIRED' | translate}} + {{'GENERAL.VALIDATION.INVALID-JSON' | translate}} + + + + {{_titleFn(item)}} +
+ {{_subtitleFn(item)}} +
+
+
diff --git a/dmp-frontend/src/app/shared/components/autocompletes/multiple/multiple-auto-complete.component.scss b/dmp-frontend/src/app/shared/components/autocompletes/multiple/multiple-auto-complete.component.scss new file mode 100644 index 000000000..e9502d874 --- /dev/null +++ b/dmp-frontend/src/app/shared/components/autocompletes/multiple/multiple-auto-complete.component.scss @@ -0,0 +1,14 @@ +.multiple-auto-complete { + width: 100%; + .mat-form-field { + padding: 0 3px; + } + .not-loading { + display: none; + } +} + +.two-line-mat-option { + height: 3.5em; + line-height: 1.2em; +} diff --git a/dmp-frontend/src/app/shared/components/autocompletes/multiple/multiple-auto-complete.component.ts b/dmp-frontend/src/app/shared/components/autocompletes/multiple/multiple-auto-complete.component.ts new file mode 100644 index 000000000..7aa74d16d --- /dev/null +++ b/dmp-frontend/src/app/shared/components/autocompletes/multiple/multiple-auto-complete.component.ts @@ -0,0 +1,163 @@ +import { Input, OnInit, Component, Output, EventEmitter, ViewChild, ElementRef, QueryList, AfterViewInit } from '@angular/core'; +import { FormControl, FormGroupDirective, NgForm, FormArray, AbstractControl, FormGroup, FormBuilder, Validators } from '@angular/forms'; +import { ErrorStateMatcher, MatChipInputEvent, MatAutocompleteSelectedEvent, MatChipList, MatAutocompleteTrigger } from '@angular/material'; +import { TranslateService } from '@ngx-translate/core'; +import { Subject, Observable } from 'rxjs'; +import { map, startWith, merge, mapTo, mergeMap, timeout } from 'rxjs/operators'; +import { MultipleAutoCompleteConfiguration } from './multiple-auto-complete-configuration'; +import { ENTER } from '@angular/cdk/keycodes'; +import { COMMA } from '@angular/cdk/keycodes'; + +@Component({ + selector: 'app-multiple-auto-complete', + templateUrl: './multiple-auto-complete.component.html', + styleUrls: ['./multiple-auto-complete.component.scss'] +}) +export class MultipleAutoCompleteComponent implements OnInit { + + @ViewChild('textInput') textInput: ElementRef; + @ViewChild(MatAutocompleteTrigger) autocomplete: MatAutocompleteTrigger; + + @Input() reactiveFormControl: FormControl; + @Input() placeholder: string; + @Input() validationErrorString: string; + @Input() configuration: MultipleAutoCompleteConfiguration; + + // Selected Option Event + @Output() optionSelected: EventEmitter = new EventEmitter(); + + private requestDelay = 200; //ms + private minFilteringChars = 3; + private loadDataOnStart = true; + + loading = false; + _items: Observable; + + visible = true; + selectable = true; + removable = true; + addOnBlur = false; + separatorKeysCodes = [ENTER, COMMA]; + inputFormControl: FormControl; + + constructor() { + } + + ngOnInit() { + this.inputFormControl = new FormControl({ value: this.reactiveFormControl.value, disabled: this.reactiveFormControl.disabled }); + } + + filter(query: string): Observable { + // If loadDataOnStart is enabled and query is empty we return the initial items. + if (this.isNullOrEmpty(query) && this.loadDataOnStart) { + return this.configuration.initialItems(this.reactiveFormControl.value || []) || Observable.of([]); + } else if (query && query.length >= this.minFilteringChars) { + if (this.configuration.filterFn) { + return this.configuration.filterFn(query, this.reactiveFormControl.value || []); + } else { + return this.configuration.initialItems(this.reactiveFormControl.value || []) || Observable.of([]); + } + } else { + return Observable.of([]); + } + } + + isNullOrEmpty(query: string): boolean { + return typeof query !== 'string' || query === null || query.length === 0; + } + + _displayFn(item: any): string { + if (this.configuration.displayFn && item) { return this.configuration.displayFn(item); } + return item; + } + + _titleFn(item: any): string { + if (this.configuration.titleFn && item) { return this.configuration.titleFn(item); } + return item; + } + + _subtitleFn(item: any): string { + if (this.configuration.subtitleFn && item) { return this.configuration.subtitleFn(item); } + return null; + } + + _requestDelay(): number { + return this.configuration.requestDelay || this.requestDelay; + } + + _minFilteringChars(): number { + return this.configuration.minFilteringChars || this.minFilteringChars; + } + + _loadDataOnStart(): boolean { + return this.configuration.loadDataOnStart || this.loadDataOnStart; + } + + _chipItems(): any[] { + return this.reactiveFormControl.value || []; + } + + _optionSelected(event: MatAutocompleteSelectedEvent) { + const newValue = this.reactiveFormControl.value || []; + newValue.push(event.option.value); + this.reactiveFormControl.patchValue(newValue); + this.textInput.nativeElement.value = ''; + this.inputFormControl.setValue(null); + + this.optionSelected.emit(event.option.value); + } + + _onInputFocus() { + // We set the items observable on focus to avoid the request being executed on component load. + if (!this._items) { + this._items = this.inputFormControl.valueChanges + .startWith(null) + .debounceTime(this.requestDelay) + .distinctUntilChanged() + .do(() => { this.loading = true; }) + .flatMap(query => { + // If its a valid object, a selection just made and the object is set as the value of the form control. That means we should fire an extra request to the server. + if (this._isValidObject(query)) { return Observable.of([]); } + return this.filter(query); + }) + .do(() => { this.loading = false; }); + } + } + + _isValidObject(value: any): boolean { + try { + if (!value) { return false; } + if (typeof value !== 'object') { JSON.parse(value); } + } catch (e) { + return false; + } + return true; + } + + _removeSelectedItem(item: any): void { + const index = this.reactiveFormControl.value.indexOf(item); + if (index >= 0) { + this.reactiveFormControl.value.splice(index, 1); + } + } + + _onInputClick(item: any) { + if (!this.autocomplete.panelOpen) { + this.autocomplete.openPanel(); + } + } + + _addItem(event: MatChipInputEvent): void { + // const input = event.input; + // const value = event.value; + // // Add our fruit + // if ((value || '').trim()) { + // this.selectedItems.push(value.trim()); + // } + // // Reset the input value + // if (input) { + // input.value = ''; + // } + // this.inputFormControl.setValue(null); + } +} diff --git a/dmp-frontend/src/app/shared/components/autocompletes/single/single-auto-complete-configuration.ts b/dmp-frontend/src/app/shared/components/autocompletes/single/single-auto-complete-configuration.ts new file mode 100644 index 000000000..efd9f2b27 --- /dev/null +++ b/dmp-frontend/src/app/shared/components/autocompletes/single/single-auto-complete-configuration.ts @@ -0,0 +1,20 @@ +import { Observable } from 'rxjs'; + +export interface SingleAutoCompleteConfiguration { + // Delay for performing the request. Default: 200ms. + requestDelay?: number; + // Min characters for the filtering to be applied. Default: 3. + minFilteringChars?: number; + // Load and present items from start, without user query. Default: true. + loadDataOnStart?: boolean; + // Static or initial items. + items?: Observable; + // Data retrieval function + filterFn?: (searchQuery: string) => Observable; + // Property formating for input + displayFn?: (item: any) => string; + // Property formating for dropdown + titleFn?: (item: any) => string; + // Property formating for dropdown + subtitleFn?: (item: any) => string; +} diff --git a/dmp-frontend/src/app/shared/components/autocompletes/single/single-auto-complete.component.html b/dmp-frontend/src/app/shared/components/autocompletes/single/single-auto-complete.component.html new file mode 100644 index 000000000..9d86691be --- /dev/null +++ b/dmp-frontend/src/app/shared/components/autocompletes/single/single-auto-complete.component.html @@ -0,0 +1,15 @@ + + + {{validationErrorString}} + {{'GENERAL.VALIDATION.REQUIRED' | translate}} + {{'GENERAL.VALIDATION.INVALID-JSON' | translate}} + + + + + {{_titleFn(item)}} +
+ {{_subtitleFn(item)}} +
+
+
diff --git a/dmp-frontend/src/app/shared/components/autocompletes/single/single-auto-complete.component.scss b/dmp-frontend/src/app/shared/components/autocompletes/single/single-auto-complete.component.scss new file mode 100644 index 000000000..a0fa34dc6 --- /dev/null +++ b/dmp-frontend/src/app/shared/components/autocompletes/single/single-auto-complete.component.scss @@ -0,0 +1,17 @@ +.auto-complete { + width: 100%; + .mat-form-field { + padding: 0 3px; + } + .not-loading { + display: none; + } +} +.two-line-mat-option { + height: 3.5em; + line-height: 1.2em; +} + +// .mat-tooltip.warn-tooltip { +// background-color: mat-color($warn); +// } diff --git a/dmp-frontend/src/app/shared/components/autocompletes/single/single-auto-complete.component.ts b/dmp-frontend/src/app/shared/components/autocompletes/single/single-auto-complete.component.ts new file mode 100644 index 000000000..29e1cf0f0 --- /dev/null +++ b/dmp-frontend/src/app/shared/components/autocompletes/single/single-auto-complete.component.ts @@ -0,0 +1,120 @@ +import { Input, OnInit, Component, Output, EventEmitter, ViewChild, ElementRef, QueryList, AfterViewInit } from '@angular/core'; +import { FormControl, FormGroupDirective, NgForm, FormArray, AbstractControl, FormGroup, FormBuilder, Validators } from '@angular/forms'; +import { ErrorStateMatcher, MatChipInputEvent, MatAutocompleteSelectedEvent, MatChipList } from '@angular/material'; +import { TranslateService } from '@ngx-translate/core'; +import { Subject , Observable } from 'rxjs'; +import { map, startWith, merge, mapTo, mergeMap, timeout } from 'rxjs/operators'; +import { SingleAutoCompleteConfiguration } from './single-auto-complete-configuration'; + +@Component({ + selector: 'app-single-auto-complete', + templateUrl: './single-auto-complete.component.html', + styleUrls: ['./single-auto-complete.component.scss'] +}) +export class SingleAutoCompleteComponent implements OnInit { + + @Input() reactiveFormControl: FormControl; + @Input() placeholder: string; + @Input() validationErrorString: string; + + @Input() configuration: SingleAutoCompleteConfiguration; + + // Selected Option Event + @Output() optionSelected: EventEmitter = new EventEmitter(); + + private requestDelay = 200; //ms + private minFilteringChars = 3; + private loadDataOnStart = true; + + // @Input() items: Observable; + // @Input() filterFn?: (searchQuery: string) => Observable; + // @Input() displayFn?: (item: any) => string; + // @Input() titleFn?: (item: any) => string; + // @Input() subtitleFn?: (item: any) => string; + loading = false; + _items: Observable; + + constructor() { + } + + ngOnInit() { + + } + + filter(query: string): Observable { + // If loadDataOnStart is enabled and query is empty we return the initial items. + if (this.isNullOrEmpty(query) && this.loadDataOnStart) { + return this.configuration.items || Observable.of([]); + } else if (query && query.length >= this.minFilteringChars) { + if (this.configuration.filterFn) { + return this.configuration.filterFn(query); + } else { + return this.configuration.items || Observable.of([]); + } + } else { + return Observable.of([]); + } + } + + isNullOrEmpty(query: string): boolean { + return typeof query !== 'string' || query === null || query.length === 0; + } + + _displayFn(item: any): string { + if (this.configuration.displayFn && item) { return this.configuration.displayFn(item); } + return item; + } + + _titleFn(item: any): string { + if (this.configuration.titleFn && item) { return this.configuration.titleFn(item); } + return item; + } + + _subtitleFn(item: any): string { + if (this.configuration.subtitleFn && item) { return this.configuration.subtitleFn(item); } + return null; + } + + _requestDelay(): number { + return this.configuration.requestDelay || this.requestDelay; + } + + _minFilteringChars(): number { + return this.configuration.minFilteringChars || this.minFilteringChars; + } + + _loadDataOnStart(): boolean { + return this.configuration.loadDataOnStart || this.loadDataOnStart; + } + + _optionSelected(event: MatAutocompleteSelectedEvent) { + this.optionSelected.emit(event.option.value); + } + + _onInputFocus() { + // We set the items observable on focus to avoid the request being executed on component load. + if (!this._items) { + this._items = this.reactiveFormControl.valueChanges + .startWith(null) + .debounceTime(this.requestDelay) + .distinctUntilChanged() + .do(() => { this.loading = true; }) + .flatMap(query => { + // If its a valid object, a selection just made and the object is set as the value of the form control. That means we should fire an extra request to the server. + if (this._isValidObject(query)) { return Observable.of([]); } + return this.filter(query); + }) + .do(() => { this.loading = false; }); + } + } + + _isValidObject(value: any): boolean { + try { + if (!value) { return false; } + if (typeof value !== 'object') { JSON.parse(value); } + } catch (e) { + return false; + } + return true; + } +} diff --git a/dmp-frontend/src/app/shared/components/external-items/external-item-listing/external-item-listing.component.ts b/dmp-frontend/src/app/shared/components/external-items/external-item-listing/external-item-listing.component.ts index c79b4732e..1963ea052 100644 --- a/dmp-frontend/src/app/shared/components/external-items/external-item-listing/external-item-listing.component.ts +++ b/dmp-frontend/src/app/shared/components/external-items/external-item-listing/external-item-listing.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit, Input, ContentChild, TemplateRef, ViewChild, Output, EventEmitter } from "@angular/core"; -import { AutoCompleteConfiguration } from "../../autocomplete/AutoCompleteConfiguration"; import { FormGroup, FormControl, FormArray, AbstractControl } from "@angular/forms"; import { ExternalSourcesUrlModel } from "../../../../models/external-sources/ExternalSourcesUrlModel"; +import { AutoCompleteConfiguration } from "../../auto-complete/AutoCompleteConfiguration"; @Component({ selector: 'app-external-item-listing', diff --git a/dmp-frontend/src/app/shared/components/external-items/external-item/external-item.component.ts b/dmp-frontend/src/app/shared/components/external-items/external-item/external-item.component.ts index 363450d54..30b549e5e 100644 --- a/dmp-frontend/src/app/shared/components/external-items/external-item/external-item.component.ts +++ b/dmp-frontend/src/app/shared/components/external-items/external-item/external-item.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit, Input, Output, EventEmitter } from "@angular/core"; import { Placeholder } from "@angular/compiler/src/i18n/i18n_ast"; -import { AutoCompleteConfiguration } from "../../autocomplete/AutoCompleteConfiguration"; import { FormGroup, FormControl } from "@angular/forms"; +import { AutoCompleteConfiguration } from "../../auto-complete/AutoCompleteConfiguration"; @Component({ selector: 'app-external-item', diff --git a/dmp-frontend/src/app/shared/shared.module.ts b/dmp-frontend/src/app/shared/shared.module.ts index 14962abf9..eb2fb3526 100644 --- a/dmp-frontend/src/app/shared/shared.module.ts +++ b/dmp-frontend/src/app/shared/shared.module.ts @@ -1,6 +1,5 @@ import { BaseCriteriaComponent } from './components/criteria/base/base-criteria.component'; import { FigurecardComponent } from './components/figurecard/figurecard.component'; -import { AutocompleteComponent } from './components/autocomplete/autocomplete.component'; import { CommonModule } from '@angular/common'; import { FlexLayoutModule } from '@angular/flex-layout'; @@ -22,6 +21,8 @@ import { AutoCompleteComponent } from './components/auto-complete/auto-complete. import { ExternalItemListingComponent } from './components/external-items/external-item-listing/external-item-listing.component'; import { ExternalItemComponent } from './components/external-items/external-item/external-item.component'; import { BreadcrumbComponent } from './components/breadcrumb/breadcrumb.component'; +import { SingleAutoCompleteComponent } from './components/autocompletes/single/single-auto-complete.component'; +import { MultipleAutoCompleteComponent } from './components/autocompletes/multiple/multiple-auto-complete.component'; @NgModule({ imports: [ @@ -41,7 +42,6 @@ import { BreadcrumbComponent } from './components/breadcrumb/breadcrumb.componen DatasetCriteriaComponent, DataManagementPlanCriteriaComponent, DataManagementPlanProfileCriteriaComponent, - AutocompleteComponent, FigurecardComponent, BaseCriteriaComponent, FileUploaderComponent, @@ -50,8 +50,9 @@ import { BreadcrumbComponent } from './components/breadcrumb/breadcrumb.componen AutoCompleteComponent, ExternalItemListingComponent, ExternalItemComponent, - BreadcrumbComponent - + BreadcrumbComponent, + SingleAutoCompleteComponent, + MultipleAutoCompleteComponent ], exports: [ @@ -64,16 +65,17 @@ import { BreadcrumbComponent } from './components/breadcrumb/breadcrumb.componen DatasetCriteriaComponent, DataManagementPlanProfileCriteriaComponent, DataManagementPlanCriteriaComponent, - AutocompleteComponent, FigurecardComponent, BaseCriteriaComponent, - FileUploaderComponent, + FileUploaderComponent, UrlListingComponent, NgForLimitPipe, AutoCompleteComponent, ExternalItemListingComponent, ExternalItemComponent, - BreadcrumbComponent + BreadcrumbComponent, + SingleAutoCompleteComponent, + MultipleAutoCompleteComponent ], entryComponents: [ ] diff --git a/dmp-frontend/src/assets/lang/en.json b/dmp-frontend/src/assets/lang/en.json index 143830d8f..c177c2384 100644 --- a/dmp-frontend/src/assets/lang/en.json +++ b/dmp-frontend/src/assets/lang/en.json @@ -134,7 +134,7 @@ "EDIT": "Edit" }, "FIELDS": { - "LABEL": "Label", + "LABEL": "Title", "ABBREVIATION": "Abbreviation", "URI": "URL", "START": "Start",