u
This commit is contained in:
@@ -99,10 +99,13 @@ const routes = [
|
||||
path: 'auftrag',
|
||||
element: <SectionLayout sectionPath="/auftrag" />,
|
||||
children: [
|
||||
{ index: true, element: <AuftragAngebotPage /> },
|
||||
{ index: true, element: <AuftragBestellungPage /> },
|
||||
{ path: 'angebot', element: <AuftragAngebotPage /> },
|
||||
{ path: 'angebot/:quoteId', element: <AuftragAngebotEditPage /> },
|
||||
{ path: 'neuesangebot', element: <AuftragAngebotNeuPage /> },
|
||||
{ path: 'angebot/neu', element: <Navigate to="/auftrag/neuesangebot" replace /> },
|
||||
{ path: 'neu', element: <Navigate to="/auftrag/neuesangebot" replace /> },
|
||||
{ path: 'bestellung', element: <AuftragBestellungPage /> },
|
||||
{ path: 'bestellung', element: <Navigate to="/auftrag" replace /> },
|
||||
{ path: 'bestellung/neu', element: <AuftragBestellungNeuPage /> },
|
||||
{ path: 'bestellung/:orderId', element: <AuftragBestellungEditPage /> },
|
||||
{ path: 'ausliefern', element: <AuftragAusliefernPage /> },
|
||||
|
||||
@@ -77,14 +77,14 @@ export default function SectionLayout({ sectionPath }) {
|
||||
const isDetail =
|
||||
isArticleDetail || isKundeDetail || isLieferungDetail || isAngebotDoc;
|
||||
|
||||
const angebotLabel =
|
||||
subNav?.find((item) => item.segment === '')?.title ?? subNav?.find((item) => item.segment === '')?.label ?? 'Angebot';
|
||||
let pageTitle = isDetail
|
||||
? title
|
||||
: (activeSub?.title ?? activeSub?.label ?? title);
|
||||
if (pathname === '/auftrag/neuesangebot' || pathname === '/auftrag/neu') pageTitle = 'Neues Angebot';
|
||||
else if (isAngebotDoc) pageTitle = angebotLabel;
|
||||
else if (pathname === '/auftrag/bestellung/neu') pageTitle = 'Neue Bestellung';
|
||||
if (pathname === '/auftrag/neuesangebot' || pathname === '/auftrag/neu' || pathname === '/auftrag/angebot/neu') pageTitle = 'Neues Angebot';
|
||||
else if (pathname === '/auftrag/bestellung/neu') pageTitle = 'Neuer Auftrag';
|
||||
else if (pathname.startsWith('/auftrag/bestellung/')) pageTitle = 'Bestellung';
|
||||
else if (pathname.startsWith('/auftrag/angebot/')) pageTitle = 'Angebot';
|
||||
else if (isAngebotDoc) pageTitle = 'Angebot';
|
||||
|
||||
const showsRenameSwitch = activeSub?.segment === 'kategorien';
|
||||
|
||||
|
||||
@@ -687,7 +687,7 @@ export function manifestConfig(cfgOrKind) {
|
||||
listField: 'quotes',
|
||||
docField: 'quote',
|
||||
partyField: 'entityId',
|
||||
listPath: '/auftrag',
|
||||
listPath: '/auftrag/angebot',
|
||||
createPath: '/auftrag/neuesangebot',
|
||||
editPath: (id) => `/auftrag/${id}`,
|
||||
dateLabel: 'Gültig bis',
|
||||
@@ -720,13 +720,13 @@ export function manifestConfig(cfgOrKind) {
|
||||
listField: 'orders',
|
||||
docField: 'order',
|
||||
partyField: 'entityId',
|
||||
listPath: '/auftrag/bestellung',
|
||||
listPath: '/auftrag',
|
||||
createPath: '/auftrag/bestellung/neu',
|
||||
editPath: (id) => `/auftrag/bestellung/${id}`,
|
||||
dateLabel: 'Lieferdatum',
|
||||
partyLabel: 'Kunde',
|
||||
emptyList: 'Noch keine Bestellungen.',
|
||||
createButton: 'Neue Bestellung',
|
||||
createButton: 'Neuer Auftrag',
|
||||
createdMsg: 'Bestellung angelegt.',
|
||||
savedMsg: 'Bestellung gespeichert.',
|
||||
deletedMsg: 'Bestellung gelöscht.',
|
||||
|
||||
@@ -55,8 +55,8 @@ function getInitialTarget() {
|
||||
const p = window.location.pathname;
|
||||
if (p.startsWith('/lieferung')) return 'delivery';
|
||||
if (p.startsWith('/auftrag/ausliefern')) return 'shipment';
|
||||
if (p.startsWith('/auftrag/bestellung')) return 'order';
|
||||
if (p.startsWith('/auftrag')) return 'quote';
|
||||
if (p.startsWith('/auftrag/angebot')) return 'quote';
|
||||
if (p.startsWith('/auftrag')) return 'order';
|
||||
}
|
||||
return 'order';
|
||||
}
|
||||
|
||||
21
src/nav.js
21
src/nav.js
@@ -202,18 +202,18 @@ export const SUB_NAV = {
|
||||
'/auftrag': [
|
||||
{
|
||||
segment: '',
|
||||
label: 'Auftrag',
|
||||
title: 'Auftrag',
|
||||
icon: ShoppingCartIcon,
|
||||
help: 'Bestellungen prüfen, freigeben und kommissionieren',
|
||||
},
|
||||
{
|
||||
segment: 'angebot',
|
||||
label: 'Angebot',
|
||||
title: 'Angebot',
|
||||
icon: RequestQuoteIcon,
|
||||
help: 'Angebote für Kunden kalkulieren und versenden',
|
||||
},
|
||||
{
|
||||
segment: 'bestellung',
|
||||
label: 'Bestellung',
|
||||
title: 'Bestellung',
|
||||
icon: ShoppingCartIcon,
|
||||
help: 'Bestellungen prüfen, freigeben und kommissionieren',
|
||||
},
|
||||
{
|
||||
segment: 'ausliefern',
|
||||
label: 'Ausliefern',
|
||||
@@ -336,11 +336,16 @@ export function resolveActiveSub(pathname, sectionPath) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Keep Bestellung active for nested paths (e.g. /auftrag/bestellung/neu).
|
||||
// Keep sub active for nested paths (e.g. /auftrag/ausliefern, /auftrag/angebot).
|
||||
if (sectionPath === '/auftrag' && rest && knownSegments.has(rest)) {
|
||||
return rest;
|
||||
}
|
||||
|
||||
// Treat /auftrag/bestellung as segment ''
|
||||
if (sectionPath === '/auftrag' && rest === 'bestellung') {
|
||||
return '';
|
||||
}
|
||||
|
||||
// Treat /infos/articlehistory as segment ''
|
||||
if (sectionPath === '/infos' && rest === 'articlehistory') {
|
||||
return '';
|
||||
|
||||
Reference in New Issue
Block a user