Skip to content

Commit 3f0c210

Browse files
authored
fix: TT-413 show projects when you do not have the latest projects (#770)
* fix: TT-413 show projects when you do not have the latest projects * fix: TT-413 validate array empty
1 parent 950e4c7 commit 3f0c210

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/app/modules/shared/components/details-fields/details-fields.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,17 +161,17 @@ export class DetailsFieldsComponent implements OnChanges, OnInit {
161161
this.store.dispatch(new projectActions.LoadProjects());
162162
const recentProjects$ = this.store.pipe(select(getRecentProjects));
163163
recentProjects$.subscribe((projects) => {
164-
if (projects) {
165-
this.listRecentProjects = [];
164+
this.listRecentProjects = [];
165+
if (projects?.length > 0) {
166166
projects.forEach((project) => {
167167
const projectWithSearchField = { ...project };
168168
projectWithSearchField.search_field = `${project.customer.name} - ${project.name}`;
169169
this.listRecentProjects.push(projectWithSearchField);
170170
});
171-
this.listProjectsShowed = this.listRecentProjects;
172171
}else{
173172
this.listRecentProjects = this.listProjects;
174173
}
174+
this.listProjectsShowed = this.listRecentProjects;
175175
});
176176
}
177177

src/app/modules/shared/components/technologies/technologies.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class TechnologiesComponent implements OnInit, OnDestroy {
1717
readonly ALLOW_SELECT_MULTIPLE = true;
1818
readonly ALLOW_SEARCH = true;
1919
readonly MIN_SEARCH_TERM_LENGTH = 2;
20-
readonly TYPE_TO_SEARCH_TEXT = 'Please enter 2 or more characters';
20+
readonly TYPE_TO_SEARCH_TEXT = 'Please enter 2 or more characters to search for technologies ';
2121
readonly WAITING_TIME_AFTER_KEY_UP = 400;
2222

2323
isLoading = false;

src/app/modules/time-clock/components/project-list-hover/project-list-hover.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ export class ProjectListHoverComponent implements OnInit, OnDestroy {
7171
this.store.dispatch(new actions.LoadProjects());
7272
const recentProjects$ = this.store.pipe(select(getRecentProjects));
7373
this.recentProjectsSubscription = recentProjects$.subscribe((projects) => {
74-
if (projects) {
74+
if (projects?.length > 0) {
7575
this.listRecentProjects = projects;
76-
this.listProjectsShowed = this.listRecentProjects;
7776
}else{
7877
this.listRecentProjects = this.listProjects;
7978
}
79+
this.listProjectsShowed = this.listRecentProjects;
8080
});
8181

8282
this.updateEntrySubscription = this.actionsSubject$

0 commit comments

Comments
 (0)