@natoora-libs/drawer-menu 0.0.7 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +21 -80
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -21
- package/dist/index.d.ts +23 -21
- package/dist/index.js +21 -80
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -10,26 +10,35 @@ interface LeftDrawerProps {
|
|
|
10
10
|
last_name: string;
|
|
11
11
|
username: string;
|
|
12
12
|
};
|
|
13
|
+
reloadOnNavigate?: boolean;
|
|
13
14
|
handleOpen: () => void;
|
|
14
15
|
handleClose: () => void;
|
|
15
16
|
onLogout: () => void;
|
|
16
17
|
onTogglePinnedApp: (name: string, new_value: boolean) => void;
|
|
17
18
|
}
|
|
18
|
-
declare const LeftDrawer: ({ enabledFeatures, pinnedApps, open, user, handleClose, handleOpen, onLogout, onTogglePinnedApp, }: LeftDrawerProps) => react_jsx_runtime.JSX.Element;
|
|
19
|
+
declare const LeftDrawer: ({ enabledFeatures, pinnedApps, open, user, reloadOnNavigate, handleClose, handleOpen, onLogout, onTogglePinnedApp, }: LeftDrawerProps) => react_jsx_runtime.JSX.Element;
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
21
|
+
interface DrawerAppChild {
|
|
22
|
+
name: string;
|
|
23
|
+
routeName: string;
|
|
24
|
+
pinned: string;
|
|
25
|
+
url: string;
|
|
26
|
+
featureName?: string;
|
|
27
|
+
shouldReload?: boolean;
|
|
28
|
+
}
|
|
29
|
+
declare const useGetDrawerAppList: (enabledFeatures: string[]) => {
|
|
30
|
+
apps: {
|
|
31
|
+
children: DrawerAppChild[] | undefined;
|
|
32
|
+
name: string;
|
|
33
|
+
routeName: string;
|
|
34
|
+
featureNames: string[];
|
|
35
|
+
pinned: string | null;
|
|
36
|
+
icon: React.ReactElement;
|
|
37
|
+
url: string;
|
|
38
|
+
shouldReload?: boolean;
|
|
39
|
+
}[];
|
|
31
40
|
groupName: string;
|
|
32
|
-
}
|
|
41
|
+
}[];
|
|
33
42
|
|
|
34
43
|
declare const featureNames: {
|
|
35
44
|
ACCOUNTS: string;
|
|
@@ -75,15 +84,8 @@ declare const uiFeatureNames: {
|
|
|
75
84
|
CUSTOMER_ESTIMATED_BASKET_SETTING: string;
|
|
76
85
|
ORDER_ISSUE_REPORTING: string;
|
|
77
86
|
CUSTOMER_PAYMENTS_SECTION: string;
|
|
78
|
-
CUSTOMER_DASHBOARD_TAB: string;
|
|
79
|
-
CUSTOMER_DETAILS_TAB: string;
|
|
80
|
-
CUSTOMER_TRANSPORT_TAB: string;
|
|
81
|
-
CUSTOMER_FINANCE_TAB: string;
|
|
82
|
-
CUSTOMER_ACTIVITY_TAB: string;
|
|
83
|
-
CUSTOMER_APP_TAB: string;
|
|
84
|
-
CUSTOMER_STANDING_ORDERS_TAB: string;
|
|
85
|
-
CUSTOMER_SUBSTITUTIONS_TAB: string;
|
|
86
87
|
CUSTOMER_PREFERENCES_TAB: string;
|
|
88
|
+
CUSTOMER_SUBSTITUTIONS_TAB: string;
|
|
87
89
|
PRODUCT_PREFERENCES_SECTION: string;
|
|
88
90
|
};
|
|
89
91
|
declare const uiFeaturesAreEnabled: (enabledUIFeatures: string[] | undefined, feature: string) => boolean | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -10,26 +10,35 @@ interface LeftDrawerProps {
|
|
|
10
10
|
last_name: string;
|
|
11
11
|
username: string;
|
|
12
12
|
};
|
|
13
|
+
reloadOnNavigate?: boolean;
|
|
13
14
|
handleOpen: () => void;
|
|
14
15
|
handleClose: () => void;
|
|
15
16
|
onLogout: () => void;
|
|
16
17
|
onTogglePinnedApp: (name: string, new_value: boolean) => void;
|
|
17
18
|
}
|
|
18
|
-
declare const LeftDrawer: ({ enabledFeatures, pinnedApps, open, user, handleClose, handleOpen, onLogout, onTogglePinnedApp, }: LeftDrawerProps) => react_jsx_runtime.JSX.Element;
|
|
19
|
+
declare const LeftDrawer: ({ enabledFeatures, pinnedApps, open, user, reloadOnNavigate, handleClose, handleOpen, onLogout, onTogglePinnedApp, }: LeftDrawerProps) => react_jsx_runtime.JSX.Element;
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
21
|
+
interface DrawerAppChild {
|
|
22
|
+
name: string;
|
|
23
|
+
routeName: string;
|
|
24
|
+
pinned: string;
|
|
25
|
+
url: string;
|
|
26
|
+
featureName?: string;
|
|
27
|
+
shouldReload?: boolean;
|
|
28
|
+
}
|
|
29
|
+
declare const useGetDrawerAppList: (enabledFeatures: string[]) => {
|
|
30
|
+
apps: {
|
|
31
|
+
children: DrawerAppChild[] | undefined;
|
|
32
|
+
name: string;
|
|
33
|
+
routeName: string;
|
|
34
|
+
featureNames: string[];
|
|
35
|
+
pinned: string | null;
|
|
36
|
+
icon: React.ReactElement;
|
|
37
|
+
url: string;
|
|
38
|
+
shouldReload?: boolean;
|
|
39
|
+
}[];
|
|
31
40
|
groupName: string;
|
|
32
|
-
}
|
|
41
|
+
}[];
|
|
33
42
|
|
|
34
43
|
declare const featureNames: {
|
|
35
44
|
ACCOUNTS: string;
|
|
@@ -75,15 +84,8 @@ declare const uiFeatureNames: {
|
|
|
75
84
|
CUSTOMER_ESTIMATED_BASKET_SETTING: string;
|
|
76
85
|
ORDER_ISSUE_REPORTING: string;
|
|
77
86
|
CUSTOMER_PAYMENTS_SECTION: string;
|
|
78
|
-
CUSTOMER_DASHBOARD_TAB: string;
|
|
79
|
-
CUSTOMER_DETAILS_TAB: string;
|
|
80
|
-
CUSTOMER_TRANSPORT_TAB: string;
|
|
81
|
-
CUSTOMER_FINANCE_TAB: string;
|
|
82
|
-
CUSTOMER_ACTIVITY_TAB: string;
|
|
83
|
-
CUSTOMER_APP_TAB: string;
|
|
84
|
-
CUSTOMER_STANDING_ORDERS_TAB: string;
|
|
85
|
-
CUSTOMER_SUBSTITUTIONS_TAB: string;
|
|
86
87
|
CUSTOMER_PREFERENCES_TAB: string;
|
|
88
|
+
CUSTOMER_SUBSTITUTIONS_TAB: string;
|
|
87
89
|
PRODUCT_PREFERENCES_SECTION: string;
|
|
88
90
|
};
|
|
89
91
|
declare const uiFeaturesAreEnabled: (enabledUIFeatures: string[] | undefined, feature: string) => boolean | undefined;
|
package/dist/index.js
CHANGED
|
@@ -326,7 +326,6 @@ var drawerAppList = [
|
|
|
326
326
|
{
|
|
327
327
|
name: "Home",
|
|
328
328
|
routeName: "home",
|
|
329
|
-
alwaysDisplay: true,
|
|
330
329
|
featureNames: [],
|
|
331
330
|
pinned: null,
|
|
332
331
|
icon: /* @__PURE__ */ jsx(icons.SvgIconHome, {}),
|
|
@@ -340,7 +339,6 @@ var drawerAppList = [
|
|
|
340
339
|
{
|
|
341
340
|
name: "Notifications",
|
|
342
341
|
routeName: "appNotifications",
|
|
343
|
-
alwaysDisplay: false,
|
|
344
342
|
featureNames: [featureNames.NOTIFICATIONS],
|
|
345
343
|
pinned: "notifications",
|
|
346
344
|
icon: /* @__PURE__ */ jsx(icons.SvgIconNotification, {}),
|
|
@@ -350,7 +348,6 @@ var drawerAppList = [
|
|
|
350
348
|
{
|
|
351
349
|
name: "Promo Codes",
|
|
352
350
|
routeName: "promo_codes",
|
|
353
|
-
alwaysDisplay: false,
|
|
354
351
|
featureNames: [featureNames.PROMO_CODES],
|
|
355
352
|
pinned: "promo_codes",
|
|
356
353
|
icon: /* @__PURE__ */ jsx(icons.SvgIconPromoCode, {}),
|
|
@@ -359,7 +356,6 @@ var drawerAppList = [
|
|
|
359
356
|
{
|
|
360
357
|
name: "Search Categories",
|
|
361
358
|
routeName: "search-categories",
|
|
362
|
-
alwaysDisplay: false,
|
|
363
359
|
featureNames: [featureNames.SEARCH_CATEGORIES],
|
|
364
360
|
pinned: "search_categories",
|
|
365
361
|
icon: /* @__PURE__ */ jsx(icons.SvgIconSearchCategories, {}),
|
|
@@ -368,7 +364,6 @@ var drawerAppList = [
|
|
|
368
364
|
{
|
|
369
365
|
name: "Content Management",
|
|
370
366
|
routeName: "content-management",
|
|
371
|
-
alwaysDisplay: false,
|
|
372
367
|
featureNames: [featureNames.CONTENT_MANAGEMENT],
|
|
373
368
|
pinned: "content_management",
|
|
374
369
|
icon: /* @__PURE__ */ jsx(icons.SvgIconContentManagement, {}),
|
|
@@ -382,7 +377,6 @@ var drawerAppList = [
|
|
|
382
377
|
{
|
|
383
378
|
name: "Aircall",
|
|
384
379
|
routeName: "recordedcalls",
|
|
385
|
-
alwaysDisplay: false,
|
|
386
380
|
featureNames: [featureNames.AIRCALL],
|
|
387
381
|
pinned: "aircall",
|
|
388
382
|
icon: /* @__PURE__ */ jsx(icons.SvgIconPhone, {}),
|
|
@@ -391,7 +385,6 @@ var drawerAppList = [
|
|
|
391
385
|
{
|
|
392
386
|
name: "Customers",
|
|
393
387
|
routeName: "customers",
|
|
394
|
-
alwaysDisplay: false,
|
|
395
388
|
featureNames: [featureNames.CUSTOMERS],
|
|
396
389
|
pinned: "customers",
|
|
397
390
|
icon: /* @__PURE__ */ jsx(icons.SvgIconAccount, {}),
|
|
@@ -414,7 +407,6 @@ var drawerAppList = [
|
|
|
414
407
|
{
|
|
415
408
|
name: "Orders",
|
|
416
409
|
routeName: "orders",
|
|
417
|
-
alwaysDisplay: false,
|
|
418
410
|
featureNames: [featureNames.ORDERS],
|
|
419
411
|
pinned: "orders",
|
|
420
412
|
icon: /* @__PURE__ */ jsx(icons.SvgIconOrders, {}),
|
|
@@ -424,7 +416,6 @@ var drawerAppList = [
|
|
|
424
416
|
{
|
|
425
417
|
name: "Price Lists",
|
|
426
418
|
routeName: "price_list",
|
|
427
|
-
alwaysDisplay: false,
|
|
428
419
|
featureNames: [featureNames.PRICE_LIST],
|
|
429
420
|
pinned: "price_list",
|
|
430
421
|
icon: /* @__PURE__ */ jsx(icons.SvgIconPriceList, {}),
|
|
@@ -434,7 +425,6 @@ var drawerAppList = [
|
|
|
434
425
|
{
|
|
435
426
|
name: "Special Prices",
|
|
436
427
|
routeName: "special_prices",
|
|
437
|
-
alwaysDisplay: false,
|
|
438
428
|
featureNames: [featureNames.SPECIAL_PRICES],
|
|
439
429
|
pinned: "special_prices",
|
|
440
430
|
icon: /* @__PURE__ */ jsx(icons.SvgIconSpecialPrice, {}),
|
|
@@ -449,7 +439,6 @@ var drawerAppList = [
|
|
|
449
439
|
{
|
|
450
440
|
name: "Purchase Orders",
|
|
451
441
|
routeName: "purchaseOrders",
|
|
452
|
-
alwaysDisplay: false,
|
|
453
442
|
featureNames: [featureNames.PURCHASE_ORDERS],
|
|
454
443
|
pinned: "purchase_orders",
|
|
455
444
|
icon: /* @__PURE__ */ jsx(icons.SvgIconBuying, {}),
|
|
@@ -459,7 +448,6 @@ var drawerAppList = [
|
|
|
459
448
|
{
|
|
460
449
|
name: "Products",
|
|
461
450
|
routeName: "products",
|
|
462
|
-
alwaysDisplay: false,
|
|
463
451
|
featureNames: [featureNames.PRODUCTS],
|
|
464
452
|
pinned: "products",
|
|
465
453
|
icon: /* @__PURE__ */ jsx(icons.SvgIconProducts, {}),
|
|
@@ -469,7 +457,6 @@ var drawerAppList = [
|
|
|
469
457
|
{
|
|
470
458
|
name: "Suppliers",
|
|
471
459
|
routeName: "suppliers",
|
|
472
|
-
alwaysDisplay: false,
|
|
473
460
|
featureNames: [featureNames.SUPPLIERS],
|
|
474
461
|
pinned: "suppliers",
|
|
475
462
|
icon: /* @__PURE__ */ jsx(icons.SvgIconSupplier, {}),
|
|
@@ -478,7 +465,6 @@ var drawerAppList = [
|
|
|
478
465
|
{
|
|
479
466
|
name: "Supplier Prices",
|
|
480
467
|
routeName: "supplier_prices",
|
|
481
|
-
alwaysDisplay: false,
|
|
482
468
|
featureNames: [featureNames.SUPPLIER_PRICES],
|
|
483
469
|
pinned: "supplier_prices",
|
|
484
470
|
icon: /* @__PURE__ */ jsx(icons.SvgIconSupplierPrices, {}),
|
|
@@ -488,7 +474,6 @@ var drawerAppList = [
|
|
|
488
474
|
{
|
|
489
475
|
name: "Product Bulk Update",
|
|
490
476
|
routeName: "bulk-update",
|
|
491
|
-
alwaysDisplay: false,
|
|
492
477
|
featureNames: [featureNames.BULK_UPDATE],
|
|
493
478
|
pinned: "product_bulk_update",
|
|
494
479
|
icon: /* @__PURE__ */ jsx(icons.SvgIconImport, {}),
|
|
@@ -502,7 +487,6 @@ var drawerAppList = [
|
|
|
502
487
|
{
|
|
503
488
|
name: "Retail",
|
|
504
489
|
routeName: "retail",
|
|
505
|
-
alwaysDisplay: false,
|
|
506
490
|
featureNames: [featureNames.RETAIL],
|
|
507
491
|
pinned: "retail",
|
|
508
492
|
icon: /* @__PURE__ */ jsx(icons.SvgIconRetail, {}),
|
|
@@ -512,7 +496,6 @@ var drawerAppList = [
|
|
|
512
496
|
{
|
|
513
497
|
name: "Goods In",
|
|
514
498
|
routeName: "goodsin-list",
|
|
515
|
-
alwaysDisplay: false,
|
|
516
499
|
featureNames: [featureNames.GOODS_IN],
|
|
517
500
|
pinned: "goods_in",
|
|
518
501
|
icon: /* @__PURE__ */ jsx(icons.SvgIconGoodsin, {}),
|
|
@@ -521,24 +504,23 @@ var drawerAppList = [
|
|
|
521
504
|
{
|
|
522
505
|
name: "Returns",
|
|
523
506
|
routeName: "goods-in-list",
|
|
524
|
-
alwaysDisplay: false,
|
|
525
507
|
featureNames: [featureNames.RETURNS],
|
|
526
508
|
pinned: "returns",
|
|
527
509
|
icon: /* @__PURE__ */ jsx(icons.SvgIconGoodsin, {}),
|
|
528
510
|
url: "/returns"
|
|
529
511
|
},
|
|
530
512
|
{
|
|
531
|
-
icon: /* @__PURE__ */ jsx(icons.SvgIconLocation, {}),
|
|
532
513
|
name: "Stock and Locations",
|
|
533
|
-
pinned: "stock",
|
|
534
514
|
routeName: "locations",
|
|
535
515
|
featureNames: [featureNames.STOCK, featureNames.LOCATIONS],
|
|
536
|
-
|
|
516
|
+
pinned: "stock",
|
|
517
|
+
icon: /* @__PURE__ */ jsx(icons.SvgIconLocation, {}),
|
|
537
518
|
url: "/locations",
|
|
538
519
|
children: [
|
|
539
520
|
{
|
|
540
521
|
name: "Movements",
|
|
541
522
|
routeName: "movements",
|
|
523
|
+
pinned: "movements",
|
|
542
524
|
url: "/movements",
|
|
543
525
|
featureName: featureNames.STOCK_MOVEMENTS
|
|
544
526
|
}
|
|
@@ -547,7 +529,6 @@ var drawerAppList = [
|
|
|
547
529
|
{
|
|
548
530
|
name: "Kanban Cards",
|
|
549
531
|
routeName: "kanban",
|
|
550
|
-
alwaysDisplay: false,
|
|
551
532
|
featureNames: [featureNames.KANBAN],
|
|
552
533
|
pinned: "kanban_cards",
|
|
553
534
|
icon: /* @__PURE__ */ jsx(icons.SvgIconVkc, {}),
|
|
@@ -557,7 +538,6 @@ var drawerAppList = [
|
|
|
557
538
|
{
|
|
558
539
|
name: "Picking Stations",
|
|
559
540
|
routeName: "picking",
|
|
560
|
-
alwaysDisplay: false,
|
|
561
541
|
featureNames: [featureNames.PICKING_STATIONS],
|
|
562
542
|
pinned: "picking_stations",
|
|
563
543
|
icon: /* @__PURE__ */ jsx(icons.SvgIconScales, {}),
|
|
@@ -567,7 +547,6 @@ var drawerAppList = [
|
|
|
567
547
|
{
|
|
568
548
|
name: "Quality Control",
|
|
569
549
|
routeName: "qualityControl",
|
|
570
|
-
alwaysDisplay: false,
|
|
571
550
|
featureNames: [featureNames.QUALITY_CONTROL],
|
|
572
551
|
pinned: "quality_control",
|
|
573
552
|
icon: /* @__PURE__ */ jsx(icons.SvgIconQc, {}),
|
|
@@ -577,7 +556,6 @@ var drawerAppList = [
|
|
|
577
556
|
{
|
|
578
557
|
name: "Service Delivery",
|
|
579
558
|
routeName: "runs",
|
|
580
|
-
alwaysDisplay: false,
|
|
581
559
|
featureNames: [featureNames.SERVICE_DELIVERY],
|
|
582
560
|
pinned: "service_delivery",
|
|
583
561
|
icon: /* @__PURE__ */ jsx(icons.SvgIconRuns, {}),
|
|
@@ -587,7 +565,6 @@ var drawerAppList = [
|
|
|
587
565
|
{
|
|
588
566
|
name: "Ops Metrics",
|
|
589
567
|
routeName: "ops-metrics",
|
|
590
|
-
alwaysDisplay: false,
|
|
591
568
|
featureNames: [featureNames.OPS_METRICS],
|
|
592
569
|
pinned: "ops_metrics",
|
|
593
570
|
icon: /* @__PURE__ */ jsx(icons.SvgIconOpsMetrics, {}),
|
|
@@ -601,7 +578,6 @@ var drawerAppList = [
|
|
|
601
578
|
{
|
|
602
579
|
name: "Accounts",
|
|
603
580
|
routeName: "accounts",
|
|
604
|
-
alwaysDisplay: false,
|
|
605
581
|
featureNames: [featureNames.ACCOUNTS],
|
|
606
582
|
pinned: "accounts",
|
|
607
583
|
icon: /* @__PURE__ */ jsx(icons.SvgIconAccounts, {}),
|
|
@@ -611,7 +587,6 @@ var drawerAppList = [
|
|
|
611
587
|
{
|
|
612
588
|
name: "Reports",
|
|
613
589
|
routeName: "reports",
|
|
614
|
-
alwaysDisplay: false,
|
|
615
590
|
featureNames: [featureNames.REPORTS],
|
|
616
591
|
pinned: "reports",
|
|
617
592
|
icon: /* @__PURE__ */ jsx(icons.SvgIconReports, {}),
|
|
@@ -626,7 +601,6 @@ var drawerAppList = [
|
|
|
626
601
|
{
|
|
627
602
|
name: "Admin",
|
|
628
603
|
routeName: "admin",
|
|
629
|
-
alwaysDisplay: false,
|
|
630
604
|
featureNames: [featureNames.ADMIN],
|
|
631
605
|
pinned: "admin",
|
|
632
606
|
icon: /* @__PURE__ */ jsx(icons.SvgIconSetting, {}),
|
|
@@ -636,7 +610,6 @@ var drawerAppList = [
|
|
|
636
610
|
{
|
|
637
611
|
name: "User Management",
|
|
638
612
|
routeName: "user-management",
|
|
639
|
-
alwaysDisplay: false,
|
|
640
613
|
featureNames: [featureNames.USER_MANAGEMENT],
|
|
641
614
|
pinned: "users",
|
|
642
615
|
icon: /* @__PURE__ */ jsx(icons.SvgIconUserManagement, {}),
|
|
@@ -645,7 +618,6 @@ var drawerAppList = [
|
|
|
645
618
|
{
|
|
646
619
|
name: "Logout",
|
|
647
620
|
routeName: "logout",
|
|
648
|
-
alwaysDisplay: true,
|
|
649
621
|
featureNames: [],
|
|
650
622
|
pinned: null,
|
|
651
623
|
icon: /* @__PURE__ */ jsx(icons.SvgIconLogin, {}),
|
|
@@ -659,7 +631,6 @@ var drawerAppList = [
|
|
|
659
631
|
{
|
|
660
632
|
name: "Release Notes",
|
|
661
633
|
routeName: "release-notes",
|
|
662
|
-
alwaysDisplay: true,
|
|
663
634
|
featureNames: [],
|
|
664
635
|
pinned: null,
|
|
665
636
|
// icon: <icons.SvgIconReleaseNote />,
|
|
@@ -677,24 +648,19 @@ var useGetDrawerAppList = (enabledFeatures) => {
|
|
|
677
648
|
}
|
|
678
649
|
return drawerAppList.map((group) => {
|
|
679
650
|
const enabledApps = group.apps.filter(
|
|
680
|
-
(app) => app.
|
|
651
|
+
(app) => app.routeName === "home" || app.routeName === "release-notes" || app.routeName === "logout" || featuresAreEnabled({
|
|
681
652
|
enabledFeatures,
|
|
682
653
|
featureNames: app.featureNames,
|
|
683
654
|
requireAll: false
|
|
684
655
|
})
|
|
685
656
|
).map((app) => {
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
(child)
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
}
|
|
694
|
-
);
|
|
695
|
-
return { ...app, children: filteredChildren };
|
|
696
|
-
}
|
|
697
|
-
return app;
|
|
657
|
+
const filteredChildren = app.children?.filter((child) => {
|
|
658
|
+
if (child.featureName) {
|
|
659
|
+
return enabledFeatures.includes(child.featureName);
|
|
660
|
+
}
|
|
661
|
+
return true;
|
|
662
|
+
});
|
|
663
|
+
return { ...app, children: filteredChildren };
|
|
698
664
|
});
|
|
699
665
|
return { ...group, apps: enabledApps };
|
|
700
666
|
}).filter((group) => group.apps.length > 0);
|
|
@@ -708,16 +674,6 @@ var useStyles = makeStyles()((theme) => ({
|
|
|
708
674
|
textTransform: "uppercase",
|
|
709
675
|
fontSize: theme.spacing(1.5)
|
|
710
676
|
},
|
|
711
|
-
menuButton: {
|
|
712
|
-
marginRight: theme.spacing(2)
|
|
713
|
-
},
|
|
714
|
-
inputRoot: {
|
|
715
|
-
color: "inherit"
|
|
716
|
-
},
|
|
717
|
-
inputInput: {
|
|
718
|
-
transition: theme.transitions.create("width"),
|
|
719
|
-
width: "100%"
|
|
720
|
-
},
|
|
721
677
|
topBar: {
|
|
722
678
|
backgroundColor: theme.palette.secondary.dark,
|
|
723
679
|
width: theme.spacing(40),
|
|
@@ -731,18 +687,6 @@ var useStyles = makeStyles()((theme) => ({
|
|
|
731
687
|
flexDirection: "column",
|
|
732
688
|
minWidth: theme.spacing(80)
|
|
733
689
|
},
|
|
734
|
-
drawerBody: {
|
|
735
|
-
minWidth: "300px",
|
|
736
|
-
flexGrow: 1,
|
|
737
|
-
padding: theme.spacing(3)
|
|
738
|
-
},
|
|
739
|
-
drawerItem: {
|
|
740
|
-
width: "300px",
|
|
741
|
-
marginBottom: theme.spacing(1)
|
|
742
|
-
},
|
|
743
|
-
button: {
|
|
744
|
-
color: theme.palette.primary.contrastText
|
|
745
|
-
},
|
|
746
690
|
iconMenu: {
|
|
747
691
|
height: "40px",
|
|
748
692
|
width: "40px",
|
|
@@ -779,6 +723,7 @@ var LeftDrawer = ({
|
|
|
779
723
|
pinnedApps,
|
|
780
724
|
open,
|
|
781
725
|
user,
|
|
726
|
+
reloadOnNavigate,
|
|
782
727
|
handleClose,
|
|
783
728
|
handleOpen,
|
|
784
729
|
onLogout,
|
|
@@ -789,8 +734,9 @@ var LeftDrawer = ({
|
|
|
789
734
|
const drawerAppList2 = useGetDrawerAppList(enabledFeatures);
|
|
790
735
|
const { classes } = useStyles();
|
|
791
736
|
const navigateTo = (url, shouldReload) => {
|
|
792
|
-
if (shouldReload) {
|
|
793
|
-
const
|
|
737
|
+
if (reloadOnNavigate || shouldReload) {
|
|
738
|
+
const path = reloadOnNavigate ? `/react/${url}` : url;
|
|
739
|
+
const fullUrl = window.location.origin + path;
|
|
794
740
|
window.location.href = fullUrl;
|
|
795
741
|
return;
|
|
796
742
|
}
|
|
@@ -859,7 +805,7 @@ var LeftDrawer = ({
|
|
|
859
805
|
alignItems: "center",
|
|
860
806
|
justifyContent: "center",
|
|
861
807
|
children: [
|
|
862
|
-
app.children?.length
|
|
808
|
+
!!app.children?.length && /* @__PURE__ */ jsx2(
|
|
863
809
|
ExpandLess,
|
|
864
810
|
{
|
|
865
811
|
className: classes.expandIcon,
|
|
@@ -882,6 +828,9 @@ var LeftDrawer = ({
|
|
|
882
828
|
className: classes.pinIcon,
|
|
883
829
|
style: { opacity: pinnedApps[app.pinned] ? 1 : 0.3 },
|
|
884
830
|
onClick: (event) => {
|
|
831
|
+
if (!app.pinned) {
|
|
832
|
+
return;
|
|
833
|
+
}
|
|
885
834
|
event.stopPropagation();
|
|
886
835
|
onTogglePinnedApp(
|
|
887
836
|
app.pinned,
|
|
@@ -897,11 +846,10 @@ var LeftDrawer = ({
|
|
|
897
846
|
},
|
|
898
847
|
app.name
|
|
899
848
|
),
|
|
900
|
-
app.children?.length
|
|
849
|
+
!!app.children?.length && /* @__PURE__ */ jsx2(Collapse, { in: openCollapse[app.routeName], children: /* @__PURE__ */ jsx2(List, { children: app.children.map((child) => /* @__PURE__ */ jsxs(
|
|
901
850
|
ListItemButton,
|
|
902
851
|
{
|
|
903
852
|
className: classes.nested,
|
|
904
|
-
disabled: child.disabled,
|
|
905
853
|
onClick: () => navigateTo(child.url, child.shouldReload),
|
|
906
854
|
title: child.url,
|
|
907
855
|
children: [
|
|
@@ -933,15 +881,8 @@ var uiFeatureNames = {
|
|
|
933
881
|
CUSTOMER_ESTIMATED_BASKET_SETTING: "customers_estimated_basket_setting",
|
|
934
882
|
ORDER_ISSUE_REPORTING: "customers_order_issue_report_setting",
|
|
935
883
|
CUSTOMER_PAYMENTS_SECTION: "customers_payments_section",
|
|
936
|
-
CUSTOMER_DASHBOARD_TAB: "customers_dashboard_tab",
|
|
937
|
-
CUSTOMER_DETAILS_TAB: "customers_details_tab",
|
|
938
|
-
CUSTOMER_TRANSPORT_TAB: "customers_transport_tab",
|
|
939
|
-
CUSTOMER_FINANCE_TAB: "customers_finance_tab",
|
|
940
|
-
CUSTOMER_ACTIVITY_TAB: "customers_activity_tab",
|
|
941
|
-
CUSTOMER_APP_TAB: "customers_app_tab",
|
|
942
|
-
CUSTOMER_STANDING_ORDERS_TAB: "customers_standing_orders_tab",
|
|
943
|
-
CUSTOMER_SUBSTITUTIONS_TAB: "customers_substitutions_tab",
|
|
944
884
|
CUSTOMER_PREFERENCES_TAB: "customers_preferences_tab",
|
|
885
|
+
CUSTOMER_SUBSTITUTIONS_TAB: "customers_substitutions_tab",
|
|
945
886
|
PRODUCT_PREFERENCES_SECTION: "product_preferences_section"
|
|
946
887
|
};
|
|
947
888
|
var uiFeaturesAreEnabled = (enabledUIFeatures, feature) => enabledUIFeatures?.includes(feature);
|