Merged in development (pull request #56)

[HIMA-48] QA feedback
This commit is contained in:
Peter Skrlj
2019-02-14 07:31:48 +00:00
2 changed files with 5 additions and 24 deletions

View File

@@ -103,32 +103,12 @@ export class ProcessState {
@Selector()
static getUsers(state: ProcessStateModel) {
const currenProcces = state.processes.map((process: Process) => {
if (process.selected === true) {
return process;
}
});
if (currenProcces[0]) {
return currenProcces[0].users;
} else {
return [];
}
return state.processes.find(t => t.selected === true).users;
}
@Selector()
static getBreadcrumbs(state: ProcessStateModel) {
const currenProcces = state.processes.map((process: Process) => {
if (process.selected === true) {
return process;
}
});
if (currenProcces[0]) {
return currenProcces[0].breadcrumbs;
} else {
return [];
}
return state.processes.find(t => t.selected === true).breadcrumbs;
}
@Selector()
@@ -275,6 +255,7 @@ export class ProcessState {
const breadcrumbExist = process.breadcrumbs.filter(
(breadcrumb: Breadcrumb) => breadcrumb.name === payload
);
if (breadcrumbExist.length > 0) {
// Breadcrumb already exists
return { ...process, users: users };
@@ -679,7 +660,7 @@ export class ProcessState {
const indexOfCurrentBreadcrumb = breadcrumbs.findIndex(
b => b.name === payload.name
);
console.log(indexOfCurrentBreadcrumb);
for (let x = breadcrumbs.length - 1; x >= 0; x--) {
if (indexOfCurrentBreadcrumb < x) {
ctx.dispatch(new actions.ChangeCurrentRoute(breadcrumbs[x - 1].path));

View File

@@ -62,7 +62,7 @@ export class SearchCustomerCardComponent implements OnInit, AfterViewInit {
this.store.dispatch(new SearchUser(this.searchParams));
this.users$.subscribe((users: User[]) => {
if (users.length > 0) {
if (users && users.length > 0) {
this.navigateToRoute('customer-search-result');
} else {
this.searchError = true;