@vtex/faststore-plugin-buyer-portal 2.0.13 → 2.0.14

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 (219) hide show
  1. package/CHANGELOG.md +18 -1
  2. package/cms/b2b/components/.gitkeep +0 -0
  3. package/cms/b2b/pages/cms_content_type__i18n.jsonc +36 -0
  4. package/cypress/integration/localization.test.ts +482 -0
  5. package/cypress/support/commands.ts +8 -0
  6. package/docs/i18n/i18n-messages-format.md +391 -0
  7. package/docs/i18n/locales.json +701 -0
  8. package/docs/i18n/migration-inventory.md +959 -0
  9. package/package.json +3 -3
  10. package/specs/custom-localization-system.md +711 -0
  11. package/specs/multi-locale-e2e-validation.md +277 -0
  12. package/src/__mocks__/discovery.config.ts +12 -0
  13. package/src/features/accounting-fields/components/AccountingConfirmDelete/AccountingConfirmDelete.tsx +14 -4
  14. package/src/features/accounting-fields/components/AccountingFieldConfirmEdit/AccountingFieldConfirmEdit.tsx +11 -6
  15. package/src/features/accounting-fields/components/AccountingFieldDropdown/AccountingFieldDropdown.tsx +5 -3
  16. package/src/features/accounting-fields/components/AccountingFieldForm/AccountingFieldForm.tsx +33 -23
  17. package/src/features/accounting-fields/components/AccountingValueConfirmEdit/AccountingValueConfirmEdit.tsx +10 -6
  18. package/src/features/accounting-fields/components/AccountingValueDropdown/AccountingValueDropdown.tsx +19 -9
  19. package/src/features/accounting-fields/components/AccountingValueForm/AccountingValueForm.tsx +21 -10
  20. package/src/features/accounting-fields/components/CreateAccountingFieldDrawer/CreateAccountingFieldDrawer.tsx +11 -8
  21. package/src/features/accounting-fields/components/CreateAccountingValueDrawer/CreateAccountingValueDrawer.tsx +18 -7
  22. package/src/features/accounting-fields/components/DeleteAccountingFieldDrawer/DeleteAccountingFieldDrawer.tsx +14 -12
  23. package/src/features/accounting-fields/components/DeleteAccountingValueDrawer/DeleteAccountingValueDrawer.tsx +20 -10
  24. package/src/features/accounting-fields/components/EditAccountingFieldDrawer/EditAccountingFieldDrawer.tsx +5 -3
  25. package/src/features/accounting-fields/components/EditAccountingValueDrawer/EditAccountingValueDrawer.tsx +13 -6
  26. package/src/features/accounting-fields/components/RemoveValueFromUnitDrawer/RemoveValueFromUnitDrawer.tsx +19 -8
  27. package/src/features/accounting-fields/layouts/AccountingFieldLayout/AccountingFieldLayout.tsx +11 -9
  28. package/src/features/addresses/components/AddRecipientsDrawer/AddRecipientsDrawer.tsx +13 -7
  29. package/src/features/addresses/components/AddressDropdownMenu/AddressDropdownMenu.tsx +22 -20
  30. package/src/features/addresses/components/AddressForm/AddressForm.tsx +33 -22
  31. package/src/features/addresses/components/AddressLine/AddressLine.tsx +29 -25
  32. package/src/features/addresses/components/AddressLocationsList/AddressLocationsList.tsx +15 -6
  33. package/src/features/addresses/components/AddressRecipientsList/AddressRecipientsList.tsx +9 -4
  34. package/src/features/addresses/components/AddressesCard/AddressesCard.tsx +8 -5
  35. package/src/features/addresses/components/CreateAddressDrawer/CreateAddressDrawer.tsx +27 -14
  36. package/src/features/addresses/components/CreateAddressSettingsDrawer/CreateAddressSettingsDrawer.tsx +26 -21
  37. package/src/features/addresses/components/DeleteAddressDrawer/DeleteAddressDrawer.tsx +20 -16
  38. package/src/features/addresses/components/DeleteAddressLocationDrawer/DeleteAddressLocationDrawer.tsx +26 -14
  39. package/src/features/addresses/components/DeleteRecipientAddressDrawer/DeleteRecipientAddressDrawer.tsx +20 -17
  40. package/src/features/addresses/components/EditAddressDrawer/EditAddressDrawer.tsx +12 -6
  41. package/src/features/addresses/components/EditAddressLocationDrawer/EditAddressLocationDrawer.tsx +24 -17
  42. package/src/features/addresses/components/EditRecipientAddressDrawer/EditRecipientAddressDrawer.tsx +17 -15
  43. package/src/features/addresses/components/LocationForm/LocationField/LocationField.tsx +8 -5
  44. package/src/features/addresses/components/LocationForm/LocationForm.tsx +9 -3
  45. package/src/features/addresses/components/LocationsDrawer/LocationsDrawer.tsx +15 -9
  46. package/src/features/addresses/components/RecipientsForm/RecipientItem/RecipientItem.tsx +55 -46
  47. package/src/features/addresses/components/RecipientsForm/RecipientsForm.tsx +4 -1
  48. package/src/features/addresses/components/RemoveAddressDrawer/RemoveAddressDrawer.tsx +21 -14
  49. package/src/features/addresses/layouts/AddressDetailsLayout/AddressDetailsLayout.tsx +16 -9
  50. package/src/features/addresses/layouts/AddressesLayout/AddressesLayout.tsx +11 -8
  51. package/src/features/b2b-agent/layouts/B2BAgentLayout/B2BAgentLayout.tsx +3 -1
  52. package/src/features/budgets/components/BudgetAddForm/BudgetAddForm.tsx +14 -12
  53. package/src/features/budgets/components/BudgetAddSuccess/BudgetAddSuccess.tsx +16 -14
  54. package/src/features/budgets/components/BudgetAllocationsSelection/BudgetAllocationsSelection.tsx +8 -5
  55. package/src/features/budgets/components/BudgetAllocationsTable/BudgetAllocationsTable.tsx +9 -6
  56. package/src/features/budgets/components/BudgetDeleteDrawer/BudgetDeleteDrawer.tsx +23 -17
  57. package/src/features/budgets/components/BudgetEditNotificationDrawer/BudgetEditNotificationDrawer.tsx +13 -6
  58. package/src/features/budgets/components/BudgetNotificationForm/BudgetNotificationForm.tsx +31 -24
  59. package/src/features/budgets/components/BudgetNotificationsInfo/BudgetNotificationsInfo.tsx +15 -9
  60. package/src/features/budgets/components/BudgetRemainingBalance/BudgetRemainingBalance.tsx +6 -2
  61. package/src/features/budgets/components/BudgetSettingsInfo/BudgetSettingsInfo.tsx +27 -10
  62. package/src/features/budgets/components/BudgetUsersTable/BudgetUsersTable.tsx +14 -7
  63. package/src/features/budgets/components/BudgetsTable/BudgetsTable.tsx +11 -8
  64. package/src/features/budgets/components/CreateBudgetAllocationDrawer/CreateBudgetAllocationDrawer.tsx +8 -5
  65. package/src/features/budgets/components/CreateBudgetDrawer/CreateBudgetDrawer.tsx +31 -18
  66. package/src/features/budgets/components/DeleteBudgetAllocationDrawer/DeleteBudgetAllocationDrawer.tsx +17 -12
  67. package/src/features/budgets/components/EditBudgetDrawer/EditBudgetDrawer.tsx +14 -8
  68. package/src/features/budgets/components/EmptyState.tsx/EmptyState.tsx +4 -1
  69. package/src/features/budgets/layouts/BudgetsDetailsLayout/BudgetsDetailsLayout.tsx +7 -5
  70. package/src/features/budgets/layouts/BudgetsLayout/BudgetsLayout.tsx +5 -3
  71. package/src/features/budgets/messages/budgetNotifications.ts +5 -5
  72. package/src/features/budgets/utils/handleBudgetError.tsx +5 -8
  73. package/src/features/budgets/utils/handleBudgetError.types.ts +3 -0
  74. package/src/features/buying-policies/components/AccountingFieldCriteriaSelector/AccountingFieldCriteriaSelector.tsx +5 -3
  75. package/src/features/buying-policies/components/AccountingFieldCriteriaSelector/AccountingValueCriteriaSelector.tsx +20 -9
  76. package/src/features/buying-policies/components/AddBuyingPolicyDrawer/AddBuyingPolicyDrawer.tsx +8 -5
  77. package/src/features/buying-policies/components/BasicBuyingPolicyDrawer/BasicBuyingPolicyDrawer.tsx +49 -33
  78. package/src/features/buying-policies/components/BudgetCriteriaSelector/BudgetCriteriaSelector.tsx +8 -2
  79. package/src/features/buying-policies/components/BuyingPolicyDropdownMenu/BuyingPolicyDropdownMenu.tsx +5 -3
  80. package/src/features/buying-policies/components/DeleteBuyingPolicyDrawer/DeleteBuyingPolicyDrawer.tsx +28 -24
  81. package/src/features/buying-policies/components/UpdateBuyingPolicyDrawer/UpdateBuyingPolicyDrawer.tsx +10 -7
  82. package/src/features/buying-policies/layouts/BuyingPoliciesLayout/BuyingPoliciesLayout.tsx +11 -4
  83. package/src/features/buying-policies/layouts/BuyingPolicyDetailsLayout/BuyingPolicyDetailsLayout.tsx +26 -9
  84. package/src/features/buying-policies/utils/accountingFieldCriteriaHelpers.ts +2 -2
  85. package/src/features/buying-policies/utils/buyingPoliciesWorkflowTypes.ts +3 -3
  86. package/src/features/buying-policies/utils/orderFieldsCriteriaOptions.ts +8 -8
  87. package/src/features/buying-policies/utils/spendingLimitsCriteriaOptions.ts +6 -6
  88. package/src/features/contracts/components/ContractsCard/ContractsCard.tsx +7 -5
  89. package/src/features/contracts/layouts/ContractsLayout/ContractsLayout.tsx +9 -4
  90. package/src/features/credit-cards/components/CreateCreditCardDrawer/CreateCreditCardDrawer.tsx +17 -11
  91. package/src/features/credit-cards/components/CreditCardDropdownMenu/CreditCardDropdownMenu.tsx +17 -11
  92. package/src/features/credit-cards/components/CreditCardForm/CreditCardForm.tsx +8 -5
  93. package/src/features/credit-cards/components/CreditCardSettingsDrawer/CreditCardSettingsDrawer.tsx +10 -8
  94. package/src/features/credit-cards/components/DeleteCreditCardDrawer/DeleteCreditCardDrawer.tsx +19 -14
  95. package/src/features/credit-cards/components/EditCreditCardDrawer/EditCreditCardDrawer.tsx +14 -13
  96. package/src/features/credit-cards/components/RemoveCreditCardDrawer/RemoveCreditCardDrawer.tsx +18 -15
  97. package/src/features/credit-cards/layouts/CreditCardsLayout/CreditCardLayout.tsx +10 -4
  98. package/src/features/order-entry/layouts/OrderEntryLayout.tsx +3 -1
  99. package/src/features/org-units/components/AddAllToOrgUnitDropdown/AddAllToOrgUnitDropdown.tsx +11 -9
  100. package/src/features/org-units/components/AuthSetupDrawer/AuthSetupDrawer.tsx +28 -16
  101. package/src/features/org-units/components/CreateOrgUnitDrawer/CreateOrgUnitDrawer.tsx +18 -12
  102. package/src/features/org-units/components/DeleteOrgUnitDrawer/DeleteOrgUnitDrawer.tsx +28 -29
  103. package/src/features/org-units/components/OrgUnitBreadcrumb/OrgUnitBreadcrumbLink.tsx +4 -4
  104. package/src/features/org-units/components/OrgUnitDetailsDropdownMenu/OrgUnitDetailsDropdownMenu.tsx +4 -2
  105. package/src/features/org-units/components/OrgUnitDetailsNavbar/OrgUnitDetailsNavbar.tsx +23 -5
  106. package/src/features/org-units/components/OrgUnitDetailsNavbar/org-unit-details-navbar.scss +18 -2
  107. package/src/features/org-units/components/OrgUnitsDropdownMenu/OrgUnitsDropdownMenu.tsx +6 -4
  108. package/src/features/org-units/components/OrgUnitsHierarchyTree/OrgUnitsHierarchyTree.tsx +9 -6
  109. package/src/features/org-units/components/OrganizationalUnitsCard/OrganizationalUnitsCard.tsx +15 -7
  110. package/src/features/org-units/components/UpdateOrgUnitDrawer/UpdateOrgUnitDrawer.tsx +15 -9
  111. package/src/features/org-units/layouts/OrgUnitDetailsLayout/OrgUnitDetailsLayout.tsx +27 -26
  112. package/src/features/org-units/layouts/OrgUnitsLayout/OrgUnitsLayout.tsx +8 -3
  113. package/src/features/payment-methods/components/AddPaymentMethodsDrawer/AddPaymentMethodsDrawer.tsx +29 -18
  114. package/src/features/payment-methods/components/PaymentMethodSettingsDrawer/PaymentMethodSettingsDrawer.tsx +13 -9
  115. package/src/features/payment-methods/components/RemoveMethodButton/RemoveMethodButton.tsx +5 -2
  116. package/src/features/payment-methods/components/RemovePaymentMethodsDrawer/RemovePaymentMethodsDrawer.tsx +10 -7
  117. package/src/features/payment-methods/hooks/useRemovePaymentMethodSubmit.ts +6 -4
  118. package/src/features/payment-methods/layouts/PaymentMethodsLayout/PaymentMethodsLayout.tsx +21 -15
  119. package/src/features/product-assortment/components/ProductAssortmentTable/ProductAssortmentTable.tsx +11 -7
  120. package/src/features/product-assortment/layouts/ProductAssortmentLayout/ProductAssortmentLayout.tsx +9 -6
  121. package/src/features/profile/components/ProfileCard/ProfileCard.tsx +8 -5
  122. package/src/features/profile/components/ProfileSummary/ProfileSummary.tsx +13 -6
  123. package/src/features/profile/layouts/ProfileLayout/ProfileLayout.tsx +16 -6
  124. package/src/features/roles/layout/RoleDetailsLayout/RoleDetailsLayout.tsx +4 -2
  125. package/src/features/roles/layout/RolesLayout/RolesLayout.tsx +5 -3
  126. package/src/features/shared/components/BasicCard/BasicCard.tsx +6 -4
  127. package/src/features/shared/components/BasicCard/BasicCardLine.tsx +5 -4
  128. package/src/features/shared/components/CustomerSwitch/CustomerSwitchDrawer.tsx +10 -2
  129. package/src/features/shared/components/CustomerSwitch/CustomerSwitchSearch.tsx +4 -1
  130. package/src/features/shared/components/DropdownFilter/DropdownFilter.tsx +11 -7
  131. package/src/features/shared/components/Error/Error.tsx +13 -6
  132. package/src/features/shared/components/HeaderInside/HeaderInside.tsx +5 -2
  133. package/src/features/shared/components/InternalSearch/InternalSearch.tsx +4 -1
  134. package/src/features/shared/components/InternalTopbar/InternalTopbar.tsx +7 -5
  135. package/src/features/shared/components/MainLinksDropdownMenu/MainLinksDropdownMenu.tsx +23 -8
  136. package/src/features/shared/components/OrgUnitInputSearch/OrgUnitInputSearch.tsx +7 -2
  137. package/src/features/shared/components/Pagination/Pagination.tsx +6 -2
  138. package/src/features/shared/components/Paginator/Counter.tsx +11 -5
  139. package/src/features/shared/components/Paginator/Interval.tsx +4 -3
  140. package/src/features/shared/components/Paginator/NextPageButton.tsx +6 -2
  141. package/src/features/shared/components/SettingsDrawer/SettingsDrawer.tsx +6 -4
  142. package/src/features/shared/components/SettingsDrawer/SettingsDrawerListType.tsx +11 -10
  143. package/src/features/shared/components/SettingsDrawer/listTypeOptions.ts +10 -7
  144. package/src/features/shared/components/SortFilter/SortFilter.tsx +15 -8
  145. package/src/features/shared/components/Table/TableRow/TableRow.tsx +5 -1
  146. package/src/features/shared/components/VerticalNav/VerticalNavLink.tsx +7 -3
  147. package/src/features/shared/layouts/BaseTabsLayout/Navbar.tsx +28 -4
  148. package/src/features/shared/layouts/BaseTabsLayout/about-drawer/AboutDrawer.tsx +15 -5
  149. package/src/features/shared/layouts/BaseTabsLayout/base-tabs-layout.scss +24 -9
  150. package/src/features/shared/layouts/BaseTabsLayout/sidebar-drawer/SidebarDrawer.tsx +5 -2
  151. package/src/features/shared/layouts/ContractTabsLayout/ContractTabsLayout.tsx +10 -5
  152. package/src/features/shared/layouts/ErrorTabsLayout/ErrorTabsLayout.tsx +7 -4
  153. package/src/features/shared/layouts/FinanceTabsLayout/FinanceTabsLayout.tsx +9 -4
  154. package/src/features/shared/layouts/LoadingTabsLayout/LoadingTabsLayout.tsx +7 -4
  155. package/src/features/shared/layouts/OrgUnitTabsLayout/OrgUnitTabLayout.tsx +3 -0
  156. package/src/features/shared/layouts/SumaPageLayout/FullSidebarNav.tsx +13 -7
  157. package/src/features/shared/layouts/SumaPageLayout/SumaSidebar.tsx +9 -5
  158. package/src/features/shared/localization/LocalizationContext.tsx +35 -0
  159. package/src/features/shared/localization/__tests__/createLocalize.test.ts +166 -0
  160. package/src/features/shared/localization/__tests__/get-localization-labels.service.test.ts +202 -0
  161. package/src/features/shared/localization/clients/LocalizationClient.ts +19 -0
  162. package/src/features/shared/localization/constants.ts +31 -0
  163. package/src/features/shared/localization/createLocalize.ts +78 -0
  164. package/src/features/shared/localization/services/get-localization-labels.service.ts +76 -0
  165. package/src/features/shared/localization/types.ts +66 -0
  166. package/src/features/shared/localization/withLocalization.tsx +22 -0
  167. package/src/features/shared/types/AuthRouteProps.ts +5 -0
  168. package/src/features/shared/types/LoaderData.ts +1 -0
  169. package/src/features/shared/utils/addresLabelToPropMapping.ts +10 -10
  170. package/src/features/shared/utils/constants.ts +1 -4
  171. package/src/features/shared/utils/getContractSettingsLinks.ts +17 -12
  172. package/src/features/shared/utils/getFinanceSettingsLinks.ts +14 -9
  173. package/src/features/shared/utils/getKeyByValue.ts +2 -2
  174. package/src/features/shared/utils/getOrganizationSettingsLinks.ts +13 -3
  175. package/src/features/shared/utils/getSumaListingSidebarLinks.ts +15 -10
  176. package/src/features/shared/utils/index.ts +2 -0
  177. package/src/features/shared/utils/routeLayoutMapping.ts +30 -30
  178. package/src/features/shared/utils/search.tsx +10 -0
  179. package/src/features/shared/utils/withAuth.tsx +6 -0
  180. package/src/features/shared/utils/withAuthLoader.ts +11 -0
  181. package/src/features/shared/utils/withLoaderErrorBoundary.ts +9 -0
  182. package/src/features/shared/utils/withProviders.tsx +13 -2
  183. package/src/features/users/components/CreateUserDrawer/CreateUserDrawer.tsx +39 -27
  184. package/src/features/users/components/CreateUserDrawerWithUsername/CreateUserDrawerWithUsername.tsx +41 -39
  185. package/src/features/users/components/DeleteUserDrawer/DeleteUserDrawer.tsx +27 -23
  186. package/src/features/users/components/EmailTransactionalSection/EmailTransactionalSection.tsx +6 -8
  187. package/src/features/users/components/LoginField/LoginField.tsx +4 -4
  188. package/src/features/users/components/ReassignOrgUnitDrawer/ReassignOrgUnitDrawer.tsx +22 -19
  189. package/src/features/users/components/ResetPasswordDrawer/ResetPasswordDrawer.tsx +16 -21
  190. package/src/features/users/components/UpdateUserDrawer/UpdateUserDrawer.tsx +26 -15
  191. package/src/features/users/components/UpdateUserDrawerWithUsername/UpdateUserDrawerWithUsername.tsx +22 -8
  192. package/src/features/users/components/UserDropdownMenu/UserDropdownMenu.tsx +7 -5
  193. package/src/features/users/components/UserFormFields/UserFormFields.tsx +9 -8
  194. package/src/features/users/components/UsersCard/UsersCard.tsx +4 -2
  195. package/src/features/users/layouts/UserDetailsLayout/UserDetailsLayout.tsx +26 -10
  196. package/src/features/users/layouts/UsersLayout/UsersLayout.tsx +12 -8
  197. package/src/pages/accounting-field.tsx +28 -15
  198. package/src/pages/address-details.tsx +37 -26
  199. package/src/pages/addresses.tsx +27 -12
  200. package/src/pages/budgets-details.tsx +25 -15
  201. package/src/pages/budgets.tsx +31 -17
  202. package/src/pages/buyer-organization-manager.tsx +23 -12
  203. package/src/pages/buying-policies.tsx +38 -20
  204. package/src/pages/buying-policy-details.tsx +20 -19
  205. package/src/pages/contracts.tsx +15 -1
  206. package/src/pages/credit-cards.tsx +30 -17
  207. package/src/pages/order-entry.tsx +26 -15
  208. package/src/pages/org-unit-details.tsx +20 -6
  209. package/src/pages/org-units.tsx +20 -6
  210. package/src/pages/payment-groups.tsx +15 -12
  211. package/src/pages/productAssortment.tsx +10 -1
  212. package/src/pages/profile.tsx +14 -1
  213. package/src/pages/role-details.tsx +19 -6
  214. package/src/pages/roles.tsx +27 -14
  215. package/src/pages/user-details.tsx +29 -17
  216. package/src/pages/users.tsx +11 -0
  217. package/vitest.config.ts +13 -0
  218. package/src/features/addresses/constants/messages.ts +0 -8
  219. package/src/features/credit-cards/constants/messages.ts +0 -6
@@ -13,9 +13,9 @@ import {
13
13
  Icon,
14
14
  } from "../../../shared/components";
15
15
  import { useAnalytics, useBuyerPortal } from "../../../shared/hooks";
16
+ import { useLocalization } from "../../../shared/localization/LocalizationContext";
16
17
  import { ANALYTICS_EVENTS } from "../../../shared/services/logger/analytics/constants";
17
18
  import { buyerPortalRoutes } from "../../../shared/utils/buyerPortalRoutes";
18
- import { CHANGES_TIMEOUT_MESSAGE } from "../../../shared/utils/constants";
19
19
  import { resolveContractId } from "../../../shared/utils/resolveContractId";
20
20
  import { useCreateNewOrgUnit } from "../../hooks";
21
21
 
@@ -44,6 +44,7 @@ export const CreateOrgUnitDrawer = ({
44
44
  currentContract,
45
45
  currentOrgUnit,
46
46
  });
47
+ const { t } = useLocalization();
47
48
  const { trackEntityCreated, trackEntityCreateError } = useAnalytics({
48
49
  entityType: "org_unit",
49
50
  defaultTimerName: "org_unit_creation",
@@ -67,7 +68,9 @@ export const CreateOrgUnitDrawer = ({
67
68
  });
68
69
 
69
70
  pushToast({
70
- message: `Organizational unit added successfully\n${CHANGES_TIMEOUT_MESSAGE}`,
71
+ message: `${t("orgUnits.toasts.createSuccess")}\n${t(
72
+ "shared.messages.changesTimeout"
73
+ )}`,
71
74
  status: "INFO",
72
75
  icon: (
73
76
  <button
@@ -82,7 +85,7 @@ export const CreateOrgUnitDrawer = ({
82
85
  )
83
86
  }
84
87
  >
85
- View
88
+ {t("shared.buttons.view")}
86
89
  </button>
87
90
  ),
88
91
  });
@@ -106,14 +109,14 @@ export const CreateOrgUnitDrawer = ({
106
109
 
107
110
  if (error.code === "InvalidOrganizationUnitName") {
108
111
  pushToast({
109
- message: "An organizational unit with the same name already exists",
112
+ message: t("orgUnits.errors.duplicateName"),
110
113
  status: "ERROR",
111
114
  });
112
115
  return;
113
116
  }
114
117
 
115
118
  pushToast({
116
- message: "An error occurred while creating the organizational unit",
119
+ message: t("orgUnits.errors.createFailed"),
117
120
  status: "ERROR",
118
121
  });
119
122
  },
@@ -137,10 +140,13 @@ export const CreateOrgUnitDrawer = ({
137
140
 
138
141
  return (
139
142
  <BasicDrawer data-fs-bp-create-org-unit-drawer close={close} {...props}>
140
- <BasicDrawer.Heading title="Create organization unit" onClose={close} />
143
+ <BasicDrawer.Heading
144
+ title={t("orgUnits.drawers.create.title")}
145
+ onClose={close}
146
+ />
141
147
  <BasicDrawer.Body>
142
148
  <AutocompleteDropdown
143
- label="Parent"
149
+ label={t("orgUnits.forms.parentLabel")}
144
150
  value={parentOrgUnit?.name ?? ""}
145
151
  options={options}
146
152
  onConfirmKeyPress={(option) => setParentOrgUnit(option)}
@@ -164,11 +170,11 @@ export const CreateOrgUnitDrawer = ({
164
170
 
165
171
  <ErrorMessage
166
172
  show={isTouched && !parentOrgUnit.name?.trim()}
167
- message="Parent is required"
173
+ message={t("orgUnits.validation.parentRequired")}
168
174
  />
169
175
 
170
176
  <InputText
171
- label="Name"
177
+ label={t("shared.labels.name")}
172
178
  value={name}
173
179
  wrapperProps={{ style: { marginTop: 16 } }}
174
180
  hasError={isTouched && !name?.trim()}
@@ -177,12 +183,12 @@ export const CreateOrgUnitDrawer = ({
177
183
 
178
184
  <ErrorMessage
179
185
  show={isTouched && !name?.trim()}
180
- message="Name is required"
186
+ message={t("orgUnits.validation.nameRequired")}
181
187
  />
182
188
  </BasicDrawer.Body>
183
189
  <BasicDrawer.Footer>
184
190
  <BasicDrawer.Button variant="ghost" onClick={close}>
185
- Cancel
191
+ {t("shared.buttons.cancel")}
186
192
  </BasicDrawer.Button>
187
193
  <BasicDrawer.Button
188
194
  variant="confirm"
@@ -190,7 +196,7 @@ export const CreateOrgUnitDrawer = ({
190
196
  onClick={handleConfirmClick}
191
197
  isLoading={isCreateNewOrgUnitLoading}
192
198
  >
193
- Add
199
+ {t("orgUnits.buttons.add")}
194
200
  </BasicDrawer.Button>
195
201
  </BasicDrawer.Footer>
196
202
  </BasicDrawer>
@@ -12,9 +12,9 @@ import {
12
12
  type BasicDrawerProps,
13
13
  } from "../../../shared/components";
14
14
  import { useBuyerPortal, useAnalytics } from "../../../shared/hooks";
15
+ import { useLocalization } from "../../../shared/localization/LocalizationContext";
15
16
  import { ANALYTICS_EVENTS } from "../../../shared/services/logger/analytics/constants";
16
17
  import { buyerPortalRoutes } from "../../../shared/utils/buyerPortalRoutes";
17
- import { CHANGES_TIMEOUT_MESSAGE } from "../../../shared/utils/constants";
18
18
  import { resolveContractId } from "../../../shared/utils/resolveContractId";
19
19
  import { useGetUserByOrgUnitId } from "../../../users/hooks/useGetUserByOrgUnitId";
20
20
  import { useChildrenOrgUnits } from "../../hooks";
@@ -44,6 +44,7 @@ export const DeleteOrgUnitDrawer = ({
44
44
  const { childrenOrgUnits } = useChildrenOrgUnits(id, name);
45
45
  const { users } = useGetUserByOrgUnitId(id);
46
46
  const { pushToast } = useUI();
47
+ const { t } = useLocalization();
47
48
  const { trackEvent } = useAnalytics({
48
49
  entityType: "org_unit",
49
50
  entityId: id,
@@ -66,7 +67,9 @@ export const DeleteOrgUnitDrawer = ({
66
67
  });
67
68
 
68
69
  pushToast({
69
- message: `Organizational unit deleted successfully\n${CHANGES_TIMEOUT_MESSAGE}`,
70
+ message: `${t("orgUnits.toasts.deleteSuccess")}\n${t(
71
+ "shared.messages.changesTimeout"
72
+ )}`,
70
73
  status: "INFO",
71
74
  });
72
75
 
@@ -112,7 +115,7 @@ export const DeleteOrgUnitDrawer = ({
112
115
  });
113
116
 
114
117
  pushToast({
115
- message: "An error occurred while deleting the organizational unit",
118
+ message: t("orgUnits.errors.deleteFailed"),
116
119
  status: "ERROR",
117
120
  });
118
121
  },
@@ -137,26 +140,28 @@ export const DeleteOrgUnitDrawer = ({
137
140
  size={hasChildren ? "large" : "partial"}
138
141
  {...props}
139
142
  >
140
- <BasicDrawer.Heading title="Delete organizational unit" onClose={close} />
143
+ <BasicDrawer.Heading
144
+ title={t("orgUnits.drawers.delete.title")}
145
+ onClose={close}
146
+ />
141
147
  <BasicDrawer.Body>
142
148
  {!hasChildren && (
143
149
  <>
144
150
  <p data-fs-bp-delete-org-unit-drawer-message>
145
- Are you sure you want to permanently delete the
146
- <span
147
- data-fs-bp-delete-org-unit-drawer-message-name
148
- >{` ${name}`}</span>
149
- ?
151
+ {t("orgUnits.delete.confirmMessage", [
152
+ <span key="name" data-fs-bp-delete-org-unit-drawer-message-name>
153
+ {name}
154
+ </span>,
155
+ ])}
150
156
  </p>
151
157
  <p data-fs-bp-delete-org-unit-drawer-message>
152
- This action will delete all data from this unit.
158
+ {t("orgUnits.delete.warningDeleteAllData")}
153
159
  <br />
154
- To confirm this action, please enter the organizational unit name
155
- bellow:
160
+ {t("orgUnits.delete.confirmNamePrompt")}
156
161
  </p>
157
162
 
158
163
  <InputText
159
- label="Name"
164
+ label={t("shared.labels.name")}
160
165
  value={confirmName}
161
166
  onChange={(e) => setConfirmName(e.target.value)}
162
167
  hasError={isTouched && confirmName !== name}
@@ -164,7 +169,7 @@ export const DeleteOrgUnitDrawer = ({
164
169
 
165
170
  <ErrorMessage
166
171
  show={isTouched && confirmName !== name}
167
- message="The entered name does not match the organizational unit's name. Please, check and try again."
172
+ message={t("orgUnits.validation.nameMismatch")}
168
173
  />
169
174
  </>
170
175
  )}
@@ -172,22 +177,16 @@ export const DeleteOrgUnitDrawer = ({
172
177
  {hasChildren && (
173
178
  <>
174
179
  <p data-fs-bp-delete-org-unit-drawer-message>
175
- Before deleting
176
- <span data-fs-bp-delete-org-unit-drawer-message-name>
177
- {` ${name}`}
178
- </span>
179
- , you must first remove all child organizational units{" "}
180
- {users?.length ? "and users" : ""}.
181
- <br />
182
- Please delete them individually, starting from the lowest level.
183
- <br />
184
- <br />
185
- Once all child units {users?.length ? "and users" : ""} bellow are
186
- removed, you’ll be able to delete {name}.
180
+ {t("orgUnits.delete.hasChildrenMessage", [
181
+ <span key="name" data-fs-bp-delete-org-unit-drawer-message-name>
182
+ {name}
183
+ </span>,
184
+ users?.length ? t("orgUnits.delete.andUsers") : "",
185
+ ])}
187
186
  </p>
188
187
 
189
188
  <span data-fs-bp-delete-org-unit-drawer-subtitle>
190
- Organizational Units
189
+ {t("orgUnits.titles.organizationalUnits")}
191
190
  </span>
192
191
  {childrenOrgUnits && (
193
192
  <OrgUnitsHierarchyTree
@@ -200,14 +199,14 @@ export const DeleteOrgUnitDrawer = ({
200
199
  </BasicDrawer.Body>
201
200
  <BasicDrawer.Footer>
202
201
  <BasicDrawer.Button variant="ghost" onClick={close}>
203
- Cancel
202
+ {t("shared.buttons.cancel")}
204
203
  </BasicDrawer.Button>
205
204
  <BasicDrawer.Button
206
205
  onClick={handleDelete}
207
206
  variant={hasChildren ? "confirm" : "danger"}
208
207
  isLoading={isDeleteOrgUnitLoading}
209
208
  >
210
- {hasChildren ? "Ok" : "Delete"}
209
+ {hasChildren ? t("shared.buttons.ok") : t("shared.buttons.delete")}
211
210
  </BasicDrawer.Button>
212
211
  </BasicDrawer.Footer>
213
212
  </BasicDrawer>
@@ -1,8 +1,7 @@
1
1
  import { useEffect, useRef, useState } from "react";
2
2
 
3
- import Link from "next/link";
4
-
5
- import { Tooltip } from "@faststore/ui";
3
+ import { useLink_unstable as useLink } from "@faststore/core/experimental";
4
+ import { Link, Tooltip } from "@faststore/ui";
6
5
 
7
6
  import { OrgUnitBreadcrumbItemProps } from "../../types";
8
7
 
@@ -12,6 +11,7 @@ export const OrgUnitBreadcrumbLink = ({
12
11
  isLast,
13
12
  enabled,
14
13
  }: OrgUnitBreadcrumbItemProps) => {
14
+ const { resolveLink } = useLink();
15
15
  const [truncate, setTruncate] = useState(false);
16
16
  const linkRef = useRef<HTMLParagraphElement | HTMLAnchorElement>(null);
17
17
 
@@ -38,7 +38,7 @@ export const OrgUnitBreadcrumbLink = ({
38
38
  <Link
39
39
  ref={linkRef as React.RefObject<HTMLAnchorElement>}
40
40
  data-fs-bp-breadcrumb-text
41
- href={item}
41
+ href={resolveLink(item)}
42
42
  >
43
43
  {name}
44
44
  </Link>
@@ -2,6 +2,7 @@ import { DropdownItem } from "@faststore/ui";
2
2
 
3
3
  import { BasicDropdownMenu, Icon } from "../../../shared/components";
4
4
  import { useDrawerProps } from "../../../shared/hooks";
5
+ import { useLocalization } from "../../../shared/localization/LocalizationContext";
5
6
  import { AuthSetupDrawer } from "../AuthSetupDrawer";
6
7
  import { UpdateOrgUnitDrawer } from "../UpdateOrgUnitDrawer/UpdateOrgUnitDrawer";
7
8
 
@@ -32,6 +33,7 @@ export const OrgUnitDetailsDropdownMenu = ({
32
33
  ...authSetupDrawerProps
33
34
  } = useDrawerProps();
34
35
 
36
+ const { t } = useLocalization();
35
37
  const sizeProps = { width: 20, height: 20 };
36
38
 
37
39
  return (
@@ -39,12 +41,12 @@ export const OrgUnitDetailsDropdownMenu = ({
39
41
  <BasicDropdownMenu>
40
42
  <DropdownItem onClick={openUpdateDrawerProps}>
41
43
  <Icon name="FormatSize" {...sizeProps} />
42
- Rename
44
+ {t("orgUnitDetails.dropdown.rename")}
43
45
  </DropdownItem>
44
46
  <BasicDropdownMenu.Separator />
45
47
  <DropdownItem onClick={openAuthSetupDrawerProps}>
46
48
  <Icon name="Settings" {...sizeProps} />
47
- Authentication
49
+ {t("orgUnitDetails.dropdown.authentication")}
48
50
  </DropdownItem>
49
51
  </BasicDropdownMenu>
50
52
  {isUpdateDrawerOpen && (
@@ -1,14 +1,24 @@
1
1
  import storeConfig from "discovery.config";
2
2
 
3
- import Link from "next/link";
3
+ import dynamic from "next/dynamic";
4
4
 
5
- import { Dropdown, DropdownMenu, IconButton } from "@faststore/ui";
5
+ import { useLink_unstable as useLink } from "@faststore/core/experimental";
6
+ import { Dropdown, DropdownMenu, IconButton, Link } from "@faststore/ui";
7
+
8
+ const LocalizationButton = dynamic(
9
+ () =>
10
+ import("@faststore/core/experimental").then(
11
+ (m) => m.LocalizationButton_unstable
12
+ ),
13
+ { ssr: false }
14
+ );
6
15
 
7
16
  import { ProfileSummary } from "../../../profile/components";
8
17
  import { BasicDropdownMenu, Icon } from "../../../shared/components";
9
18
  import { useDrawerProps } from "../../../shared/hooks";
10
19
  import { AboutDrawer } from "../../../shared/layouts/BaseTabsLayout/about-drawer/AboutDrawer";
11
20
  import { SumaSidebarDrawer } from "../../../shared/layouts/SumaPageLayout/SumaSidebarDrawer";
21
+ import { useLocalization } from "../../../shared/localization/LocalizationContext";
12
22
  import { doLogout } from "../../../shared/utils";
13
23
 
14
24
  export type OrgUnitDetailsNavbarProps = {
@@ -34,6 +44,8 @@ export const OrgUnitDetailsNavbar = ({
34
44
  sidebarVariant,
35
45
  showBackLink = false,
36
46
  }: OrgUnitDetailsNavbarProps) => {
47
+ const { t } = useLocalization();
48
+ const { resolveLink } = useLink();
37
49
  const {
38
50
  open: openAboutMenu,
39
51
  isOpen: isOpenAboutMenu,
@@ -57,7 +69,7 @@ export const OrgUnitDetailsNavbar = ({
57
69
  onClick={openSidebarMenu}
58
70
  />
59
71
  )}
60
- <Link href="/" data-fs-bp-org-unit-details-navbar-link>
72
+ <Link href={resolveLink("/")} data-fs-bp-org-unit-details-navbar-link>
61
73
  {storeConfig.seo.title}
62
74
  </Link>
63
75
  </div>
@@ -73,12 +85,18 @@ export const OrgUnitDetailsNavbar = ({
73
85
  </Link>
74
86
  */}
75
87
 
88
+ <LocalizationButton
89
+ saveLabel={t("shared.buttons.save")}
90
+ currencyLabel={t("layouts.labels.currency")}
91
+ languageLabel={t("layouts.labels.language")}
92
+ icon="Globe"
93
+ />
76
94
  <Link
77
95
  target="_blank"
78
- href="/"
96
+ href={resolveLink("/")}
79
97
  data-fs-bp-org-unit-details-navbar-start-shopping-link
80
98
  >
81
- Start shopping
99
+ {t("layouts.navigation.startShopping")}
82
100
  </Link>
83
101
 
84
102
  <IconButton
@@ -1,6 +1,7 @@
1
1
  @use "~@faststore/ui/src/styles/base/utilities" as u;
2
+
2
3
  [data-fs-bp-org-unit-details-navbar] {
3
-
4
+
4
5
  display: flex;
5
6
  justify-content: space-between;
6
7
  align-items: center;
@@ -20,6 +21,16 @@
20
21
  gap: var(--fs-bp-gap-2);
21
22
  }
22
23
 
24
+ [data-fs-localization-button] {
25
+ [data-fs-button-wrapper] {
26
+ span {
27
+ display: inline-flex;
28
+ align-items: center;
29
+ gap: var(--fs-bp-gap-3);
30
+ }
31
+ }
32
+ }
33
+
23
34
  [data-fs-bp-org-unit-details-navbar-link] {
24
35
  color: var(--fs-bp-color-brand);
25
36
  @include text-style('display-6');
@@ -64,7 +75,7 @@
64
75
 
65
76
  [data-fs-bp-org-unit-details-navbar-start-shopping-link] {
66
77
  display: none;
67
-
78
+
68
79
  padding: 0 var(--fs-bp-padding-5);
69
80
  @include text-style('action');
70
81
  color: var(--fs-bp-color-neutral-8);
@@ -101,3 +112,8 @@
101
112
  min-width: unset;
102
113
  background-color: var(--fs-bp-color-white);
103
114
  }
115
+
116
+ // !important para vencer a especificidade do CSS module do selector (portal).
117
+ [data-fs-localization-selector] {
118
+ --fs-localization-selector-max-width: 20rem !important;
119
+ }
@@ -8,6 +8,7 @@ import {
8
8
  import { useGetRolesOptions } from "../../../roles/hooks";
9
9
  import { BasicDropdownMenu, Icon } from "../../../shared/components";
10
10
  import { useDrawerProps } from "../../../shared/hooks";
11
+ import { useLocalization } from "../../../shared/localization/LocalizationContext";
11
12
  import { CreateUserDrawerSelector } from "../../../users/components";
12
13
 
13
14
  export type OrgUnitsDropdownMenuProps = {
@@ -26,6 +27,7 @@ export const OrgUnitsDropdownMenu = ({
26
27
  pathIds,
27
28
  }: OrgUnitsDropdownMenuProps) => {
28
29
  const { rolesOptions } = useGetRolesOptions(id);
30
+ const { t } = useLocalization();
29
31
  const {
30
32
  open: openCreateDrawerProps,
31
33
  isOpen: isCreateDrawerOpen,
@@ -57,18 +59,18 @@ export const OrgUnitsDropdownMenu = ({
57
59
  <BasicDropdownMenu>
58
60
  <DropdownItem onClick={openUpdateDrawerProps}>
59
61
  <Icon name="FormatSize" {...sizeProps} />
60
- Rename
62
+ {t("shared.orgUnitDropdown.rename")}
61
63
  </DropdownItem>
62
64
  <BasicDropdownMenu.Separator />
63
65
  {isComplete && (
64
66
  <>
65
67
  <DropdownItem onClick={openCreateUserDrawerProps}>
66
68
  <Icon name="Profile" {...sizeProps} />
67
- Add User
69
+ {t("shared.orgUnitDropdown.addUser")}
68
70
  </DropdownItem>
69
71
  <DropdownItem onClick={openCreateDrawerProps}>
70
72
  <Icon name="Folder" {...sizeProps} />
71
- Add Organizational Unit
73
+ {t("shared.orgUnitDropdown.addOrganizationalUnit")}
72
74
  </DropdownItem>
73
75
  <BasicDropdownMenu.Separator />
74
76
  </>
@@ -78,7 +80,7 @@ export const OrgUnitsDropdownMenu = ({
78
80
  data-fs-bp-dropdown-menu-item-mode="danger"
79
81
  >
80
82
  <Icon name="Delete" {...sizeProps} />
81
- Delete
83
+ {t("shared.buttons.delete")}
82
84
  </DropdownItem>
83
85
  </BasicDropdownMenu>
84
86
  {isCreateDrawerOpen && (
@@ -1,7 +1,7 @@
1
- import Link from "next/link";
2
1
  import { useRouter } from "next/router";
3
2
 
4
- import { Dropdown } from "@faststore/ui";
3
+ import { useLink_unstable as useLink } from "@faststore/core/experimental";
4
+ import { Dropdown, Link } from "@faststore/ui";
5
5
 
6
6
  import { OrgUnitsDropdownMenu } from "..";
7
7
  import {
@@ -27,6 +27,7 @@ export const OrgUnitsHierarchyTree = ({
27
27
  readonly,
28
28
  enableChildren = true,
29
29
  }: OrgUnitsHierarchyTreeProps) => {
30
+ const { resolveLink } = useLink();
30
31
  const { structure, setNode } = useOrgUnitStructure(orgUnitHierarchyData);
31
32
  const router = useRouter();
32
33
  const { currentContract, currentOrgUnit } = useBuyerPortal();
@@ -58,10 +59,12 @@ export const OrgUnitsHierarchyTree = ({
58
59
  {!readonly && (
59
60
  <Link
60
61
  data-fs-org-unit-item-click-area
61
- href={buyerPortalRoutes.orgUnitDetails({
62
- orgUnitId: id,
63
- contractId,
64
- })}
62
+ href={resolveLink(
63
+ buyerPortalRoutes.orgUnitDetails({
64
+ orgUnitId: id,
65
+ contractId,
66
+ })
67
+ )}
65
68
  />
66
69
  )}
67
70
  {enableChildren && (
@@ -3,6 +3,7 @@ import { Toggle, Button, Dropdown, DropdownButton } from "@faststore/ui";
3
3
  import { CreateOrgUnitDrawer, OrgUnitsDropdownMenu } from "..";
4
4
  import { BasicCard, Icon } from "../../../shared/components";
5
5
  import { useDrawerProps } from "../../../shared/hooks";
6
+ import { useLocalization } from "../../../shared/localization/LocalizationContext";
6
7
 
7
8
  import type { OrgUnitData } from "../../types";
8
9
 
@@ -15,17 +16,24 @@ type OrganizationalUnitsCardProps = {
15
16
  };
16
17
 
17
18
  export default function OrganizationalUnitsCard({
18
- orgUnitData = { id: null, name: "Root" },
19
+ orgUnitData,
19
20
  organizationalUnits = [],
20
21
  }: OrganizationalUnitsCardProps) {
22
+ const { t } = useLocalization();
23
+ const resolvedOrgUnitData = orgUnitData ?? {
24
+ id: null,
25
+ name: t("orgUnits.labels.root"),
26
+ };
21
27
  const { open: openCreateDrawer, ...createDrawerProps } = useDrawerProps();
22
28
 
23
29
  return (
24
30
  <>
25
31
  <BasicCard
26
- footerLink={`/org-units${orgUnitData?.id ? `/${orgUnitData.id}` : ""}`}
27
- footerMessage="Manage organizational units"
28
- title="Organizational Units"
32
+ footerLink={`/org-units${
33
+ resolvedOrgUnitData?.id ? `/${resolvedOrgUnitData.id}` : ""
34
+ }`}
35
+ footerMessage={t("orgUnits.links.manageOrganizationalUnits")}
36
+ title={t("orgUnits.titles.organizationalUnits")}
29
37
  subTitle={organizationalUnits.length ?? 0}
30
38
  onPlusIconClick={openCreateDrawer}
31
39
  >
@@ -73,15 +81,15 @@ export default function OrganizationalUnitsCard({
73
81
  ) : (
74
82
  <div data-fs-card-body-empty-state>
75
83
  <Icon name="FilledFolder" width={40} height={40} />
76
- <span> No child organizational units yet </span>
84
+ <span>{t("orgUnits.empty.noChildOrganizationalUnitsYet")}</span>
77
85
  <Button variant="primary" onClick={openCreateDrawer}>
78
- + Add New
86
+ {t("orgUnits.buttons.addNew")}
79
87
  </Button>
80
88
  </div>
81
89
  )}
82
90
  </BasicCard>
83
91
  <CreateOrgUnitDrawer
84
- initialParentOrgUnit={orgUnitData}
92
+ initialParentOrgUnit={resolvedOrgUnitData}
85
93
  readonly
86
94
  {...createDrawerProps}
87
95
  />
@@ -11,9 +11,9 @@ import {
11
11
  InputText,
12
12
  } from "../../../shared/components";
13
13
  import { useAnalytics, useBuyerPortal } from "../../../shared/hooks";
14
+ import { useLocalization } from "../../../shared/localization/LocalizationContext";
14
15
  import { ANALYTICS_EVENTS } from "../../../shared/services/logger/analytics/constants";
15
16
  import { buyerPortalRoutes } from "../../../shared/utils/buyerPortalRoutes";
16
- import { CHANGES_TIMEOUT_MESSAGE } from "../../../shared/utils/constants";
17
17
  import { resolveContractId } from "../../../shared/utils/resolveContractId";
18
18
  import { useUpdateOrgUnit } from "../../hooks";
19
19
 
@@ -40,6 +40,7 @@ export const UpdateOrgUnitDrawer = ({
40
40
  currentContract,
41
41
  currentOrgUnit,
42
42
  });
43
+ const { t } = useLocalization();
43
44
  const { trackEntityEdited, trackEntityEditError } = useAnalytics({
44
45
  entityType: "org_unit",
45
46
  entityId: id,
@@ -58,7 +59,9 @@ export const UpdateOrgUnitDrawer = ({
58
59
  });
59
60
 
60
61
  pushToast({
61
- message: `Organizational unit successfully edited\n${CHANGES_TIMEOUT_MESSAGE}`,
62
+ message: `${t("orgUnits.toasts.updateSuccess")}\n${t(
63
+ "shared.messages.changesTimeout"
64
+ )}`,
62
65
  status: "INFO",
63
66
  icon: (
64
67
  <button
@@ -73,7 +76,7 @@ export const UpdateOrgUnitDrawer = ({
73
76
  )
74
77
  }
75
78
  >
76
- View
79
+ {t("shared.buttons.view")}
77
80
  </button>
78
81
  ),
79
82
  });
@@ -97,7 +100,7 @@ export const UpdateOrgUnitDrawer = ({
97
100
  );
98
101
 
99
102
  pushToast({
100
- message: "An error occurred while editing the organizational unit",
103
+ message: t("orgUnits.errors.updateFailed"),
101
104
  status: "ERROR",
102
105
  });
103
106
  },
@@ -120,10 +123,13 @@ export const UpdateOrgUnitDrawer = ({
120
123
 
121
124
  return (
122
125
  <BasicDrawer data-fs-bp-update-org-unit-drawer close={close} {...props}>
123
- <BasicDrawer.Heading title="Edit organization unit" onClose={close} />
126
+ <BasicDrawer.Heading
127
+ title={t("orgUnits.drawers.update.title")}
128
+ onClose={close}
129
+ />
124
130
  <BasicDrawer.Body>
125
131
  <InputText
126
- label="Name"
132
+ label={t("shared.labels.name")}
127
133
  value={name}
128
134
  wrapperProps={{ style: { marginTop: 16 } }}
129
135
  hasError={isTouched && !name?.trim()}
@@ -132,12 +138,12 @@ export const UpdateOrgUnitDrawer = ({
132
138
 
133
139
  <ErrorMessage
134
140
  show={isTouched && !name?.trim()}
135
- message="Name is required"
141
+ message={t("orgUnits.validation.nameRequired")}
136
142
  />
137
143
  </BasicDrawer.Body>
138
144
  <BasicDrawer.Footer>
139
145
  <BasicDrawer.Button variant="ghost" onClick={close}>
140
- Cancel
146
+ {t("shared.buttons.cancel")}
141
147
  </BasicDrawer.Button>
142
148
  <BasicDrawer.Button
143
149
  variant="confirm"
@@ -145,7 +151,7 @@ export const UpdateOrgUnitDrawer = ({
145
151
  onClick={handleConfirmClick}
146
152
  isLoading={isUpdateOrgUnitLoading}
147
153
  >
148
- Save
154
+ {t("shared.buttons.save")}
149
155
  </BasicDrawer.Button>
150
156
  </BasicDrawer.Footer>
151
157
  </BasicDrawer>