@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
@@ -10,7 +10,7 @@ import {
10
10
  createListTypeOptions,
11
11
  } from "../../../shared/components";
12
12
  import { useSetScopeConfig, SCOPE_KEYS } from "../../../shared/hooks";
13
- import { CHANGES_TIMEOUT_MESSAGE } from "../../../shared/utils/constants";
13
+ import { useLocalization } from "../../../shared/localization/LocalizationContext";
14
14
 
15
15
  export type CreditCardSettingsDrawerProps = Omit<
16
16
  BasicDrawerProps,
@@ -19,28 +19,30 @@ export type CreditCardSettingsDrawerProps = Omit<
19
19
  readonly?: boolean;
20
20
  };
21
21
 
22
- const CREDIT_CARD_LIST_TYPE_OPTIONS = createListTypeOptions("credit cards");
23
-
24
22
  export const CreditCardSettingsDrawer = ({
25
23
  close,
26
24
  ...otherProps
27
25
  }: CreditCardSettingsDrawerProps) => {
28
26
  const { pushToast } = useUI();
29
27
  const router = useRouter();
28
+ const { t } = useLocalization();
29
+ const creditCardListTypeOptions = createListTypeOptions("credit cards", t);
30
30
 
31
31
  const [listType, setListType] = useState<"sync" | "custom">("custom");
32
32
 
33
33
  const { setScopeConfig, isSetScopeConfigLoading } = useSetScopeConfig({
34
34
  onSuccess: () => {
35
35
  pushToast({
36
- message: `Scope configuration updated successfully\n${CHANGES_TIMEOUT_MESSAGE}`,
36
+ message: `${t("creditCards.toasts.scopeConfigUpdated")}\n${t(
37
+ "shared.messages.changesTimeout"
38
+ )}`,
37
39
  status: "INFO",
38
40
  });
39
41
  close();
40
42
  },
41
43
  onError: () => {
42
44
  pushToast({
43
- message: "Failed to update scope configuration",
45
+ message: t("creditCards.toasts.scopeConfigUpdateFailed"),
44
46
  status: "ERROR",
45
47
  });
46
48
  },
@@ -57,7 +59,7 @@ export const CreditCardSettingsDrawer = ({
57
59
 
58
60
  return (
59
61
  <SettingsDrawer
60
- title="Credit cards settings"
62
+ title={t("creditCards.settings.title")}
61
63
  {...otherProps}
62
64
  close={close}
63
65
  onPrimaryAction={handleConfirmClick}
@@ -67,11 +69,11 @@ export const CreditCardSettingsDrawer = ({
67
69
  data-fs-bp-edit-credit-card-settings-drawer
68
70
  >
69
71
  <SettingsDrawer.ListType
70
- title="List type"
72
+ title={t("creditCards.settings.listType")}
71
73
  name="credit-card-list-type"
72
74
  value={listType}
73
75
  onChange={setListType}
74
- options={CREDIT_CARD_LIST_TYPE_OPTIONS}
76
+ options={creditCardListTypeOptions}
75
77
  />
76
78
  </SettingsDrawer>
77
79
  );
@@ -10,7 +10,7 @@ import {
10
10
  InputText,
11
11
  } from "../../../shared/components";
12
12
  import { useBuyerPortal } from "../../../shared/hooks";
13
- import { CHANGES_TIMEOUT_MESSAGE } from "../../../shared/utils/constants";
13
+ import { useLocalization } from "../../../shared/localization/LocalizationContext";
14
14
  import { useDeleteCreditCard } from "../../hooks";
15
15
 
16
16
  export type DeleteCreditCardDrawerProps = Omit<BasicDrawerProps, "children"> & {
@@ -28,6 +28,7 @@ export const DeleteCreditCardDrawer = ({
28
28
  const { pushToast } = useUI();
29
29
  const router = useRouter();
30
30
  const { currentOrgUnit } = useBuyerPortal();
31
+ const { t } = useLocalization();
31
32
  const [unitNameConfirmation, setUnitNameConfirmation] = useState("");
32
33
 
33
34
  const handleConfirmClick = async () => {
@@ -37,7 +38,9 @@ export const DeleteCreditCardDrawer = ({
37
38
  });
38
39
 
39
40
  pushToast({
40
- message: `Credit card deleted successfully\n${CHANGES_TIMEOUT_MESSAGE}`,
41
+ message: `${t("creditCards.toasts.creditCardDeleted")}\n${t(
42
+ "shared.messages.changesTimeout"
43
+ )}`,
41
44
  status: "INFO",
42
45
  });
43
46
  router.reload();
@@ -50,24 +53,26 @@ export const DeleteCreditCardDrawer = ({
50
53
 
51
54
  return (
52
55
  <BasicDrawer data-fs-bp-remove-credit-card-drawer close={close} {...props}>
53
- <BasicDrawer.Heading title="Delete credit card" onClose={close} />
56
+ <BasicDrawer.Heading
57
+ title={t("creditCards.delete.title")}
58
+ onClose={close}
59
+ />
54
60
  <BasicDrawer.Body>
55
61
  <div>
56
62
  <p>
57
- Permanently delete <span data-fs-bp-drawer-label>{cardName} </span>?
63
+ {t("creditCards.delete.permanentlyDeleteConfirm", [
64
+ <span key="card-name" data-fs-bp-drawer-label>
65
+ {cardName}
66
+ </span>,
67
+ ])}
58
68
  </p>
59
69
  <br />
60
- <p>
61
- This credit card may be used by multiple units. Deleting it will
62
- permanently remove it and all iits data from all associated units,
63
- though usage history will be kept for audit. This action can't be
64
- undone
65
- </p>
70
+ <p>{t("creditCards.delete.warning")}</p>
66
71
  <br />
67
- <p>Confirm by typing the organizational unit name below:</p>
72
+ <p>{t("creditCards.delete.confirmUnitName")}</p>
68
73
  <br />
69
74
  <InputText
70
- label="Organizational Unit"
75
+ label={t("creditCards.labels.organizationalUnit")}
71
76
  value={unitNameConfirmation}
72
77
  onChange={(event) =>
73
78
  setUnitNameConfirmation(event.currentTarget.value)
@@ -78,7 +83,7 @@ export const DeleteCreditCardDrawer = ({
78
83
 
79
84
  <BasicDrawer.Footer>
80
85
  <BasicDrawer.Button variant="ghost" onClick={close}>
81
- Cancel
86
+ {t("shared.buttons.cancel")}
82
87
  </BasicDrawer.Button>
83
88
  <BasicDrawer.Button
84
89
  variant="confirm"
@@ -86,7 +91,7 @@ export const DeleteCreditCardDrawer = ({
86
91
  disabled={!isDeleteButtonEnabled}
87
92
  isLoading={isDeleteCreditCardLoading}
88
93
  >
89
- Delete
94
+ {t("shared.buttons.delete")}
90
95
  </BasicDrawer.Button>
91
96
  </BasicDrawer.Footer>
92
97
  </BasicDrawer>
@@ -9,7 +9,7 @@ import {
9
9
  BasicDrawer,
10
10
  InputText,
11
11
  } from "../../../shared/components";
12
- import { CHANGES_TIMEOUT_MESSAGE } from "../../../shared/utils/constants";
12
+ import { useLocalization } from "../../../shared/localization/LocalizationContext";
13
13
 
14
14
  import type { CreditCardData } from "../../types";
15
15
 
@@ -24,20 +24,22 @@ export const EditCreditCardDrawer = ({
24
24
  ...props
25
25
  }: EditCreditCardDrawerProps) => {
26
26
  const { pushToast } = useUI();
27
-
28
27
  const router = useRouter();
28
+ const { t } = useLocalization();
29
29
 
30
30
  const [cardToModify, setCardToModify] = useState<CreditCardData>(creditCard);
31
31
  const [onConfirmationStep, setOnConfirmationStep] = useState(false);
32
32
 
33
33
  const drawerTitle = onConfirmationStep
34
- ? "Confirm credit card update"
35
- : "Rename credit card";
34
+ ? t("creditCards.update.confirmTitle")
35
+ : t("creditCards.edit.title");
36
36
 
37
37
  const handleConfirmClick = () => {
38
38
  if (onConfirmationStep) {
39
39
  pushToast({
40
- message: `Credit card updated successfully\n${CHANGES_TIMEOUT_MESSAGE}`,
40
+ message: `${t("creditCards.toasts.creditCardUpdated")}\n${t(
41
+ "shared.messages.changesTimeout"
42
+ )}`,
41
43
  status: "INFO",
42
44
  });
43
45
  router.reload();
@@ -55,17 +57,14 @@ export const EditCreditCardDrawer = ({
55
57
  <BasicDrawer.Body>
56
58
  {onConfirmationStep ? (
57
59
  <div>
58
- <p>
59
- Thid credit card may be used by multiple units. Updates will
60
- affect all of them
61
- </p>
60
+ <p>{t("creditCards.edit.multiUnitWarning")}</p>
62
61
  <br />
63
- <p>Proceed with the update?</p>
62
+ <p>{t("creditCards.edit.proceedConfirm")}</p>
64
63
  <br />
65
64
  </div>
66
65
  ) : (
67
66
  <InputText
68
- label="Card nickname"
67
+ label={t("creditCards.labels.cardNickname")}
69
68
  value={cardToModify.cardLabel}
70
69
  wrapperProps={{ style: { marginTop: 16 } }}
71
70
  onChange={(event) =>
@@ -80,7 +79,7 @@ export const EditCreditCardDrawer = ({
80
79
 
81
80
  <BasicDrawer.Footer>
82
81
  <BasicDrawer.Button variant="ghost" onClick={close}>
83
- Cancel
82
+ {t("shared.buttons.cancel")}
84
83
  </BasicDrawer.Button>
85
84
  <BasicDrawer.Button
86
85
  variant="confirm"
@@ -88,7 +87,9 @@ export const EditCreditCardDrawer = ({
88
87
  onClick={handleConfirmClick}
89
88
  isLoading={false}
90
89
  >
91
- {onConfirmationStep ? "Confirm" : "Save"}
90
+ {onConfirmationStep
91
+ ? t("shared.buttons.confirm")
92
+ : t("shared.buttons.save")}
92
93
  </BasicDrawer.Button>
93
94
  </BasicDrawer.Footer>
94
95
  </BasicDrawer>
@@ -4,7 +4,7 @@ import { useUI } from "@faststore/ui";
4
4
 
5
5
  import { type BasicDrawerProps, BasicDrawer } from "../../../shared/components";
6
6
  import { useRemoveFromScope, useBuyerPortal } from "../../../shared/hooks";
7
- import { CHANGES_TIMEOUT_MESSAGE } from "../../../shared/utils/constants";
7
+ import { useLocalization } from "../../../shared/localization/LocalizationContext";
8
8
 
9
9
  export type RemoveCreditCardDrawerProps = Omit<BasicDrawerProps, "children"> & {
10
10
  readonly?: boolean;
@@ -21,10 +21,13 @@ export const RemoveCreditCardDrawer = ({
21
21
  const { pushToast } = useUI();
22
22
  const router = useRouter();
23
23
  const { currentOrgUnit } = useBuyerPortal();
24
+ const { t } = useLocalization();
24
25
 
25
26
  const handeRemoveFromScopeSuccess = () => {
26
27
  pushToast({
27
- message: `Credit card removed successfully\n${CHANGES_TIMEOUT_MESSAGE}`,
28
+ message: `${t("creditCards.toasts.creditCardRemoved")}\n${t(
29
+ "shared.messages.changesTimeout"
30
+ )}`,
28
31
  status: "INFO",
29
32
  });
30
33
  router.reload();
@@ -35,8 +38,7 @@ export const RemoveCreditCardDrawer = ({
35
38
  onSuccess: handeRemoveFromScopeSuccess,
36
39
  onError: () => {
37
40
  pushToast({
38
- message:
39
- "An error occurred while removing the credit card from the unit",
41
+ message: t("creditCards.errors.removeFromUnit"),
40
42
  status: "ERROR",
41
43
  });
42
44
  },
@@ -53,31 +55,32 @@ export const RemoveCreditCardDrawer = ({
53
55
  return (
54
56
  <BasicDrawer data-fs-bp-remove-credit-card-drawer close={close} {...props}>
55
57
  <BasicDrawer.Heading
56
- title="Remove credit card from unit"
58
+ title={t("creditCards.delete.removeFromUnitTitle")}
57
59
  onClose={close}
58
60
  />
59
61
  <BasicDrawer.Body>
60
62
  <div>
61
63
  <p>
62
- {" "}
63
- Remove <span data-fs-bp-drawer-label>{cardName}</span> credit card
64
- from <span data-fs-bp-drawer-label>{currentOrgUnit?.name} </span>{" "}
65
- organizational unit?
64
+ {t("creditCards.delete.removeFromUnitConfirm", [
65
+ <span key="card-name" data-fs-bp-drawer-label>
66
+ {cardName}
67
+ </span>,
68
+ <span key="unit-name" data-fs-bp-drawer-label>
69
+ {currentOrgUnit?.name}
70
+ </span>,
71
+ ])}
66
72
  </p>
67
73
  <br />
68
- <p>
69
- This action will prevent users in this unit from accessing this
70
- credit card during checkout
71
- </p>
74
+ <p>{t("creditCards.delete.removeFromUnitDescription")}</p>
72
75
  </div>
73
76
  </BasicDrawer.Body>
74
77
 
75
78
  <BasicDrawer.Footer>
76
79
  <BasicDrawer.Button variant="ghost" onClick={close}>
77
- Cancel
80
+ {t("shared.buttons.cancel")}
78
81
  </BasicDrawer.Button>
79
82
  <BasicDrawer.Button variant="confirm" onClick={handleConfirmClick}>
80
- Confirm
83
+ {t("shared.buttons.confirm")}
81
84
  </BasicDrawer.Button>
82
85
  </BasicDrawer.Footer>
83
86
  </BasicDrawer>
@@ -15,6 +15,7 @@ import {
15
15
  usePageItems,
16
16
  } from "../../../shared/hooks";
17
17
  import { ContractTabsLayout, GlobalLayout } from "../../../shared/layouts";
18
+ import { useLocalization } from "../../../shared/localization/LocalizationContext";
18
19
  import {
19
20
  CreateCreditCardDrawer,
20
21
  CreditCardDropdownMenu,
@@ -30,6 +31,8 @@ export type CreditCardsLayoutProps = {
30
31
  };
31
32
 
32
33
  export const CreditCardLayout = ({ data }: CreditCardsLayoutProps) => {
34
+ const { t } = useLocalization();
35
+
33
36
  const {
34
37
  open: openCreateDrawer,
35
38
  isOpen: isCreateCreditCardDrawerOpen,
@@ -93,7 +96,7 @@ export const CreditCardLayout = ({ data }: CreditCardsLayoutProps) => {
93
96
 
94
97
  const columns = getTableColumns({
95
98
  actionsLength: 3,
96
- nameColumnLabel: "Card Nickname",
99
+ nameColumnLabel: t("creditCards.table.cardNickname"),
97
100
  });
98
101
 
99
102
  const renderRowActions = (creditCard: CreditCardData) => {
@@ -134,10 +137,10 @@ export const CreditCardLayout = ({ data }: CreditCardsLayoutProps) => {
134
137
  orgUnitId={orgUnit?.id ?? ""}
135
138
  contractName={contract?.name ?? ""}
136
139
  contractId={contract?.id ?? ""}
137
- pageName="Contract"
140
+ pageName={t("shared.labels.contract")}
138
141
  >
139
142
  <section data-fs-credit-card-section>
140
- <HeaderInside title="Credit cards">
143
+ <HeaderInside title={t("creditCards.titles.creditCards")}>
141
144
  <HeaderInside.Button
142
145
  iconName="EditSettings"
143
146
  style={{ backgroundColor: "transparent", color: "#1f1f1f" }}
@@ -146,7 +149,10 @@ export const CreditCardLayout = ({ data }: CreditCardsLayoutProps) => {
146
149
  <HeaderInside.Button onClick={openCreateDrawer} />
147
150
  </HeaderInside>
148
151
  {data.length === 0 ? (
149
- <EmptyState iconName="CreditCard" title="No credit cards yet" />
152
+ <EmptyState
153
+ iconName="CreditCard"
154
+ title={t("creditCards.empty.noCreditCards")}
155
+ />
150
156
  ) : (
151
157
  <Table layoutFixed>
152
158
  <Table.Head columns={columns} />
@@ -4,6 +4,7 @@ import storeConfig from "discovery.config";
4
4
 
5
5
  import { useRouter } from "next/router";
6
6
 
7
+ import { useLocalization } from "../../shared/localization/LocalizationContext";
7
8
  import { isDevelopment } from "../../shared/utils/environment";
8
9
 
9
10
  const B2B_AGENT_URL = isDevelopment()
@@ -46,6 +47,7 @@ export const OrderEntryLayout = ({
46
47
  customerId,
47
48
  userId,
48
49
  }: OrderEntryLayoutProps) => {
50
+ const { t } = useLocalization();
49
51
  const iframeRef = useRef<HTMLIFrameElement>(null);
50
52
  const router = useRouter();
51
53
 
@@ -179,7 +181,7 @@ export const OrderEntryLayout = ({
179
181
  style={iframeStyle}
180
182
  data-fs-bp-b2b-agent-iframe
181
183
  src={B2B_AGENT_URL}
182
- title="Order Entry Agent"
184
+ title={t("orderEntry.titles.orderEntryAgent")}
183
185
  allow="clipboard-read; clipboard-write"
184
186
  sandbox="allow-scripts allow-same-origin allow-forms allow-popups allow-modals"
185
187
  />
@@ -13,6 +13,7 @@ import { CreateCreditCardDrawer } from "../../../credit-cards/components";
13
13
  import { useGetRolesOptions } from "../../../roles/hooks";
14
14
  import { BasicDropdownMenu, Icon } from "../../../shared/components";
15
15
  import { useDrawerProps } from "../../../shared/hooks";
16
+ import { useLocalization } from "../../../shared/localization/LocalizationContext";
16
17
  import { CreateUserDrawerSelector } from "../../../users/components";
17
18
 
18
19
  export type AddAllToOrgUnitDropdownProps = {
@@ -34,6 +35,7 @@ export const AddAllToOrgUnitDropdown = ({
34
35
  align = "right",
35
36
  onCreateAccountingField,
36
37
  }: AddAllToOrgUnitDropdownProps) => {
38
+ const { t } = useLocalization();
37
39
  const sizeProps = { width: 20, height: 20 };
38
40
  const { rolesOptions } = useGetRolesOptions(unitId);
39
41
 
@@ -111,7 +113,7 @@ export const AddAllToOrgUnitDropdown = ({
111
113
 
112
114
  <DropdownItem onClick={openUpdateDrawer}>
113
115
  <Icon name="FormatSize" {...sizeProps} />
114
- Rename
116
+ {t("shared.orgUnitDropdown.rename")}
115
117
  </DropdownItem>
116
118
  <BasicDropdownMenu.Separator />
117
119
 
@@ -119,15 +121,15 @@ export const AddAllToOrgUnitDropdown = ({
119
121
  <>
120
122
  <DropdownItem onClick={openAddressDrawer}>
121
123
  <Icon name="LocalPostOffice" {...sizeProps} />
122
- Add address
124
+ {t("shared.orgUnitDropdown.addAddress")}
123
125
  </DropdownItem>
124
126
  <DropdownItem onClick={openCreditCardDrawer}>
125
127
  <Icon name="CreditCard" {...sizeProps} />
126
- Add credit card
128
+ {t("shared.orgUnitDropdown.addCreditCard")}
127
129
  </DropdownItem>
128
130
  <DropdownItem onClick={openAccountingFieldDrawer}>
129
131
  <Icon name="TableEdit" {...sizeProps} />
130
- Add accounting fields
132
+ {t("shared.orgUnitDropdown.addAccountingFields")}
131
133
  </DropdownItem>
132
134
  </>
133
135
  )}
@@ -135,21 +137,21 @@ export const AddAllToOrgUnitDropdown = ({
135
137
 
136
138
  <DropdownItem onClick={openUserDrawer}>
137
139
  <Icon name="Profile" {...sizeProps} />
138
- Add user
140
+ {t("shared.orgUnitDropdown.addUser")}
139
141
  </DropdownItem>
140
142
  <DropdownItem onClick={openOrganizationDrawer}>
141
143
  <Icon name="Folder" {...sizeProps} />
142
- Add organization unit
144
+ {t("shared.orgUnitDropdown.addOrganizationUnit")}
143
145
  </DropdownItem>
144
146
  <BasicDropdownMenu.Separator />
145
147
 
146
148
  <DropdownItem onClick={openBudgetDrawer}>
147
149
  <Icon name="Paid" {...sizeProps} />
148
- Add budget
150
+ {t("shared.orgUnitDropdown.addBudget")}
149
151
  </DropdownItem>
150
152
  <DropdownItem onClick={openBuyingPolicyDrawer}>
151
153
  <Icon name="Rebase" {...sizeProps} />
152
- Add buying policy
154
+ {t("shared.orgUnitDropdown.addBuyingPolicy")}
153
155
  </DropdownItem>
154
156
 
155
157
  <BasicDropdownMenu.Separator />
@@ -159,7 +161,7 @@ export const AddAllToOrgUnitDropdown = ({
159
161
  data-fs-bp-dropdown-menu-item-mode="danger"
160
162
  >
161
163
  <Icon name="Delete" {...sizeProps} />
162
- Delete
164
+ {t("shared.buttons.delete")}
163
165
  </DropdownItem>
164
166
  </BasicDropdownMenu>
165
167
 
@@ -11,7 +11,7 @@ import {
11
11
  Icon,
12
12
  } from "../../../shared/components";
13
13
  import { useAnalytics, useBuyerPortal } from "../../../shared/hooks";
14
- import { CHANGES_TIMEOUT_MESSAGE } from "../../../shared/utils/constants";
14
+ import { useLocalization } from "../../../shared/localization/LocalizationContext";
15
15
  import { useUpdateOrgUnitSettings } from "../../hooks";
16
16
  import { AuthenticationMethod, type OrgUnitSettings } from "../../types";
17
17
 
@@ -38,26 +38,28 @@ function getAuthMethodOptions(
38
38
 
39
39
  const options: AuthMethodOption[] = [];
40
40
  if (password) {
41
- options.push({ method: AuthenticationMethod.PASSWORD, label: "Password" });
41
+ options.push({
42
+ method: AuthenticationMethod.PASSWORD,
43
+ label: "orgUnitDetails.auth.password",
44
+ });
42
45
  }
43
46
  if (authSettings?.email_access_code) {
44
47
  options.push({
45
48
  method: AuthenticationMethod.EMAIL_ACCESS_CODE,
46
- label: "Email access code",
49
+ label: "orgUnitDetails.auth.emailAccessCode",
47
50
  });
48
51
  }
49
52
  if (authSettings?.sms_access_code) {
50
53
  options.push({
51
54
  method: AuthenticationMethod.SMS_ACCESS_CODE,
52
- label: "SMS access code",
55
+ label: "orgUnitDetails.auth.smsAccessCode",
53
56
  });
54
57
  }
55
58
  if (sso) {
56
59
  options.push({
57
60
  method: AuthenticationMethod.SSO,
58
- label: "PingFederate (SSO)",
59
- tooltip:
60
- "Enables login through external identity providers, such as Google, Microsoft, or other supported IdPs",
61
+ label: "orgUnitDetails.auth.pingFederateSso",
62
+ tooltip: "orgUnitDetails.auth.ssoTooltip",
61
63
  });
62
64
  }
63
65
  return options;
@@ -96,6 +98,7 @@ export const AuthSetupDrawer = ({
96
98
  ...props
97
99
  }: AuthSetupDrawerProps) => {
98
100
  const { featureFlags } = useBuyerPortal();
101
+ const { t } = useLocalization();
99
102
  const authMethodOptions = useMemo(
100
103
  () => getAuthMethodOptions(featureFlags?.authSettings),
101
104
  [featureFlags?.authSettings]
@@ -128,7 +131,9 @@ export const AuthSetupDrawer = ({
128
131
  });
129
132
 
130
133
  pushToast({
131
- message: `Authentication settings saved successfully\n${CHANGES_TIMEOUT_MESSAGE}`,
134
+ message: `${t("orgUnitDetails.toasts.authSettingsSaved")}\n${t(
135
+ "shared.messages.changesTimeout"
136
+ )}`,
132
137
  status: "INFO",
133
138
  });
134
139
 
@@ -153,7 +158,7 @@ export const AuthSetupDrawer = ({
153
158
  );
154
159
 
155
160
  pushToast({
156
- message: "An error occurred while updating authentication settings",
161
+ message: t("orgUnitDetails.errors.authSettingsUpdateFailed"),
157
162
  status: "ERROR",
158
163
  });
159
164
  },
@@ -202,14 +207,19 @@ export const AuthSetupDrawer = ({
202
207
 
203
208
  return (
204
209
  <BasicDrawer data-fs-bp-auth-setup-drawer close={close} {...props}>
205
- <BasicDrawer.Heading title="Authentication" onClose={close} />
210
+ <BasicDrawer.Heading
211
+ title={t("orgUnitDetails.drawers.authentication.title")}
212
+ onClose={close}
213
+ />
206
214
  <BasicDrawer.Body>
207
215
  <section data-fs-bp-auth-setup-section>
208
216
  <div data-fs-bp-auth-setup-section-header>
209
- <h2 data-fs-bp-auth-setup-section-title>Authentication methods</h2>
217
+ <h2 data-fs-bp-auth-setup-section-title>
218
+ {t("orgUnitDetails.auth.authenticationMethods")}
219
+ </h2>
210
220
  </div>
211
221
  <p data-fs-bp-auth-setup-section-description>
212
- Control which authentication methods are available
222
+ {t("orgUnitDetails.auth.controlMethodsDescription")}
213
223
  </p>
214
224
 
215
225
  <div
@@ -226,10 +236,12 @@ export const AuthSetupDrawer = ({
226
236
  disabled={isOnlyActiveMethod(method)}
227
237
  onChange={() => handleAuthMethodChange(method)}
228
238
  />
229
- <span data-fs-bp-auth-setup-checkbox-label-text>{label}</span>
239
+ <span data-fs-bp-auth-setup-checkbox-label-text>
240
+ {t(label)}
241
+ </span>
230
242
  </label>
231
243
  {tooltip && (
232
- <Tooltip content={tooltip} placement="left-center">
244
+ <Tooltip content={t(tooltip)} placement="left-center">
233
245
  <Icon
234
246
  name="InfoFilled"
235
247
  width={20}
@@ -282,7 +294,7 @@ export const AuthSetupDrawer = ({
282
294
 
283
295
  <BasicDrawer.Footer>
284
296
  <BasicDrawer.Button variant="ghost" onClick={close}>
285
- Cancel
297
+ {t("shared.buttons.cancel")}
286
298
  </BasicDrawer.Button>
287
299
  <BasicDrawer.Button
288
300
  variant="confirm"
@@ -290,7 +302,7 @@ export const AuthSetupDrawer = ({
290
302
  onClick={handleConfirmClick}
291
303
  isLoading={isUpdateOrgUnitSettingsLoading}
292
304
  >
293
- Save
305
+ {t("shared.buttons.save")}
294
306
  </BasicDrawer.Button>
295
307
  </BasicDrawer.Footer>
296
308
  </BasicDrawer>