Add Kunde CRUD with addresses/contacts, delivery edit, and Auftrag sub-nav.
Wire customergroup/entity APIs, Lieferungen detail editing, and Angebot/Bestellung/Ausliefern/Retoure placeholders.
This commit is contained in:
24
src/nav.js
24
src/nav.js
@@ -7,11 +7,13 @@ import ViewListIcon from '@mui/icons-material/ViewList';
|
||||
import CategoryIcon from '@mui/icons-material/Category';
|
||||
import WarehouseIcon from '@mui/icons-material/Warehouse';
|
||||
import ListAltIcon from '@mui/icons-material/ListAlt';
|
||||
import ArchiveIcon from '@mui/icons-material/Archive';
|
||||
import GroupsIcon from '@mui/icons-material/Groups';
|
||||
import ContactPageIcon from '@mui/icons-material/ContactPage';
|
||||
import AddBoxIcon from '@mui/icons-material/AddBox';
|
||||
import StorefrontIcon from '@mui/icons-material/Storefront';
|
||||
import RequestQuoteIcon from '@mui/icons-material/RequestQuote';
|
||||
import ShoppingCartIcon from '@mui/icons-material/ShoppingCart';
|
||||
import OutboxIcon from '@mui/icons-material/Outbox';
|
||||
import AssignmentReturnIcon from '@mui/icons-material/AssignmentReturn';
|
||||
import { isKategorienPath } from './pages/artikel/categoryRoute';
|
||||
|
||||
export const NAV_ITEMS = [
|
||||
@@ -34,13 +36,15 @@ export const SUB_NAV = {
|
||||
{ segment: 'lieferanten', label: 'Lieferanten', icon: StorefrontIcon },
|
||||
],
|
||||
'/auftrag': [
|
||||
{ segment: '', label: 'Aktive Aufträge', icon: ListAltIcon },
|
||||
{ segment: 'archiv', label: 'Archiv', icon: ArchiveIcon },
|
||||
{ segment: '', label: 'Angebot', icon: RequestQuoteIcon },
|
||||
{ segment: 'bestellung', label: 'Bestellung', icon: ShoppingCartIcon },
|
||||
{ segment: 'ausliefern', label: 'Ausliefern', icon: OutboxIcon },
|
||||
{ segment: 'retoure', label: 'Retoure', icon: AssignmentReturnIcon },
|
||||
],
|
||||
'/kunde': [
|
||||
{ segment: '', label: 'Kundenliste', icon: PeopleIcon },
|
||||
{ segment: 'gruppen', label: 'Gruppen', icon: GroupsIcon },
|
||||
{ segment: 'kontakte', label: 'Kontakte', icon: ContactPageIcon },
|
||||
{ segment: 'neu', label: 'Neuer Kunde', icon: AddBoxIcon },
|
||||
{ segment: 'gruppen', label: 'Kundengruppen', icon: GroupsIcon },
|
||||
],
|
||||
};
|
||||
|
||||
@@ -65,7 +69,7 @@ export function resolveActiveNav(pathname) {
|
||||
|
||||
/**
|
||||
* Active sub-nav segment for a section.
|
||||
* `''` = section index, `null` = none (e.g. article detail tabs).
|
||||
* `''` = section index, `null` = none (e.g. article / kunde detail).
|
||||
*/
|
||||
export function resolveActiveSub(pathname, sectionPath) {
|
||||
const subNav = SUB_NAV[sectionPath];
|
||||
@@ -78,7 +82,11 @@ export function resolveActiveSub(pathname, sectionPath) {
|
||||
!isKategorienPath(pathname) &&
|
||||
rest &&
|
||||
!knownSegments.has(rest);
|
||||
if (isArticleDetail) return null;
|
||||
const isKundeDetail =
|
||||
sectionPath === '/kunde' && rest && !knownSegments.has(rest);
|
||||
const isLieferungDetail =
|
||||
sectionPath === '/lieferung' && rest && !knownSegments.has(rest);
|
||||
if (isArticleDetail || isKundeDetail || isLieferungDetail) return null;
|
||||
|
||||
const active = subNav.find((item) => {
|
||||
if (item.segment === 'kategorien') {
|
||||
|
||||
Reference in New Issue
Block a user