Fixed breadcrumbs for reporting pages
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
export const DELTAGARE_REPORTING_ROUTES = {
|
||||||
|
'gemensam-planering': 'Gemensam planering',
|
||||||
|
'periodisk-redovisning': 'Periodisk redovisning',
|
||||||
|
avvikelserapport: 'Avvikelserapport',
|
||||||
|
};
|
||||||
|
|
||||||
export const NAVIGATION = {
|
export const NAVIGATION = {
|
||||||
administration: 'Administration',
|
administration: 'Administration',
|
||||||
personal: 'Hantera personalkonton',
|
personal: 'Hantera personalkonton',
|
||||||
@@ -9,4 +15,5 @@ export const NAVIGATION = {
|
|||||||
'skapa-personalkonto': 'Skapa personalkonto',
|
'skapa-personalkonto': 'Skapa personalkonto',
|
||||||
obehorig: 'Saknar behörigheter',
|
obehorig: 'Saknar behörigheter',
|
||||||
tillganglighet: 'Tillgänglighetsredogörelse',
|
tillganglighet: 'Tillgänglighetsredogörelse',
|
||||||
|
...DELTAGARE_REPORTING_ROUTES,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { NavigationBreadcrumbsItem } from '@af/digi-ng/_navigation/navigation-breadcrumbs';
|
import { NavigationBreadcrumbsItem } from '@af/digi-ng/_navigation/navigation-breadcrumbs';
|
||||||
|
import { DELTAGARE_REPORTING_ROUTES } from '@msfa-constants/navigation';
|
||||||
import { mapPathToPageName } from './map-path-to-page-name.util';
|
import { mapPathToPageName } from './map-path-to-page-name.util';
|
||||||
|
|
||||||
export function mapPathsToBreadcrumbs(
|
export function mapPathsToBreadcrumbs(
|
||||||
@@ -21,9 +22,12 @@ export function mapPathsToBreadcrumbs(
|
|||||||
routerLink: '/administration/personal',
|
routerLink: '/administration/personal',
|
||||||
};
|
};
|
||||||
breadcrumbs[breadcrumbs.length - 1].text = 'Redigera personalkonto';
|
breadcrumbs[breadcrumbs.length - 1].text = 'Redigera personalkonto';
|
||||||
} else if (isParticipantCardRoute(paths)) {
|
} else if (isDeltagareCardRoute(paths)) {
|
||||||
breadcrumbs[breadcrumbs.length - 1].text = 'Deltagarinformation';
|
breadcrumbs[breadcrumbs.length - 1].text = 'Deltagarinformation';
|
||||||
|
} else if (isDeltagareReportingRoute(paths)) {
|
||||||
|
breadcrumbs[breadcrumbs.length - 2].text = 'Deltagarinformation';
|
||||||
}
|
}
|
||||||
|
|
||||||
return breadcrumbs;
|
return breadcrumbs;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -35,6 +39,10 @@ function isEmployeeEditRoute(paths: string[]): boolean {
|
|||||||
return paths.length === 3 && paths[1] === 'redigera-personalkonto';
|
return paths.length === 3 && paths[1] === 'redigera-personalkonto';
|
||||||
}
|
}
|
||||||
|
|
||||||
function isParticipantCardRoute(paths: string[]): boolean {
|
function isDeltagareCardRoute(paths: string[]): boolean {
|
||||||
return paths.length === 2 && paths[0] === 'deltagare';
|
return paths.length === 2 && paths[0] === 'deltagare';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isDeltagareReportingRoute(paths: string[]): boolean {
|
||||||
|
return paths.length === 3 && paths[0] === 'deltagare' && paths[2] in DELTAGARE_REPORTING_ROUTES;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user