Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat: #447 enabling search project by customer name
  • Loading branch information
rene-enriquez-ct committed Aug 5, 2020
commit 4d7d3a75bf918f57b03089cb5d95213a68bdc398
1 change: 1 addition & 0 deletions src/app/modules/shared/models/project.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ export interface Project {
name: string;
description?: string;
project_type_id?: string;
search_field?: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
});

Expand Down