diff --git a/src/app/modules/shared/models/project.model.ts b/src/app/modules/shared/models/project.model.ts index 81efdf32f..f96eff58b 100644 --- a/src/app/modules/shared/models/project.model.ts +++ b/src/app/modules/shared/models/project.model.ts @@ -5,4 +5,5 @@ export interface Project { name: string; description?: string; project_type_id?: string; + search_field?: string; } diff --git a/src/app/modules/time-clock/components/project-list-hover/project-list-hover.component.ts b/src/app/modules/time-clock/components/project-list-hover/project-list-hover.component.ts index a7a68559d..bd3ef5c49 100644 --- a/src/app/modules/time-clock/components/project-list-hover/project-list-hover.component.ts +++ b/src/app/modules/time-clock/components/project-list-hover/project-list-hover.component.ts @@ -18,7 +18,7 @@ import { getActiveTimeEntry } from './../../store/entry.selectors'; }) export class ProjectListHoverComponent implements OnInit, OnDestroy { - keyword = 'name'; + keyword = 'search_field'; listProjects: Project[] = []; activeEntry; projectsForm: FormGroup; @@ -36,7 +36,13 @@ export class ProjectListHoverComponent implements OnInit, OnDestroy { this.store.dispatch(new actions.LoadProjects()); const projects$ = this.store.pipe(select(getProjects)); projects$.subscribe((projects) => { - this.listProjects = projects; + this.listProjects = []; + projects.forEach((project) => { + const projectWithSearchField = {...project}; + projectWithSearchField.search_field = `${project.customer_name} - ${project.name}`; + this.listProjects.push(projectWithSearchField); + } + ); this.loadActiveTimeEntry(); });