mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-31 09:37:15 +01:00
[HIMA-48] QA feedback
Users search on multiple processes working now.
This commit is contained in:
@@ -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));
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user