@medusajs/dashboard 3.0.0-snapshot-20251104011621 → 3.0.0-snapshot-20251106143524

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.
Files changed (113) hide show
  1. package/dist/{add-campaign-promotions-ZUJD7HBF.mjs → add-campaign-promotions-UR3UM3MV.mjs} +4 -4
  2. package/dist/{api-key-management-detail-MFQTHUN6.mjs → api-key-management-detail-Z6V22XWR.mjs} +5 -5
  3. package/dist/{api-key-management-list-22GXXJUC.mjs → api-key-management-list-TVLEYYQO.mjs} +5 -5
  4. package/dist/{api-key-management-sales-channels-MV6FMA4C.mjs → api-key-management-sales-channels-Y25FWD5A.mjs} +5 -5
  5. package/dist/app.js +3685 -430
  6. package/dist/app.mjs +3 -3
  7. package/dist/{campaign-detail-IKHUALTL.mjs → campaign-detail-YDLSCIRO.mjs} +5 -5
  8. package/dist/{campaign-list-3452F4Y6.mjs → campaign-list-M2462W5W.mjs} +6 -6
  9. package/dist/{category-detail-D4PYJJGJ.mjs → category-detail-IZ3AWOCP.mjs} +4 -4
  10. package/dist/{category-list-MLLB5U6K.mjs → category-list-BJLRBYZC.mjs} +4 -4
  11. package/dist/{category-products-K5INZSSV.mjs → category-products-55LDLRRQ.mjs} +4 -4
  12. package/dist/{chunk-Q33G337Z.mjs → chunk-2GWGNMAA.mjs} +1 -1
  13. package/dist/{chunk-2D44OO7A.mjs → chunk-2X25XWOW.mjs} +1 -1
  14. package/dist/{chunk-VWXNC2B5.mjs → chunk-3BE5PBQZ.mjs} +1 -1
  15. package/dist/{chunk-Y2XQE25L.mjs → chunk-5IFK2ZTA.mjs} +2 -2
  16. package/dist/{chunk-PYIPIUAY.mjs → chunk-5IPYLNMF.mjs} +3336 -97
  17. package/dist/{chunk-2WZUO66T.mjs → chunk-CV65NY6Y.mjs} +1 -1
  18. package/dist/{chunk-PFKKVLZX.mjs → chunk-DZWH2RV6.mjs} +1 -1
  19. package/dist/{chunk-IVZ6BMDB.mjs → chunk-GA3UMQMZ.mjs} +1 -1
  20. package/dist/{chunk-FKIOYL3D.mjs → chunk-GU5PJRPM.mjs} +1 -1
  21. package/dist/{chunk-S34JJVBQ.mjs → chunk-M4Q5Q4I3.mjs} +2 -2
  22. package/dist/{chunk-ZUUKLYH4.mjs → chunk-MBGEZAIM.mjs} +1 -1
  23. package/dist/{chunk-VAIHVNV6.mjs → chunk-NL376WAO.mjs} +1 -1
  24. package/dist/{chunk-GLVCH422.mjs → chunk-PVW6M64S.mjs} +1 -1
  25. package/dist/{chunk-SJ3E4T6B.mjs → chunk-ROKB75YP.mjs} +1 -1
  26. package/dist/{chunk-TUCPFNIY.mjs → chunk-S5GNHYAG.mjs} +3 -3
  27. package/dist/{chunk-67ORSRVT.mjs → chunk-SUYYSKCB.mjs} +23 -16
  28. package/dist/{chunk-ORMX5RJQ.mjs → chunk-T57MRRCF.mjs} +1 -1
  29. package/dist/{chunk-XXROCJ7D.mjs → chunk-VEYZCWO5.mjs} +3 -3
  30. package/dist/{chunk-YL4UEHO3.mjs → chunk-WGIRB6HY.mjs} +1 -1
  31. package/dist/{chunk-W77EPLUD.mjs → chunk-YA5PS6KW.mjs} +1 -1
  32. package/dist/{chunk-VLOA5XAC.mjs → chunk-YCDDT44O.mjs} +8 -4
  33. package/dist/{chunk-QXXHLVRQ.mjs → chunk-YGLRZQ4C.mjs} +1 -1
  34. package/dist/{chunk-PJ5EUKOB.mjs → chunk-YTN73JYH.mjs} +1 -1
  35. package/dist/{collection-add-products-TWIDVZMU.mjs → collection-add-products-7CFVTCLK.mjs} +4 -4
  36. package/dist/{collection-detail-B33WPVIW.mjs → collection-detail-3NMMB3CC.mjs} +4 -4
  37. package/dist/{collection-list-DAW7WOX5.mjs → collection-list-VNKB3725.mjs} +4 -4
  38. package/dist/{customer-detail-ATJGSJTH.mjs → customer-detail-PAYUFGP6.mjs} +6 -6
  39. package/dist/{customer-group-add-customers-57THRZ6D.mjs → customer-group-add-customers-MW2XH2F6.mjs} +6 -6
  40. package/dist/{customer-group-detail-OVZIWNPP.mjs → customer-group-detail-LJ6YVB2C.mjs} +6 -6
  41. package/dist/{customer-group-list-SADXXHAE.mjs → customer-group-list-M2OOZLIZ.mjs} +3 -3
  42. package/dist/{customer-list-TE7VNBX6.mjs → customer-list-MZ7ZRERV.mjs} +6 -6
  43. package/dist/{customers-add-customer-group-XNPZ47LK.mjs → customers-add-customer-group-IAIRRQ2I.mjs} +4 -4
  44. package/dist/{inventory-detail-I2CNJC6Y.mjs → inventory-detail-ZJ5U5FSA.mjs} +4 -4
  45. package/dist/{inventory-list-I7IXI4KC.mjs → inventory-list-HHTQRKQW.mjs} +4 -4
  46. package/dist/{location-fulfillment-providers-F7MMM5KC.mjs → location-fulfillment-providers-DNIVH7XD.mjs} +4 -4
  47. package/dist/{location-sales-channels-J3V26P3Q.mjs → location-sales-channels-3JAXXM3Q.mjs} +5 -5
  48. package/dist/{location-service-zone-create-27MNMKPQ.mjs → location-service-zone-create-D2HXXX63.mjs} +5 -5
  49. package/dist/{location-service-zone-manage-areas-U3EPNWSI.mjs → location-service-zone-manage-areas-LVVT6XBE.mjs} +5 -5
  50. package/dist/{manage-locations-ZRCDYW5V.mjs → manage-locations-WMH3RQMR.mjs} +1 -1
  51. package/dist/{order-create-claim-VFFKHCI6.mjs → order-create-claim-2FPE6XP2.mjs} +4 -4
  52. package/dist/{order-create-edit-7TFUOMST.mjs → order-create-edit-PVGKIS6G.mjs} +4 -4
  53. package/dist/{order-create-exchange-CXQ5ZM3Q.mjs → order-create-exchange-G4JY4FSX.mjs} +4 -4
  54. package/dist/{order-create-return-AYWH3WMR.mjs → order-create-return-VEUCH5BA.mjs} +4 -4
  55. package/dist/{order-detail-IFXJNVTV.mjs → order-detail-2EFNG3UB.mjs} +2 -2
  56. package/dist/{order-list-4N3OV2PU.mjs → order-list-EEC3VSLN.mjs} +8 -8
  57. package/dist/{price-list-configuration-4XY4JW4I.mjs → price-list-configuration-WQEQFG6M.mjs} +5 -5
  58. package/dist/{price-list-create-VFQVCUWV.mjs → price-list-create-36BOXETM.mjs} +5 -5
  59. package/dist/{price-list-detail-32UKOWNW.mjs → price-list-detail-6CJ63F65.mjs} +5 -5
  60. package/dist/{price-list-list-TKXSU27S.mjs → price-list-list-2HDOJIC6.mjs} +4 -4
  61. package/dist/{price-list-prices-add-AY75YZ7D.mjs → price-list-prices-add-AVPP57TL.mjs} +4 -4
  62. package/dist/{product-attributes-3GCAY7KW.mjs → product-attributes-TWEJQQBK.mjs} +4 -4
  63. package/dist/{product-create-4TD7FQC7.mjs → product-create-GTUUDEAP.mjs} +7 -7
  64. package/dist/{product-detail-J7T7MNUY.mjs → product-detail-F4MVAHFN.mjs} +6 -6
  65. package/dist/{product-edit-MJ7VAIVY.mjs → product-edit-NEIZ3SID.mjs} +4 -4
  66. package/dist/{product-export-X64NQWTS.mjs → product-export-5WBXPUYP.mjs} +3 -3
  67. package/dist/{product-image-variants-edit-J6A5G4AC.mjs → product-image-variants-edit-T3STDZJG.mjs} +4 -4
  68. package/dist/{product-import-HDNC36SM.mjs → product-import-5VLF2ZN4.mjs} +6 -6
  69. package/dist/{product-list-E7HS4SBG.mjs → product-list-BX2QNNQK.mjs} +7 -7
  70. package/dist/{product-organization-263TICCI.mjs → product-organization-5N2EIUXB.mjs} +4 -4
  71. package/dist/{product-sales-channels-RHZQXWAY.mjs → product-sales-channels-LRMOPHMH.mjs} +5 -5
  72. package/dist/{product-shipping-profile-GVTR3MHD.mjs → product-shipping-profile-AHJE77VR.mjs} +4 -4
  73. package/dist/{product-tag-detail-CK5F4DU3.mjs → product-tag-detail-LDKRRJWH.mjs} +10 -10
  74. package/dist/{product-tag-list-VNROS2W3.mjs → product-tag-list-3ERYK5WE.mjs} +10 -10
  75. package/dist/{product-type-detail-7K5RLART.mjs → product-type-detail-UJ6QTCGQ.mjs} +4 -4
  76. package/dist/{product-type-list-2ZQ2NE3R.mjs → product-type-list-73DQPW4H.mjs} +6 -6
  77. package/dist/{product-variant-detail-3SO2MX22.mjs → product-variant-detail-JMPD7LEZ.mjs} +4 -4
  78. package/dist/{profile-detail-UTJBWZSA.mjs → profile-detail-MEZKVQAB.mjs} +1 -1
  79. package/dist/{profile-edit-OOYMTKX6.mjs → profile-edit-XAHDV2DG.mjs} +1 -1
  80. package/dist/{promotion-detail-ZDINJASC.mjs → promotion-detail-L3FNHH6O.mjs} +3 -3
  81. package/dist/{promotion-list-MN6YJCYA.mjs → promotion-list-R5JKSO4I.mjs} +4 -4
  82. package/dist/{refund-reason-list-SFTHVSPC.mjs → refund-reason-list-NS4SVHGZ.mjs} +8 -8
  83. package/dist/{region-add-countries-KGFPZSRE.mjs → region-add-countries-G5BOUL2E.mjs} +4 -4
  84. package/dist/{region-create-YJJRTAYO.mjs → region-create-MLPUWT5W.mjs} +4 -4
  85. package/dist/{region-detail-ERE4ZF2I.mjs → region-detail-RICQRZUA.mjs} +4 -4
  86. package/dist/{region-list-W55C3CTH.mjs → region-list-CJYT43SH.mjs} +4 -4
  87. package/dist/{reservation-list-IEUC3KXK.mjs → reservation-list-XP4YX4TR.mjs} +5 -5
  88. package/dist/{return-reason-list-CBOVMQZF.mjs → return-reason-list-7MBVORVO.mjs} +10 -10
  89. package/dist/{sales-channel-add-products-7RKUDBXN.mjs → sales-channel-add-products-GQQ7Z3PT.mjs} +4 -4
  90. package/dist/{sales-channel-detail-TKVVIAS5.mjs → sales-channel-detail-P2HXFYB4.mjs} +4 -4
  91. package/dist/{sales-channel-list-SI7JVBOI.mjs → sales-channel-list-4PJLCQ77.mjs} +5 -5
  92. package/dist/{shipping-option-type-list-YPCCUVFZ.mjs → shipping-option-type-list-AWJRR7U5.mjs} +5 -5
  93. package/dist/{shipping-profiles-list-KYYSHLSZ.mjs → shipping-profiles-list-7SVGIP72.mjs} +4 -4
  94. package/dist/{store-add-currencies-SNSW7A6O.mjs → store-add-currencies-V3IBSI45.mjs} +4 -4
  95. package/dist/{store-detail-3ZV7FCPV.mjs → store-detail-3WFTRPJW.mjs} +4 -4
  96. package/dist/{tax-region-detail-TTYUBJ3V.mjs → tax-region-detail-HXVZA2PP.mjs} +13 -13
  97. package/dist/{tax-region-province-detail-YCY56CRL.mjs → tax-region-province-detail-VT3BUKLS.mjs} +13 -13
  98. package/dist/{tax-region-tax-override-create-R3PNDP43.mjs → tax-region-tax-override-create-RZUVOGNR.mjs} +11 -11
  99. package/dist/{tax-region-tax-override-edit-QLD7MIQY.mjs → tax-region-tax-override-edit-OEQOEE6I.mjs} +12 -12
  100. package/dist/{user-invite-FQNKJKMD.mjs → user-invite-QK3ZCSGG.mjs} +4 -4
  101. package/dist/{user-list-6EVTLPJE.mjs → user-list-RH43CTBN.mjs} +4 -4
  102. package/dist/{workflow-execution-list-JOVBPL45.mjs → workflow-execution-list-6UTBTVX4.mjs} +4 -4
  103. package/package.json +9 -9
  104. package/src/components/common/infinite-list/infinite-list.tsx +9 -4
  105. package/src/components/layout/main-layout/main-layout.tsx +1 -0
  106. package/src/components/layout/nav-item/nav-item.tsx +14 -4
  107. package/src/dashboard-app/dashboard-app.tsx +11 -2
  108. package/src/dashboard-app/routes/utils.ts +14 -6
  109. package/src/dashboard-app/types.ts +1 -0
  110. package/src/i18n/languages.ts +23 -16
  111. package/src/i18n/translations/index.ts +4 -0
  112. package/src/i18n/translations/ptPT.json +3219 -0
  113. package/src/routes/products/product-import/helpers/import-template.ts +6 -6
@@ -2,15 +2,15 @@ import "./chunk-LQTHYS2Z.mjs";
2
2
  import {
3
3
  _DataTable,
4
4
  useDataTable
5
- } from "./chunk-PJ5EUKOB.mjs";
5
+ } from "./chunk-YTN73JYH.mjs";
6
6
  import "./chunk-HQKGZADC.mjs";
7
7
  import "./chunk-EMIHDNB7.mjs";
8
8
  import {
9
9
  useUserInviteTableQuery
10
10
  } from "./chunk-FHSC5X62.mjs";
11
- import "./chunk-FKIOYL3D.mjs";
11
+ import "./chunk-GU5PJRPM.mjs";
12
12
  import "./chunk-C76H5USB.mjs";
13
- import "./chunk-PFKKVLZX.mjs";
13
+ import "./chunk-DZWH2RV6.mjs";
14
14
  import {
15
15
  KeyboundForm
16
16
  } from "./chunk-6HTZNHPT.mjs";
@@ -26,7 +26,7 @@ import {
26
26
  } from "./chunk-OZPB6JBL.mjs";
27
27
  import "./chunk-OC7BQLYI.mjs";
28
28
  import "./chunk-S4DMV3ZT.mjs";
29
- import "./chunk-67ORSRVT.mjs";
29
+ import "./chunk-SUYYSKCB.mjs";
30
30
  import {
31
31
  Form
32
32
  } from "./chunk-OBQI23QM.mjs";
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  useDataTableDateColumns
3
- } from "./chunk-2D44OO7A.mjs";
3
+ } from "./chunk-2X25XWOW.mjs";
4
4
  import {
5
5
  SingleColumnPage
6
6
  } from "./chunk-GIZFNLKK.mjs";
7
7
  import {
8
8
  useDataTableDateFilters
9
- } from "./chunk-Q33G337Z.mjs";
9
+ } from "./chunk-2GWGNMAA.mjs";
10
10
  import {
11
11
  DataTable
12
12
  } from "./chunk-GRNWRTT3.mjs";
13
13
  import {
14
14
  useQueryParams
15
15
  } from "./chunk-C76H5USB.mjs";
16
- import "./chunk-PFKKVLZX.mjs";
16
+ import "./chunk-DZWH2RV6.mjs";
17
17
  import "./chunk-RM6NY572.mjs";
18
18
  import {
19
19
  useExtension
@@ -21,7 +21,7 @@ import {
21
21
  import "./chunk-OZPB6JBL.mjs";
22
22
  import "./chunk-OC7BQLYI.mjs";
23
23
  import "./chunk-S4DMV3ZT.mjs";
24
- import "./chunk-67ORSRVT.mjs";
24
+ import "./chunk-SUYYSKCB.mjs";
25
25
  import {
26
26
  useUsers
27
27
  } from "./chunk-2ZKVRTBW.mjs";
@@ -9,23 +9,23 @@ import "./chunk-LQTHYS2Z.mjs";
9
9
  import {
10
10
  _DataTable,
11
11
  useDataTable
12
- } from "./chunk-PJ5EUKOB.mjs";
12
+ } from "./chunk-YTN73JYH.mjs";
13
13
  import "./chunk-HQKGZADC.mjs";
14
14
  import "./chunk-EMIHDNB7.mjs";
15
- import "./chunk-FKIOYL3D.mjs";
15
+ import "./chunk-GU5PJRPM.mjs";
16
16
  import {
17
17
  SingleColumnPage
18
18
  } from "./chunk-GIZFNLKK.mjs";
19
19
  import {
20
20
  useQueryParams
21
21
  } from "./chunk-C76H5USB.mjs";
22
- import "./chunk-PFKKVLZX.mjs";
22
+ import "./chunk-DZWH2RV6.mjs";
23
23
  import {
24
24
  useExtension
25
25
  } from "./chunk-C5P5PL3E.mjs";
26
26
  import "./chunk-LPEUYMRK.mjs";
27
27
  import "./chunk-S4DMV3ZT.mjs";
28
- import "./chunk-67ORSRVT.mjs";
28
+ import "./chunk-SUYYSKCB.mjs";
29
29
  import {
30
30
  useWorkflowExecutions
31
31
  } from "./chunk-QTCZFYFH.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medusajs/dashboard",
3
- "version": "3.0.0-snapshot-20251104011621",
3
+ "version": "3.0.0-snapshot-20251106143524",
4
4
  "scripts": {
5
5
  "generate:static": "node ./scripts/generate-currencies.js && prettier --write ./src/lib/currencies.ts",
6
6
  "dev": "vite",
@@ -46,10 +46,10 @@
46
46
  "@dnd-kit/utilities": "^3.2.2",
47
47
  "@hookform/error-message": "^2.0.1",
48
48
  "@hookform/resolvers": "3.4.2",
49
- "@medusajs/admin-shared": "3.0.0-snapshot-20251104011621",
50
- "@medusajs/icons": "3.0.0-snapshot-20251104011621",
51
- "@medusajs/js-sdk": "3.0.0-snapshot-20251104011621",
52
- "@medusajs/ui": "4.0.27-snapshot-20251104011621",
49
+ "@medusajs/admin-shared": "3.0.0-snapshot-20251106143524",
50
+ "@medusajs/icons": "3.0.0-snapshot-20251106143524",
51
+ "@medusajs/js-sdk": "3.0.0-snapshot-20251106143524",
52
+ "@medusajs/ui": "4.0.28-snapshot-20251106143524",
53
53
  "@radix-ui/react-dialog": "1.1.4",
54
54
  "@radix-ui/react-dismissable-layer": "1.1.4",
55
55
  "@tanstack/react-query": "5.64.2",
@@ -81,10 +81,10 @@
81
81
  "zod": "3.25.76"
82
82
  },
83
83
  "devDependencies": {
84
- "@medusajs/admin-shared": "3.0.0-snapshot-20251104011621",
85
- "@medusajs/admin-vite-plugin": "3.0.0-snapshot-20251104011621",
86
- "@medusajs/types": "3.0.0-snapshot-20251104011621",
87
- "@medusajs/ui-preset": "3.0.0-snapshot-20251104011621"
84
+ "@medusajs/admin-shared": "3.0.0-snapshot-20251106143524",
85
+ "@medusajs/admin-vite-plugin": "3.0.0-snapshot-20251106143524",
86
+ "@medusajs/types": "3.0.0-snapshot-20251106143524",
87
+ "@medusajs/ui-preset": "3.0.0-snapshot-20251106143524"
88
88
  },
89
89
  "packageManager": "yarn@3.2.1"
90
90
  }
@@ -65,6 +65,13 @@ export const InfiniteList = <
65
65
  const parentRef = useRef<HTMLDivElement>(null)
66
66
  const startObserver = useRef<IntersectionObserver>()
67
67
  const endObserver = useRef<IntersectionObserver>()
68
+ const fetchNextPageRef = useRef(fetchNextPage)
69
+ const fetchPreviousPageRef = useRef(fetchPreviousPage)
70
+
71
+ useEffect(() => {
72
+ fetchNextPageRef.current = fetchNextPage
73
+ fetchPreviousPageRef.current = fetchPreviousPage
74
+ }, [fetchNextPage, fetchPreviousPage])
68
75
 
69
76
  useEffect(() => {
70
77
  if (isPending) {
@@ -78,7 +85,7 @@ export const InfiniteList = <
78
85
  (entries) => {
79
86
  if (entries[0].isIntersecting && hasPreviousPage) {
80
87
  startObserver.current?.disconnect()
81
- fetchPreviousPage()
88
+ fetchPreviousPageRef.current()
82
89
  }
83
90
  },
84
91
  {
@@ -90,7 +97,7 @@ export const InfiniteList = <
90
97
  (entries) => {
91
98
  if (entries[0].isIntersecting && hasNextPage) {
92
99
  endObserver.current?.disconnect()
93
- fetchNextPage()
100
+ fetchNextPageRef.current()
94
101
  }
95
102
  },
96
103
  {
@@ -113,8 +120,6 @@ export const InfiniteList = <
113
120
  endObserver.current?.disconnect()
114
121
  }
115
122
  }, [
116
- fetchNextPage,
117
- fetchPreviousPage,
118
123
  hasNextPage,
119
124
  hasPreviousPage,
120
125
  isFetching,
@@ -348,6 +348,7 @@ const ExtensionRouteSection = () => {
348
348
  label={item.label}
349
349
  icon={item.icon ? item.icon : <SquaresPlus />}
350
350
  items={item.items}
351
+ translationNs={item.translationNs}
351
352
  type="extension"
352
353
  />
353
354
  )
@@ -17,6 +17,7 @@ type ItemType = "core" | "extension" | "setting"
17
17
  type NestedItemProps = {
18
18
  label: string
19
19
  to: string
20
+ translationNs?: string
20
21
  }
21
22
 
22
23
  export type INavItem = {
@@ -27,6 +28,7 @@ export type INavItem = {
27
28
  type?: ItemType
28
29
  from?: string
29
30
  nested?: string
31
+ translationNs?: string
30
32
  }
31
33
 
32
34
  const BASE_NAV_LINK_CLASSES =
@@ -90,10 +92,15 @@ export const NavItem = ({
90
92
  items,
91
93
  type = "core",
92
94
  from,
95
+ translationNs,
93
96
  }: INavItem) => {
97
+ const { t } = useTranslation(translationNs as any)
94
98
  const { pathname } = useLocation()
95
99
  const [open, setOpen] = useState(getIsOpen(to, items, pathname))
96
100
 
101
+ // Use translation if translationNs is provided, otherwise use label as-is
102
+ const displayLabel: string = translationNs ? t(label) : label
103
+
97
104
  useEffect(() => {
98
105
  setOpen(getIsOpen(to, items, pathname))
99
106
  }, [pathname, to, items])
@@ -150,7 +157,7 @@ export const NavItem = ({
150
157
  </div>
151
158
  )}
152
159
  <Text size="small" weight="plus" leading="compact">
153
- {label}
160
+ {displayLabel}
154
161
  </Text>
155
162
  </NavLink>
156
163
  </NavItemTooltip>
@@ -166,7 +173,7 @@ export const NavItem = ({
166
173
  <Icon icon={icon} type={type} />
167
174
  </div>
168
175
  <Text size="small" weight="plus" leading="compact">
169
- {label}
176
+ {displayLabel}
170
177
  </Text>
171
178
  </RadixCollapsible.Trigger>
172
179
  <RadixCollapsible.Content>
@@ -189,12 +196,15 @@ export const NavItem = ({
189
196
  }}
190
197
  >
191
198
  <Text size="small" weight="plus" leading="compact">
192
- {label}
199
+ {displayLabel}
193
200
  </Text>
194
201
  </NavLink>
195
202
  </NavItemTooltip>
196
203
  </li>
197
204
  {items.map((item) => {
205
+ const { t: itemT } = useTranslation(item.translationNs as any)
206
+ const itemLabel: string = item.translationNs ? itemT(item.label) : item.label
207
+
198
208
  return (
199
209
  <li key={item.to} className="flex h-7 items-center">
200
210
  <NavItemTooltip to={item.to}>
@@ -213,7 +223,7 @@ export const NavItem = ({
213
223
  }}
214
224
  >
215
225
  <Text size="small" weight="plus" leading="compact">
216
- {item.label}
226
+ {itemLabel}
217
227
  </Text>
218
228
  </NavLink>
219
229
  </NavItemTooltip>
@@ -42,6 +42,13 @@ type DashboardAppProps = {
42
42
  plugins: DashboardPlugin[]
43
43
  }
44
44
 
45
+ /**
46
+ * Matches segments that are optional and at the end of the path.
47
+ * Example: /path/to/:id?
48
+ * Such paths can be added to the menu items without the optional segment.
49
+ */
50
+ const OPTIONAL_LAST_SEGMENT_MATCH = /\/([^\/])+\?$/
51
+
45
52
  export class DashboardApp {
46
53
  private widgets: WidgetMap
47
54
  private menus: MenuMap
@@ -129,10 +136,11 @@ export class DashboardApp {
129
136
  allMenuItems.sort((a, b) => a.path.length - b.path.length)
130
137
 
131
138
  allMenuItems.forEach((item) => {
132
- if (item.path.includes("/:")) {
139
+ item.path = item.path.replace(OPTIONAL_LAST_SEGMENT_MATCH, "")
140
+ if (item.path.includes("/:") || item.path.endsWith("/*")) {
133
141
  if (process.env.NODE_ENV === "development") {
134
142
  console.warn(
135
- `[@medusajs/dashboard] Menu item for path "${item.path}" can't be added to the sidebar as it contains a parameter.`
143
+ `[@medusajs/dashboard] Menu item for path "${item.path}" can't be added to the sidebar as it contains a mandatory parameter.`
136
144
  )
137
145
  }
138
146
  return
@@ -179,6 +187,7 @@ export class DashboardApp {
179
187
  icon: item.icon ? <item.icon /> : undefined,
180
188
  items: [],
181
189
  nested: item.nested,
190
+ translationNs: item.translationNs,
182
191
  }
183
192
 
184
193
  if (parentPath !== "/" && tempRegistry[parentPath]) {
@@ -37,9 +37,10 @@ const createBranchRoute = (segment: string): RouteObject => ({
37
37
  const createLeafRoute = (
38
38
  Component: ComponentType,
39
39
  loader?: LoaderFunction,
40
- handle?: object
40
+ handle?: object,
41
+ path: string = ""
41
42
  ): RouteObject => ({
42
- path: "",
43
+ path,
43
44
  ErrorBoundary: ErrorBoundary,
44
45
  async lazy() {
45
46
  const result: {
@@ -149,7 +150,6 @@ const addRoute = (
149
150
 
150
151
  if (isComponentSegment || remainingSegments.length === 0) {
151
152
  route.children ||= []
152
- const leaf = createLeafRoute(Component, loader)
153
153
 
154
154
  if (handle) {
155
155
  route.handle = handle
@@ -159,9 +159,17 @@ const addRoute = (
159
159
  route.loader = loader
160
160
  }
161
161
 
162
- leaf.children = processParallelRoutes(parallelRoutes, currentFullPath)
163
- route.children.push(leaf)
164
-
162
+ // Since splat segments must occur at the end of a route, react-router enforces the segment to be a leaf.
163
+ // Therefore we can't create a child leaf route with `path: ""` and must instead modify the route itself
164
+ if (currentSegment === "*?" || currentSegment === "*") {
165
+ const leaf = createLeafRoute(Component, loader, handle, currentSegment)
166
+ leaf.children = processParallelRoutes(parallelRoutes, currentFullPath)
167
+ Object.assign(route, leaf)
168
+ } else {
169
+ const leaf = createLeafRoute(Component, loader)
170
+ leaf.children = processParallelRoutes(parallelRoutes, currentFullPath)
171
+ route.children.push(leaf)
172
+ }
165
173
  if (remainingSegments.length > 0) {
166
174
  addRoute(
167
175
  remainingSegments,
@@ -24,6 +24,7 @@ export type MenuItemExtension = {
24
24
  path: string
25
25
  icon?: ComponentType
26
26
  nested?: NestedRoutePosition
27
+ translationNs?: string
27
28
  }
28
29
 
29
30
  export type WidgetExtension = {
@@ -1,33 +1,34 @@
1
1
  import {
2
- de,
2
+ ar,
3
3
  bg,
4
+ bs,
5
+ cs,
6
+ de,
7
+ el,
4
8
  enUS,
5
9
  es,
10
+ faIR,
6
11
  fr,
7
12
  he,
13
+ hu,
14
+ id,
8
15
  it,
9
16
  ja,
17
+ ko,
18
+ lt,
19
+ mk,
20
+ mn,
21
+ nl,
10
22
  pl,
23
+ pt,
11
24
  ptBR,
25
+ ro,
26
+ ru,
12
27
  th,
13
28
  tr,
14
29
  uk,
15
- ro,
16
- mk,
17
- mn,
18
- ar,
19
- zhCN,
20
- faIR,
21
- cs,
22
- ru,
23
- el,
24
- lt,
25
30
  vi,
26
- ko,
27
- nl,
28
- hu,
29
- bs,
30
- id,
31
+ zhCN,
31
32
  } from "date-fns/locale"
32
33
  import { Language } from "./types"
33
34
 
@@ -110,6 +111,12 @@ export const languages: Language[] = [
110
111
  ltr: true,
111
112
  date_locale: ptBR,
112
113
  },
114
+ {
115
+ code: "ptPT",
116
+ display_name: "Português (Portugal)",
117
+ ltr: true,
118
+ date_locale: pt,
119
+ },
113
120
  {
114
121
  code: "tr",
115
122
  display_name: "Türkçe",
@@ -10,6 +10,7 @@ import it from "./it.json"
10
10
  import ja from "./ja.json"
11
11
  import pl from "./pl.json"
12
12
  import ptBR from "./ptBR.json"
13
+ import ptPT from "./ptPT.json"
13
14
  import th from "./th.json"
14
15
  import tr from "./tr.json"
15
16
  import uk from "./uk.json"
@@ -67,6 +68,9 @@ export default {
67
68
  ptBR: {
68
69
  translation: ptBR,
69
70
  },
71
+ ptPT: {
72
+ translation: ptPT,
73
+ },
70
74
  th: {
71
75
  translation: th,
72
76
  },