Skip to content
Prev Previous commit
Next Next commit
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
  • Loading branch information
ararcos authored and mandres2015 committed Dec 3, 2021
commit f8c7bfae04695d54b14623f0a62b6acda24a6a46
Original file line number Diff line number Diff line change
Expand Up @@ -161,17 +161,17 @@ export class DetailsFieldsComponent implements OnChanges, OnInit {
this.store.dispatch(new projectActions.LoadProjects());
const recentProjects$ = this.store.pipe(select(getRecentProjects));
recentProjects$.subscribe((projects) => {
if (projects) {
this.listRecentProjects = [];
this.listRecentProjects = [];
if (projects?.length > 0) {
projects.forEach((project) => {
const projectWithSearchField = { ...project };
projectWithSearchField.search_field = `${project.customer.name} - ${project.name}`;
this.listRecentProjects.push(projectWithSearchField);
});
this.listProjectsShowed = this.listRecentProjects;
}else{
this.listRecentProjects = this.listProjects;
}
this.listProjectsShowed = this.listRecentProjects;
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class TechnologiesComponent implements OnInit, OnDestroy {
readonly ALLOW_SELECT_MULTIPLE = true;
readonly ALLOW_SEARCH = true;
readonly MIN_SEARCH_TERM_LENGTH = 2;
readonly TYPE_TO_SEARCH_TEXT = 'Please enter 2 or more characters';
readonly TYPE_TO_SEARCH_TEXT = 'Please enter 2 or more characters to search for technologies ';
readonly WAITING_TIME_AFTER_KEY_UP = 400;

isLoading = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ export class ProjectListHoverComponent implements OnInit, OnDestroy {
this.store.dispatch(new actions.LoadProjects());
const recentProjects$ = this.store.pipe(select(getRecentProjects));
this.recentProjectsSubscription = recentProjects$.subscribe((projects) => {
if (projects) {
if (projects?.length > 0) {
this.listRecentProjects = projects;
this.listProjectsShowed = this.listRecentProjects;
}else{
this.listRecentProjects = this.listProjects;
}
this.listProjectsShowed = this.listRecentProjects;
});

this.updateEntrySubscription = this.actionsSubject$
Expand Down