@medusajs/dashboard 2.12.3-snapshot-20251216185234 → 2.12.3

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 (126) hide show
  1. package/dist/add-locales-GGNZCABB.mjs +81 -0
  2. package/dist/{api-key-management-detail-6RCDH73M.mjs → api-key-management-detail-FRUN2KFK.mjs} +1 -1
  3. package/dist/app.css +19 -0
  4. package/dist/app.js +795 -680
  5. package/dist/app.mjs +2 -2
  6. package/dist/{campaign-detail-5Q4BYCPX.mjs → campaign-detail-HM3GQJLQ.mjs} +1 -1
  7. package/dist/{categories-metadata-J7M3XWI7.mjs → categories-metadata-WKL3MGD7.mjs} +1 -1
  8. package/dist/{category-detail-S5IPXMHX.mjs → category-detail-UTWWDKFP.mjs} +2 -2
  9. package/dist/{category-products-KPW6BA5J.mjs → category-products-XXBTCXFF.mjs} +2 -2
  10. package/dist/{chunk-OL24RDYM.mjs → chunk-5F427YCP.mjs} +2 -2
  11. package/dist/{chunk-MJDHVDOW.mjs → chunk-5ISRTMYH.mjs} +1 -1
  12. package/dist/{chunk-ST4P6BQN.mjs → chunk-DQUXK4WW.mjs} +1 -1
  13. package/dist/{chunk-YYOPBKME.mjs → chunk-DTCIBQO2.mjs} +1 -1
  14. package/dist/{chunk-LZFWCKOF.mjs → chunk-FKNW5MLZ.mjs} +21 -4
  15. package/dist/{chunk-GRZSG4EP.mjs → chunk-GLBHPDR4.mjs} +21 -16
  16. package/dist/{chunk-WYATCUOM.mjs → chunk-HNJ65IND.mjs} +1 -1
  17. package/dist/{store-add-locales-VJ4RJ7UI.mjs → chunk-IKTGFXWR.mjs} +2 -67
  18. package/dist/{chunk-DBXWB3RF.mjs → chunk-KSDXSKJ7.mjs} +1 -1
  19. package/dist/{chunk-OL6MEUKW.mjs → chunk-LWYKUORZ.mjs} +108 -105
  20. package/dist/{chunk-PHLCT2HA.mjs → chunk-OK6NZN2A.mjs} +1 -1
  21. package/dist/{chunk-ZMG5B4FG.mjs → chunk-SG2JZPTG.mjs} +1 -1
  22. package/dist/{chunk-CVHJAKLQ.mjs → chunk-UMCJYHAD.mjs} +1 -1
  23. package/dist/{collection-add-products-FU2BS3D3.mjs → collection-add-products-42F7H77E.mjs} +2 -2
  24. package/dist/{collection-detail-VJE7XHLV.mjs → collection-detail-PXIS3G64.mjs} +2 -2
  25. package/dist/{collection-list-IGA6SCNF.mjs → collection-list-O74CGY24.mjs} +2 -2
  26. package/dist/{collection-metadata-QK7MI3D2.mjs → collection-metadata-U6FMA4IC.mjs} +1 -1
  27. package/dist/{customer-detail-MOV2T3LF.mjs → customer-detail-OMTFJ6CE.mjs} +1 -1
  28. package/dist/{customer-group-detail-6T7OXGQD.mjs → customer-group-detail-ADK3M5LG.mjs} +1 -1
  29. package/dist/{customer-group-list-AJEAF5D2.mjs → customer-group-list-7ZRQ2HWU.mjs} +1 -1
  30. package/dist/{customers-add-customer-group-QVTVSQYM.mjs → customers-add-customer-group-5U27WHJB.mjs} +1 -1
  31. package/dist/{edit-rules-SMVRTCUP.mjs → edit-rules-BM2ERGVJ.mjs} +1 -1
  32. package/dist/en.json +1 -2
  33. package/dist/{inventory-create-BK52VALF.mjs → inventory-create-7MA7B5N2.mjs} +2 -2
  34. package/dist/{inventory-detail-ZPSEMYI2.mjs → inventory-detail-B4PRHZK3.mjs} +1 -1
  35. package/dist/{inventory-metadata-FNEJ3RAT.mjs → inventory-metadata-C7MJ3GY5.mjs} +1 -1
  36. package/dist/{inventory-stock-6WYWLWJ7.mjs → inventory-stock-WVTYPJTX.mjs} +3 -3
  37. package/dist/{location-detail-N3GUZSY7.mjs → location-detail-KO6EBDK5.mjs} +1 -1
  38. package/dist/{location-fulfillment-providers-7ZUJAGNY.mjs → location-fulfillment-providers-IORBE3E3.mjs} +2 -2
  39. package/dist/{location-service-zone-shipping-option-create-CNRWYZQC.mjs → location-service-zone-shipping-option-create-2R3ZFLVK.mjs} +3 -3
  40. package/dist/{location-service-zone-shipping-option-pricing-OGWI7VPT.mjs → location-service-zone-shipping-option-pricing-5HN2Z5RB.mjs} +2 -2
  41. package/dist/{login-VNOLI5YG.mjs → login-XKB6OR7I.mjs} +1 -1
  42. package/dist/{order-create-claim-SCDJGM46.mjs → order-create-claim-NKCOGF4A.mjs} +1 -1
  43. package/dist/{order-create-edit-2WALBPXS.mjs → order-create-edit-UNQYXGLL.mjs} +1 -1
  44. package/dist/{order-create-exchange-LQU4YN7F.mjs → order-create-exchange-WI7OA2WO.mjs} +1 -1
  45. package/dist/{order-create-fulfillment-OWUVTZXW.mjs → order-create-fulfillment-2LJTEWDY.mjs} +1 -1
  46. package/dist/{order-create-refund-Q6HQY42R.mjs → order-create-refund-7K6UJXGP.mjs} +1 -1
  47. package/dist/{order-create-shipment-WAGGEPRW.mjs → order-create-shipment-ZTDLLUBY.mjs} +1 -1
  48. package/dist/{order-detail-PVPGEWGY.mjs → order-detail-JTRUMRLO.mjs} +1 -1
  49. package/dist/{order-edit-billing-address-UM76J4KX.mjs → order-edit-billing-address-YHYNVLOE.mjs} +1 -1
  50. package/dist/{order-edit-email-CL3KNOCM.mjs → order-edit-email-TCQPEVZY.mjs} +1 -1
  51. package/dist/{order-edit-shipping-address-PIESTGVL.mjs → order-edit-shipping-address-CFSYQLKD.mjs} +1 -1
  52. package/dist/{order-export-LE363ZLB.mjs → order-export-G4SBNEJ7.mjs} +1 -1
  53. package/dist/{order-metadata-FHBB7MTG.mjs → order-metadata-KGPB37VL.mjs} +1 -1
  54. package/dist/{order-receive-return-PRVKP6J2.mjs → order-receive-return-JER24SEV.mjs} +1 -1
  55. package/dist/{order-request-transfer-XSAGRUMT.mjs → order-request-transfer-3FBUYZNT.mjs} +1 -1
  56. package/dist/{price-list-create-K5JEZT57.mjs → price-list-create-CXZCFFTP.mjs} +4 -4
  57. package/dist/{price-list-detail-Q5VG5VGW.mjs → price-list-detail-XOMU6U5J.mjs} +2 -2
  58. package/dist/{price-list-prices-add-2MQ226U4.mjs → price-list-prices-add-SDX5CQME.mjs} +4 -4
  59. package/dist/{price-list-prices-edit-OJZLV7OS.mjs → price-list-prices-edit-EKB6NI5D.mjs} +2 -2
  60. package/dist/{product-attributes-YF4TZOIO.mjs → product-attributes-STD47BGC.mjs} +2 -2
  61. package/dist/{product-create-KJML2332.mjs → product-create-LVGWVQAT.mjs} +3 -3
  62. package/dist/{product-create-variant-5EBCLM54.mjs → product-create-variant-OTJKT6WI.mjs} +2 -2
  63. package/dist/{product-detail-QG72542C.mjs → product-detail-OYVHJH3D.mjs} +2 -2
  64. package/dist/{product-edit-DZZR775Q.mjs → product-edit-3SIUUIW4.mjs} +2 -2
  65. package/dist/{product-export-5AD7NELI.mjs → product-export-57UUAGXF.mjs} +2 -2
  66. package/dist/{product-image-variants-edit-M6QF2RLE.mjs → product-image-variants-edit-2BW5BJON.mjs} +1 -1
  67. package/dist/{product-import-V3KQN4TV.mjs → product-import-6EM4VUXP.mjs} +1 -1
  68. package/dist/{product-list-EUWZIFTM.mjs → product-list-5V5GEH5K.mjs} +2 -2
  69. package/dist/{product-metadata-GL2MVPDI.mjs → product-metadata-JZLHBLZQ.mjs} +1 -1
  70. package/dist/{product-organization-O7RHELMQ.mjs → product-organization-3PQ45C4B.mjs} +2 -2
  71. package/dist/{product-prices-YWV6MSM6.mjs → product-prices-5ZL2RP7A.mjs} +1 -1
  72. package/dist/{product-stock-AKEFMK5O.mjs → product-stock-SJJABF6I.mjs} +3 -3
  73. package/dist/{product-tag-create-PQMDDKWH.mjs → product-tag-create-XXO4AQEC.mjs} +1 -1
  74. package/dist/{product-tag-detail-I3MBZX7U.mjs → product-tag-detail-BSK64HXL.mjs} +3 -3
  75. package/dist/{product-tag-edit-K3BBQLJR.mjs → product-tag-edit-ENCGDT7E.mjs} +1 -1
  76. package/dist/{product-tag-list-JUWSOMB7.mjs → product-tag-list-SLQGCNDZ.mjs} +3 -3
  77. package/dist/{product-tag-metadata-MJH5LH7E.mjs → product-tag-metadata-EPXHMU2K.mjs} +1 -1
  78. package/dist/{product-type-detail-RKHT5NBL.mjs → product-type-detail-4CRRU7YK.mjs} +2 -2
  79. package/dist/{product-type-metadata-CDJDFFGQ.mjs → product-type-metadata-73OKOGPP.mjs} +1 -1
  80. package/dist/{product-variant-detail-XAYG5CKE.mjs → product-variant-detail-RPHLG4HU.mjs} +1 -1
  81. package/dist/{product-variant-edit-DEZEY2H2.mjs → product-variant-edit-JF7NN64Y.mjs} +1 -1
  82. package/dist/{product-variant-metadata-VTZDNWUT.mjs → product-variant-metadata-HU2CXGPO.mjs} +1 -1
  83. package/dist/{promotion-create-HWFNUQXG.mjs → promotion-create-BHA3FQG2.mjs} +1 -1
  84. package/dist/{promotion-detail-QC36KXB3.mjs → promotion-detail-F3QSR52W.mjs} +1 -1
  85. package/dist/{refund-reason-create-YHCDEHGQ.mjs → refund-reason-create-ZA5TKW2Z.mjs} +1 -1
  86. package/dist/{refund-reason-edit-CZ5QZ2SZ.mjs → refund-reason-edit-N2CRCLKZ.mjs} +1 -1
  87. package/dist/{refund-reason-list-OJYYEYJE.mjs → refund-reason-list-SE4TMGMT.mjs} +1 -1
  88. package/dist/{region-metadata-H6XXUQ4S.mjs → region-metadata-O5NZBWXP.mjs} +1 -1
  89. package/dist/{reservation-detail-LZAQL4XA.mjs → reservation-detail-UFK6XIXE.mjs} +1 -1
  90. package/dist/{reservation-metadata-5HZSDDOK.mjs → reservation-metadata-AEJEKGLV.mjs} +1 -1
  91. package/dist/{sales-channel-add-products-F7YV4MO5.mjs → sales-channel-add-products-2LMB7EF5.mjs} +2 -2
  92. package/dist/{sales-channel-detail-MXIPZCGA.mjs → sales-channel-detail-EUQ4STQI.mjs} +2 -2
  93. package/dist/{sales-channel-list-RLGL7FM3.mjs → sales-channel-list-JXKGHX4G.mjs} +1 -1
  94. package/dist/{sales-channel-metadata-M364R4RJ.mjs → sales-channel-metadata-AJMQ5SQ2.mjs} +1 -1
  95. package/dist/{shipping-option-type-create-C5WUWON7.mjs → shipping-option-type-create-YVVIA2XC.mjs} +1 -1
  96. package/dist/{shipping-option-type-detail-PENS2K73.mjs → shipping-option-type-detail-ZZW36XLK.mjs} +2 -2
  97. package/dist/{shipping-option-type-edit-CIU5EHRP.mjs → shipping-option-type-edit-O6F74T3A.mjs} +1 -1
  98. package/dist/{shipping-option-type-list-DIOX7VG7.mjs → shipping-option-type-list-SPTE7MT6.mjs} +2 -2
  99. package/dist/{shipping-profile-metadata-75G2NNMA.mjs → shipping-profile-metadata-7WFE55VG.mjs} +1 -1
  100. package/dist/store-add-locales-GWCGIXHU.mjs +81 -0
  101. package/dist/{store-detail-JSNPOB2F.mjs → store-detail-YLJLBBZE.mjs} +1 -1
  102. package/dist/{store-metadata-CYXTVJUE.mjs → store-metadata-BZ57I2E6.mjs} +1 -1
  103. package/dist/{tax-region-create-DWGL4EUT.mjs → tax-region-create-FGTV7VJL.mjs} +1 -1
  104. package/dist/{tax-region-detail-2AE2EFI3.mjs → tax-region-detail-PPIMD7OX.mjs} +5 -5
  105. package/dist/{tax-region-edit-EEVEEU2Q.mjs → tax-region-edit-ELZKA7YH.mjs} +1 -1
  106. package/dist/{tax-region-province-detail-4ERSEQFF.mjs → tax-region-province-detail-FV2NDT3E.mjs} +5 -5
  107. package/dist/{tax-region-tax-override-create-PHCGEF7V.mjs → tax-region-tax-override-create-N572MQPZ.mjs} +3 -3
  108. package/dist/{tax-region-tax-override-edit-SMRPSILC.mjs → tax-region-tax-override-edit-5DCSJW6D.mjs} +4 -4
  109. package/dist/{translation-list-UF7FLXOW.mjs → translation-list-FK7XYLHX.mjs} +227 -141
  110. package/dist/{translations-edit-USQJNMAY.mjs → translations-edit-VRXZI5KW.mjs} +224 -253
  111. package/dist/{user-metadata-2WPJOEJA.mjs → user-metadata-GRJZZ524.mjs} +1 -1
  112. package/dist/{workflow-execution-detail-H2AKEZJX.mjs → workflow-execution-detail-HXTFWGKG.mjs} +1 -1
  113. package/package.json +9 -9
  114. package/src/components/data-grid/hooks/use-data-grid-cell.tsx +1 -0
  115. package/src/components/data-grid/hooks/use-data-grid-form-handlers.tsx +1 -0
  116. package/src/components/data-grid/hooks/use-data-grid-keydown-event.tsx +22 -4
  117. package/src/dashboard-app/routes/get-route.map.tsx +4 -0
  118. package/src/hooks/api/translations.tsx +26 -17
  119. package/src/i18n/translations/en.json +1 -2
  120. package/src/i18n/translations/es.json +1 -1
  121. package/src/routes/translations/add-locales/add-locales.tsx +29 -0
  122. package/src/routes/translations/add-locales/index.tsx +1 -0
  123. package/src/routes/translations/translation-list/components/active-locales-section/active-locales-section.tsx +42 -17
  124. package/src/routes/translations/translation-list/components/translation-list-section/translation-list-section.tsx +5 -1
  125. package/src/routes/translations/translation-list/components/translations-completion-section/translations-completion-section.tsx +182 -121
  126. package/src/routes/translations/translations-edit/components/translations-edit-form/translations-edit-form.tsx +285 -330
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medusajs/dashboard",
3
- "version": "2.12.3-snapshot-20251216185234",
3
+ "version": "2.12.3",
4
4
  "scripts": {
5
5
  "generate:static": "node ./scripts/generate-currencies.js && prettier --write ./src/lib/currencies.ts",
6
6
  "dev": "../../../node_modules/.bin/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": "2.12.3-snapshot-20251216185234",
50
- "@medusajs/icons": "2.12.3-snapshot-20251216185234",
51
- "@medusajs/js-sdk": "2.12.3-snapshot-20251216185234",
52
- "@medusajs/ui": "4.0.31-snapshot-20251216185234",
49
+ "@medusajs/admin-shared": "2.12.3",
50
+ "@medusajs/icons": "2.12.3",
51
+ "@medusajs/js-sdk": "2.12.3",
52
+ "@medusajs/ui": "4.0.31",
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",
@@ -80,10 +80,10 @@
80
80
  "zod": "3.25.76"
81
81
  },
82
82
  "devDependencies": {
83
- "@medusajs/admin-shared": "2.12.3-snapshot-20251216185234",
84
- "@medusajs/admin-vite-plugin": "2.12.3-snapshot-20251216185234",
85
- "@medusajs/types": "2.12.3-snapshot-20251216185234",
86
- "@medusajs/ui-preset": "2.12.3-snapshot-20251216185234"
83
+ "@medusajs/admin-shared": "2.12.3",
84
+ "@medusajs/admin-vite-plugin": "2.12.3",
85
+ "@medusajs/types": "2.12.3",
86
+ "@medusajs/ui-preset": "2.12.3"
87
87
  },
88
88
  "packageManager": "yarn@3.2.1"
89
89
  }
@@ -128,6 +128,7 @@ export const useDataGridCell = <TData, TValue>({
128
128
  case "number":
129
129
  return numberCharacterRegex.test(key)
130
130
  case "text":
131
+ case "multiline-text":
131
132
  return textCharacterRegex.test(key)
132
133
  default:
133
134
  // KeyboardEvents should not be forwareded to other types of cells
@@ -228,6 +228,7 @@ export function convertArrayToPrimitive(
228
228
  case "boolean":
229
229
  return values.map(convertToBoolean)
230
230
  case "text":
231
+ case "multiline-text":
231
232
  return values.map(covertToString)
232
233
  default:
233
234
  throw new Error(`Unsupported target type "${type}".`)
@@ -211,7 +211,22 @@ export const useDataGridKeydownEvent = <
211
211
  [rangeEnd, matrix, getSelectionValues, setSelectionValues, execute]
212
212
  )
213
213
 
214
- const handleSpaceKeyTextOrNumber = useCallback(
214
+ const handleSpaceKeyText = useCallback(
215
+ (anchor: DataGridCoordinates) => {
216
+ const field = matrix.getCellField(anchor)
217
+ const input = queryTool?.getInput(anchor)
218
+
219
+ if (!field || !input) {
220
+ return
221
+ }
222
+
223
+ createSnapshot(anchor)
224
+ input.focus()
225
+ },
226
+ [matrix, queryTool, createSnapshot]
227
+ )
228
+
229
+ const handleSpaceKeyNumber = useCallback(
215
230
  (anchor: DataGridCoordinates) => {
216
231
  const field = matrix.getCellField(anchor)
217
232
  const input = queryTool?.getInput(anchor)
@@ -303,10 +318,12 @@ export const useDataGridKeydownEvent = <
303
318
  case "togglable-number":
304
319
  handleSpaceKeyTogglableNumber(anchor)
305
320
  break
306
- case "number":
307
321
  case "text":
308
322
  case "multiline-text":
309
- handleSpaceKeyTextOrNumber(anchor)
323
+ handleSpaceKeyText(anchor)
324
+ break
325
+ case "number":
326
+ handleSpaceKeyNumber(anchor)
310
327
  break
311
328
  }
312
329
  },
@@ -315,7 +332,8 @@ export const useDataGridKeydownEvent = <
315
332
  isEditing,
316
333
  matrix,
317
334
  handleSpaceKeyBoolean,
318
- handleSpaceKeyTextOrNumber,
335
+ handleSpaceKeyText,
336
+ handleSpaceKeyNumber,
319
337
  handleSpaceKeyTogglableNumber,
320
338
  ]
321
339
  )
@@ -1857,6 +1857,10 @@ export function getRouteMap({
1857
1857
  lazy: () =>
1858
1858
  import("../../routes/translations/translations-edit"),
1859
1859
  },
1860
+ {
1861
+ path: "add-locales",
1862
+ lazy: () => import("../../routes/translations/add-locales"),
1863
+ },
1860
1864
  ],
1861
1865
  },
1862
1866
  ...(settingsRoutes?.[0]?.children || []),
@@ -229,6 +229,15 @@ export const useTranslations = (
229
229
  return { ...data, ...rest }
230
230
  }
231
231
 
232
+ const referenceInvalidationKeysMap = new Map<string, QueryKey>([
233
+ ["product", productsQueryKeys.lists()],
234
+ ["product_variant", productVariantQueryKeys.lists()],
235
+ ["product_category", categoriesQueryKeys.lists()],
236
+ ["product_collection", collectionsQueryKeys.lists()],
237
+ ["product_type", productTypesQueryKeys.lists()],
238
+ ["product_tag", productTagsQueryKeys.lists()],
239
+ ])
240
+
232
241
  export const useBatchTranslations = (
233
242
  reference: string,
234
243
  options?: UseMutationOptions<
@@ -237,30 +246,30 @@ export const useBatchTranslations = (
237
246
  HttpTypes.AdminBatchTranslations
238
247
  >
239
248
  ) => {
240
- const referenceInvalidationKeysMap = new Map<string, QueryKey>([
241
- ["product", productsQueryKeys.lists()],
242
- ["product_variant", productVariantQueryKeys.lists()],
243
- ["product_category", categoriesQueryKeys.lists()],
244
- ["product_collection", collectionsQueryKeys.lists()],
245
- ["product_type", productTypesQueryKeys.lists()],
246
- ["product_tag", productTagsQueryKeys.lists()],
247
- ])
248
-
249
- return useMutation({
249
+ const mutation = useMutation({
250
250
  mutationFn: (payload: HttpTypes.AdminBatchTranslations) =>
251
251
  sdk.admin.translation.batch(payload),
252
- onSuccess: (data, variables, context) => {
252
+ ...options,
253
+ })
254
+
255
+ /**
256
+ * Useful to call the invalidation separately from the batch request and await the refetch finishes.
257
+ */
258
+ const invalidateQueries = async () => {
259
+ await Promise.all([
253
260
  queryClient.invalidateQueries({
254
261
  queryKey: referenceInvalidationKeysMap.get(reference),
255
- })
262
+ }),
256
263
  queryClient.invalidateQueries({
257
264
  queryKey: translationStatisticsQueryKeys.lists(),
258
- })
265
+ }),
266
+ ])
267
+ }
259
268
 
260
- options?.onSuccess?.(data, variables, context)
261
- },
262
- ...options,
263
- })
269
+ return {
270
+ ...mutation,
271
+ invalidateQueries,
272
+ }
264
273
  }
265
274
 
266
275
  export const useTranslationSettings = (
@@ -2514,7 +2514,6 @@
2514
2514
  "manage": "Manage translations",
2515
2515
  "manageLocales": "Manage locales"
2516
2516
  },
2517
- "title": "Translation domains",
2518
2517
  "subtitle": "Manage translations of your data in Medusa",
2519
2518
  "list": {
2520
2519
  "metrics": "{{translated}} of {{total}} fields translated"
@@ -2538,7 +2537,7 @@
2538
2537
  "completion": {
2539
2538
  "heading": "Translated fields",
2540
2539
  "translated": "Translated",
2541
- "toTranslate": "To be translated",
2540
+ "toTranslate": "Missing",
2542
2541
  "footer": "Languages"
2543
2542
  }
2544
2543
  },
@@ -2477,7 +2477,7 @@
2477
2477
  "completion": {
2478
2478
  "heading": "Textos traducidos",
2479
2479
  "translated": "Traducidos",
2480
- "toTranslate": "Por traducir",
2480
+ "toTranslate": "Faltantes",
2481
2481
  "footer": "Idiomas"
2482
2482
  }
2483
2483
  },
@@ -0,0 +1,29 @@
1
+ import { RouteFocusModal } from "../../../components/modals/route-focus-modal"
2
+ import { useStore } from "../../../hooks/api"
3
+ import { useFeatureFlag } from "../../../providers/feature-flag-provider"
4
+ import { useNavigate } from "react-router-dom"
5
+ import { AddLocalesForm } from "../../store/store-add-locales/components/add-locales-form/add-locales-form"
6
+
7
+ export const TranslationsAddLocales = () => {
8
+ const isEnabled = useFeatureFlag("translation")
9
+ const navigate = useNavigate()
10
+
11
+ if (!isEnabled) {
12
+ navigate(-1)
13
+ return null
14
+ }
15
+
16
+ const { store, isPending, isError, error } = useStore()
17
+
18
+ const ready = !!store && !isPending
19
+
20
+ if (isError) {
21
+ throw error
22
+ }
23
+
24
+ return (
25
+ <RouteFocusModal>
26
+ {ready && <AddLocalesForm store={store} />}
27
+ </RouteFocusModal>
28
+ )
29
+ }
@@ -0,0 +1 @@
1
+ export { TranslationsAddLocales as Component } from "./add-locales"
@@ -1,9 +1,16 @@
1
1
  import { PencilSquare, Language } from "@medusajs/icons"
2
- import { Container, Heading, IconButton, InlineTip, Text } from "@medusajs/ui"
2
+ import {
3
+ Container,
4
+ Heading,
5
+ IconButton,
6
+ InlineTip,
7
+ Text,
8
+ Tooltip,
9
+ } from "@medusajs/ui"
3
10
  import { useTranslation } from "react-i18next"
4
11
  import { IconAvatar } from "../../../../../components/common/icon-avatar"
5
12
  import { HttpTypes } from "@medusajs/types"
6
- import { useCallback } from "react"
13
+ import { useCallback, useState } from "react"
7
14
  import { useNavigate } from "react-router-dom"
8
15
 
9
16
  type ActiveLocalesSectionProps = {
@@ -15,9 +22,10 @@ export const ActiveLocalesSection = ({
15
22
  }: ActiveLocalesSectionProps) => {
16
23
  const { t } = useTranslation()
17
24
  const navigate = useNavigate()
25
+ const [isHovered, setIsHovered] = useState(false)
18
26
 
19
27
  const handleManageLocales = useCallback(() => {
20
- navigate("/settings/store/locales")
28
+ navigate("/settings/translations/add-locales")
21
29
  }, [navigate])
22
30
 
23
31
  const renderLocales = useCallback(() => {
@@ -37,26 +45,43 @@ export const ActiveLocalesSection = ({
37
45
  return (
38
46
  <Container className="flex flex-col p-0">
39
47
  <div className="flex items-center justify-between px-6 py-4">
40
- <Heading>{t("translations.activeLocales.heading")}</Heading>
48
+ <Heading level="h2">{t("translations.activeLocales.heading")}</Heading>
41
49
  <IconButton variant="transparent" onClick={handleManageLocales}>
42
50
  <PencilSquare></PencilSquare>
43
51
  </IconButton>
44
52
  </div>
45
53
  <div className="px-1 pb-1">
46
54
  {hasLocales ? (
47
- <Container className="bg-ui-bg-component flex items-center gap-x-4 px-6 py-2">
48
- <IconAvatar>
49
- <Language />
50
- </IconAvatar>
51
- <div className="flex flex-col">
52
- <Text size="small" weight="plus">
53
- {t("translations.activeLocales.subtitle")}
54
- </Text>
55
- <Text className="text-ui-fg-subtle" size="small">
56
- {renderLocales()}
57
- </Text>
58
- </div>
59
- </Container>
55
+ <Tooltip
56
+ open={isHovered}
57
+ content={
58
+ <div className="flex flex-col gap-y-1 p-1">
59
+ {locales.map((locale) => (
60
+ <Text key={locale.code} size="small" weight="plus">
61
+ {locale.name}
62
+ </Text>
63
+ ))}
64
+ </div>
65
+ }
66
+ >
67
+ <Container
68
+ className="bg-ui-bg-component border-r-1 flex items-center gap-x-4 px-[19px] py-2"
69
+ onMouseEnter={() => setIsHovered(true)}
70
+ onMouseLeave={() => setIsHovered(false)}
71
+ >
72
+ <IconAvatar className="border-ui-border-base border">
73
+ <Language />
74
+ </IconAvatar>
75
+ <div className="flex flex-col">
76
+ <Text size="small" weight="plus">
77
+ {t("translations.activeLocales.subtitle")}
78
+ </Text>
79
+ <Text className="text-ui-fg-subtle" size="small">
80
+ {renderLocales()}
81
+ </Text>
82
+ </div>
83
+ </Container>
84
+ </Tooltip>
60
85
  ) : (
61
86
  <InlineTip label="Tip">
62
87
  {t("translations.activeLocales.noLocalesTip")}
@@ -33,7 +33,11 @@ export const TranslationListSection = ({
33
33
  <Link
34
34
  to={`/settings/translations/edit?reference=${entity.reference}`}
35
35
  >
36
- <Button variant="secondary" size="small" disabled={!hasLocales}>
36
+ <Button
37
+ variant="secondary"
38
+ size="small"
39
+ disabled={!hasLocales || !entity.totalCount}
40
+ >
37
41
  Edit
38
42
  </Button>
39
43
  </Link>