@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.
- package/CHANGELOG.md +18 -1
- package/cms/b2b/components/.gitkeep +0 -0
- package/cms/b2b/pages/cms_content_type__i18n.jsonc +36 -0
- package/cypress/integration/localization.test.ts +482 -0
- package/cypress/support/commands.ts +8 -0
- package/docs/i18n/i18n-messages-format.md +391 -0
- package/docs/i18n/locales.json +701 -0
- package/docs/i18n/migration-inventory.md +959 -0
- package/package.json +3 -3
- package/specs/custom-localization-system.md +711 -0
- package/specs/multi-locale-e2e-validation.md +277 -0
- package/src/__mocks__/discovery.config.ts +12 -0
- package/src/features/accounting-fields/components/AccountingConfirmDelete/AccountingConfirmDelete.tsx +14 -4
- package/src/features/accounting-fields/components/AccountingFieldConfirmEdit/AccountingFieldConfirmEdit.tsx +11 -6
- package/src/features/accounting-fields/components/AccountingFieldDropdown/AccountingFieldDropdown.tsx +5 -3
- package/src/features/accounting-fields/components/AccountingFieldForm/AccountingFieldForm.tsx +33 -23
- package/src/features/accounting-fields/components/AccountingValueConfirmEdit/AccountingValueConfirmEdit.tsx +10 -6
- package/src/features/accounting-fields/components/AccountingValueDropdown/AccountingValueDropdown.tsx +19 -9
- package/src/features/accounting-fields/components/AccountingValueForm/AccountingValueForm.tsx +21 -10
- package/src/features/accounting-fields/components/CreateAccountingFieldDrawer/CreateAccountingFieldDrawer.tsx +11 -8
- package/src/features/accounting-fields/components/CreateAccountingValueDrawer/CreateAccountingValueDrawer.tsx +18 -7
- package/src/features/accounting-fields/components/DeleteAccountingFieldDrawer/DeleteAccountingFieldDrawer.tsx +14 -12
- package/src/features/accounting-fields/components/DeleteAccountingValueDrawer/DeleteAccountingValueDrawer.tsx +20 -10
- package/src/features/accounting-fields/components/EditAccountingFieldDrawer/EditAccountingFieldDrawer.tsx +5 -3
- package/src/features/accounting-fields/components/EditAccountingValueDrawer/EditAccountingValueDrawer.tsx +13 -6
- package/src/features/accounting-fields/components/RemoveValueFromUnitDrawer/RemoveValueFromUnitDrawer.tsx +19 -8
- package/src/features/accounting-fields/layouts/AccountingFieldLayout/AccountingFieldLayout.tsx +11 -9
- package/src/features/addresses/components/AddRecipientsDrawer/AddRecipientsDrawer.tsx +13 -7
- package/src/features/addresses/components/AddressDropdownMenu/AddressDropdownMenu.tsx +22 -20
- package/src/features/addresses/components/AddressForm/AddressForm.tsx +33 -22
- package/src/features/addresses/components/AddressLine/AddressLine.tsx +29 -25
- package/src/features/addresses/components/AddressLocationsList/AddressLocationsList.tsx +15 -6
- package/src/features/addresses/components/AddressRecipientsList/AddressRecipientsList.tsx +9 -4
- package/src/features/addresses/components/AddressesCard/AddressesCard.tsx +8 -5
- package/src/features/addresses/components/CreateAddressDrawer/CreateAddressDrawer.tsx +27 -14
- package/src/features/addresses/components/CreateAddressSettingsDrawer/CreateAddressSettingsDrawer.tsx +26 -21
- package/src/features/addresses/components/DeleteAddressDrawer/DeleteAddressDrawer.tsx +20 -16
- package/src/features/addresses/components/DeleteAddressLocationDrawer/DeleteAddressLocationDrawer.tsx +26 -14
- package/src/features/addresses/components/DeleteRecipientAddressDrawer/DeleteRecipientAddressDrawer.tsx +20 -17
- package/src/features/addresses/components/EditAddressDrawer/EditAddressDrawer.tsx +12 -6
- package/src/features/addresses/components/EditAddressLocationDrawer/EditAddressLocationDrawer.tsx +24 -17
- package/src/features/addresses/components/EditRecipientAddressDrawer/EditRecipientAddressDrawer.tsx +17 -15
- package/src/features/addresses/components/LocationForm/LocationField/LocationField.tsx +8 -5
- package/src/features/addresses/components/LocationForm/LocationForm.tsx +9 -3
- package/src/features/addresses/components/LocationsDrawer/LocationsDrawer.tsx +15 -9
- package/src/features/addresses/components/RecipientsForm/RecipientItem/RecipientItem.tsx +55 -46
- package/src/features/addresses/components/RecipientsForm/RecipientsForm.tsx +4 -1
- package/src/features/addresses/components/RemoveAddressDrawer/RemoveAddressDrawer.tsx +21 -14
- package/src/features/addresses/layouts/AddressDetailsLayout/AddressDetailsLayout.tsx +16 -9
- package/src/features/addresses/layouts/AddressesLayout/AddressesLayout.tsx +11 -8
- package/src/features/b2b-agent/layouts/B2BAgentLayout/B2BAgentLayout.tsx +3 -1
- package/src/features/budgets/components/BudgetAddForm/BudgetAddForm.tsx +14 -12
- package/src/features/budgets/components/BudgetAddSuccess/BudgetAddSuccess.tsx +16 -14
- package/src/features/budgets/components/BudgetAllocationsSelection/BudgetAllocationsSelection.tsx +8 -5
- package/src/features/budgets/components/BudgetAllocationsTable/BudgetAllocationsTable.tsx +9 -6
- package/src/features/budgets/components/BudgetDeleteDrawer/BudgetDeleteDrawer.tsx +23 -17
- package/src/features/budgets/components/BudgetEditNotificationDrawer/BudgetEditNotificationDrawer.tsx +13 -6
- package/src/features/budgets/components/BudgetNotificationForm/BudgetNotificationForm.tsx +31 -24
- package/src/features/budgets/components/BudgetNotificationsInfo/BudgetNotificationsInfo.tsx +15 -9
- package/src/features/budgets/components/BudgetRemainingBalance/BudgetRemainingBalance.tsx +6 -2
- package/src/features/budgets/components/BudgetSettingsInfo/BudgetSettingsInfo.tsx +27 -10
- package/src/features/budgets/components/BudgetUsersTable/BudgetUsersTable.tsx +14 -7
- package/src/features/budgets/components/BudgetsTable/BudgetsTable.tsx +11 -8
- package/src/features/budgets/components/CreateBudgetAllocationDrawer/CreateBudgetAllocationDrawer.tsx +8 -5
- package/src/features/budgets/components/CreateBudgetDrawer/CreateBudgetDrawer.tsx +31 -18
- package/src/features/budgets/components/DeleteBudgetAllocationDrawer/DeleteBudgetAllocationDrawer.tsx +17 -12
- package/src/features/budgets/components/EditBudgetDrawer/EditBudgetDrawer.tsx +14 -8
- package/src/features/budgets/components/EmptyState.tsx/EmptyState.tsx +4 -1
- package/src/features/budgets/layouts/BudgetsDetailsLayout/BudgetsDetailsLayout.tsx +7 -5
- package/src/features/budgets/layouts/BudgetsLayout/BudgetsLayout.tsx +5 -3
- package/src/features/budgets/messages/budgetNotifications.ts +5 -5
- package/src/features/budgets/utils/handleBudgetError.tsx +5 -8
- package/src/features/budgets/utils/handleBudgetError.types.ts +3 -0
- package/src/features/buying-policies/components/AccountingFieldCriteriaSelector/AccountingFieldCriteriaSelector.tsx +5 -3
- package/src/features/buying-policies/components/AccountingFieldCriteriaSelector/AccountingValueCriteriaSelector.tsx +20 -9
- package/src/features/buying-policies/components/AddBuyingPolicyDrawer/AddBuyingPolicyDrawer.tsx +8 -5
- package/src/features/buying-policies/components/BasicBuyingPolicyDrawer/BasicBuyingPolicyDrawer.tsx +49 -33
- package/src/features/buying-policies/components/BudgetCriteriaSelector/BudgetCriteriaSelector.tsx +8 -2
- package/src/features/buying-policies/components/BuyingPolicyDropdownMenu/BuyingPolicyDropdownMenu.tsx +5 -3
- package/src/features/buying-policies/components/DeleteBuyingPolicyDrawer/DeleteBuyingPolicyDrawer.tsx +28 -24
- package/src/features/buying-policies/components/UpdateBuyingPolicyDrawer/UpdateBuyingPolicyDrawer.tsx +10 -7
- package/src/features/buying-policies/layouts/BuyingPoliciesLayout/BuyingPoliciesLayout.tsx +11 -4
- package/src/features/buying-policies/layouts/BuyingPolicyDetailsLayout/BuyingPolicyDetailsLayout.tsx +26 -9
- package/src/features/buying-policies/utils/accountingFieldCriteriaHelpers.ts +2 -2
- package/src/features/buying-policies/utils/buyingPoliciesWorkflowTypes.ts +3 -3
- package/src/features/buying-policies/utils/orderFieldsCriteriaOptions.ts +8 -8
- package/src/features/buying-policies/utils/spendingLimitsCriteriaOptions.ts +6 -6
- package/src/features/contracts/components/ContractsCard/ContractsCard.tsx +7 -5
- package/src/features/contracts/layouts/ContractsLayout/ContractsLayout.tsx +9 -4
- package/src/features/credit-cards/components/CreateCreditCardDrawer/CreateCreditCardDrawer.tsx +17 -11
- package/src/features/credit-cards/components/CreditCardDropdownMenu/CreditCardDropdownMenu.tsx +17 -11
- package/src/features/credit-cards/components/CreditCardForm/CreditCardForm.tsx +8 -5
- package/src/features/credit-cards/components/CreditCardSettingsDrawer/CreditCardSettingsDrawer.tsx +10 -8
- package/src/features/credit-cards/components/DeleteCreditCardDrawer/DeleteCreditCardDrawer.tsx +19 -14
- package/src/features/credit-cards/components/EditCreditCardDrawer/EditCreditCardDrawer.tsx +14 -13
- package/src/features/credit-cards/components/RemoveCreditCardDrawer/RemoveCreditCardDrawer.tsx +18 -15
- package/src/features/credit-cards/layouts/CreditCardsLayout/CreditCardLayout.tsx +10 -4
- package/src/features/order-entry/layouts/OrderEntryLayout.tsx +3 -1
- package/src/features/org-units/components/AddAllToOrgUnitDropdown/AddAllToOrgUnitDropdown.tsx +11 -9
- package/src/features/org-units/components/AuthSetupDrawer/AuthSetupDrawer.tsx +28 -16
- package/src/features/org-units/components/CreateOrgUnitDrawer/CreateOrgUnitDrawer.tsx +18 -12
- package/src/features/org-units/components/DeleteOrgUnitDrawer/DeleteOrgUnitDrawer.tsx +28 -29
- package/src/features/org-units/components/OrgUnitBreadcrumb/OrgUnitBreadcrumbLink.tsx +4 -4
- package/src/features/org-units/components/OrgUnitDetailsDropdownMenu/OrgUnitDetailsDropdownMenu.tsx +4 -2
- package/src/features/org-units/components/OrgUnitDetailsNavbar/OrgUnitDetailsNavbar.tsx +23 -5
- package/src/features/org-units/components/OrgUnitDetailsNavbar/org-unit-details-navbar.scss +18 -2
- package/src/features/org-units/components/OrgUnitsDropdownMenu/OrgUnitsDropdownMenu.tsx +6 -4
- package/src/features/org-units/components/OrgUnitsHierarchyTree/OrgUnitsHierarchyTree.tsx +9 -6
- package/src/features/org-units/components/OrganizationalUnitsCard/OrganizationalUnitsCard.tsx +15 -7
- package/src/features/org-units/components/UpdateOrgUnitDrawer/UpdateOrgUnitDrawer.tsx +15 -9
- package/src/features/org-units/layouts/OrgUnitDetailsLayout/OrgUnitDetailsLayout.tsx +27 -26
- package/src/features/org-units/layouts/OrgUnitsLayout/OrgUnitsLayout.tsx +8 -3
- package/src/features/payment-methods/components/AddPaymentMethodsDrawer/AddPaymentMethodsDrawer.tsx +29 -18
- package/src/features/payment-methods/components/PaymentMethodSettingsDrawer/PaymentMethodSettingsDrawer.tsx +13 -9
- package/src/features/payment-methods/components/RemoveMethodButton/RemoveMethodButton.tsx +5 -2
- package/src/features/payment-methods/components/RemovePaymentMethodsDrawer/RemovePaymentMethodsDrawer.tsx +10 -7
- package/src/features/payment-methods/hooks/useRemovePaymentMethodSubmit.ts +6 -4
- package/src/features/payment-methods/layouts/PaymentMethodsLayout/PaymentMethodsLayout.tsx +21 -15
- package/src/features/product-assortment/components/ProductAssortmentTable/ProductAssortmentTable.tsx +11 -7
- package/src/features/product-assortment/layouts/ProductAssortmentLayout/ProductAssortmentLayout.tsx +9 -6
- package/src/features/profile/components/ProfileCard/ProfileCard.tsx +8 -5
- package/src/features/profile/components/ProfileSummary/ProfileSummary.tsx +13 -6
- package/src/features/profile/layouts/ProfileLayout/ProfileLayout.tsx +16 -6
- package/src/features/roles/layout/RoleDetailsLayout/RoleDetailsLayout.tsx +4 -2
- package/src/features/roles/layout/RolesLayout/RolesLayout.tsx +5 -3
- package/src/features/shared/components/BasicCard/BasicCard.tsx +6 -4
- package/src/features/shared/components/BasicCard/BasicCardLine.tsx +5 -4
- package/src/features/shared/components/CustomerSwitch/CustomerSwitchDrawer.tsx +10 -2
- package/src/features/shared/components/CustomerSwitch/CustomerSwitchSearch.tsx +4 -1
- package/src/features/shared/components/DropdownFilter/DropdownFilter.tsx +11 -7
- package/src/features/shared/components/Error/Error.tsx +13 -6
- package/src/features/shared/components/HeaderInside/HeaderInside.tsx +5 -2
- package/src/features/shared/components/InternalSearch/InternalSearch.tsx +4 -1
- package/src/features/shared/components/InternalTopbar/InternalTopbar.tsx +7 -5
- package/src/features/shared/components/MainLinksDropdownMenu/MainLinksDropdownMenu.tsx +23 -8
- package/src/features/shared/components/OrgUnitInputSearch/OrgUnitInputSearch.tsx +7 -2
- package/src/features/shared/components/Pagination/Pagination.tsx +6 -2
- package/src/features/shared/components/Paginator/Counter.tsx +11 -5
- package/src/features/shared/components/Paginator/Interval.tsx +4 -3
- package/src/features/shared/components/Paginator/NextPageButton.tsx +6 -2
- package/src/features/shared/components/SettingsDrawer/SettingsDrawer.tsx +6 -4
- package/src/features/shared/components/SettingsDrawer/SettingsDrawerListType.tsx +11 -10
- package/src/features/shared/components/SettingsDrawer/listTypeOptions.ts +10 -7
- package/src/features/shared/components/SortFilter/SortFilter.tsx +15 -8
- package/src/features/shared/components/Table/TableRow/TableRow.tsx +5 -1
- package/src/features/shared/components/VerticalNav/VerticalNavLink.tsx +7 -3
- package/src/features/shared/layouts/BaseTabsLayout/Navbar.tsx +28 -4
- package/src/features/shared/layouts/BaseTabsLayout/about-drawer/AboutDrawer.tsx +15 -5
- package/src/features/shared/layouts/BaseTabsLayout/base-tabs-layout.scss +24 -9
- package/src/features/shared/layouts/BaseTabsLayout/sidebar-drawer/SidebarDrawer.tsx +5 -2
- package/src/features/shared/layouts/ContractTabsLayout/ContractTabsLayout.tsx +10 -5
- package/src/features/shared/layouts/ErrorTabsLayout/ErrorTabsLayout.tsx +7 -4
- package/src/features/shared/layouts/FinanceTabsLayout/FinanceTabsLayout.tsx +9 -4
- package/src/features/shared/layouts/LoadingTabsLayout/LoadingTabsLayout.tsx +7 -4
- package/src/features/shared/layouts/OrgUnitTabsLayout/OrgUnitTabLayout.tsx +3 -0
- package/src/features/shared/layouts/SumaPageLayout/FullSidebarNav.tsx +13 -7
- package/src/features/shared/layouts/SumaPageLayout/SumaSidebar.tsx +9 -5
- package/src/features/shared/localization/LocalizationContext.tsx +35 -0
- package/src/features/shared/localization/__tests__/createLocalize.test.ts +166 -0
- package/src/features/shared/localization/__tests__/get-localization-labels.service.test.ts +202 -0
- package/src/features/shared/localization/clients/LocalizationClient.ts +19 -0
- package/src/features/shared/localization/constants.ts +31 -0
- package/src/features/shared/localization/createLocalize.ts +78 -0
- package/src/features/shared/localization/services/get-localization-labels.service.ts +76 -0
- package/src/features/shared/localization/types.ts +66 -0
- package/src/features/shared/localization/withLocalization.tsx +22 -0
- package/src/features/shared/types/AuthRouteProps.ts +5 -0
- package/src/features/shared/types/LoaderData.ts +1 -0
- package/src/features/shared/utils/addresLabelToPropMapping.ts +10 -10
- package/src/features/shared/utils/constants.ts +1 -4
- package/src/features/shared/utils/getContractSettingsLinks.ts +17 -12
- package/src/features/shared/utils/getFinanceSettingsLinks.ts +14 -9
- package/src/features/shared/utils/getKeyByValue.ts +2 -2
- package/src/features/shared/utils/getOrganizationSettingsLinks.ts +13 -3
- package/src/features/shared/utils/getSumaListingSidebarLinks.ts +15 -10
- package/src/features/shared/utils/index.ts +2 -0
- package/src/features/shared/utils/routeLayoutMapping.ts +30 -30
- package/src/features/shared/utils/search.tsx +10 -0
- package/src/features/shared/utils/withAuth.tsx +6 -0
- package/src/features/shared/utils/withAuthLoader.ts +11 -0
- package/src/features/shared/utils/withLoaderErrorBoundary.ts +9 -0
- package/src/features/shared/utils/withProviders.tsx +13 -2
- package/src/features/users/components/CreateUserDrawer/CreateUserDrawer.tsx +39 -27
- package/src/features/users/components/CreateUserDrawerWithUsername/CreateUserDrawerWithUsername.tsx +41 -39
- package/src/features/users/components/DeleteUserDrawer/DeleteUserDrawer.tsx +27 -23
- package/src/features/users/components/EmailTransactionalSection/EmailTransactionalSection.tsx +6 -8
- package/src/features/users/components/LoginField/LoginField.tsx +4 -4
- package/src/features/users/components/ReassignOrgUnitDrawer/ReassignOrgUnitDrawer.tsx +22 -19
- package/src/features/users/components/ResetPasswordDrawer/ResetPasswordDrawer.tsx +16 -21
- package/src/features/users/components/UpdateUserDrawer/UpdateUserDrawer.tsx +26 -15
- package/src/features/users/components/UpdateUserDrawerWithUsername/UpdateUserDrawerWithUsername.tsx +22 -8
- package/src/features/users/components/UserDropdownMenu/UserDropdownMenu.tsx +7 -5
- package/src/features/users/components/UserFormFields/UserFormFields.tsx +9 -8
- package/src/features/users/components/UsersCard/UsersCard.tsx +4 -2
- package/src/features/users/layouts/UserDetailsLayout/UserDetailsLayout.tsx +26 -10
- package/src/features/users/layouts/UsersLayout/UsersLayout.tsx +12 -8
- package/src/pages/accounting-field.tsx +28 -15
- package/src/pages/address-details.tsx +37 -26
- package/src/pages/addresses.tsx +27 -12
- package/src/pages/budgets-details.tsx +25 -15
- package/src/pages/budgets.tsx +31 -17
- package/src/pages/buyer-organization-manager.tsx +23 -12
- package/src/pages/buying-policies.tsx +38 -20
- package/src/pages/buying-policy-details.tsx +20 -19
- package/src/pages/contracts.tsx +15 -1
- package/src/pages/credit-cards.tsx +30 -17
- package/src/pages/order-entry.tsx +26 -15
- package/src/pages/org-unit-details.tsx +20 -6
- package/src/pages/org-units.tsx +20 -6
- package/src/pages/payment-groups.tsx +15 -12
- package/src/pages/productAssortment.tsx +10 -1
- package/src/pages/profile.tsx +14 -1
- package/src/pages/role-details.tsx +19 -6
- package/src/pages/roles.tsx +27 -14
- package/src/pages/user-details.tsx +29 -17
- package/src/pages/users.tsx +11 -0
- package/vitest.config.ts +13 -0
- package/src/features/addresses/constants/messages.ts +0 -8
- package/src/features/credit-cards/constants/messages.ts +0 -6
package/src/features/credit-cards/components/CreditCardSettingsDrawer/CreditCardSettingsDrawer.tsx
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
createListTypeOptions,
|
|
11
11
|
} from "../../../shared/components";
|
|
12
12
|
import { useSetScopeConfig, SCOPE_KEYS } from "../../../shared/hooks";
|
|
13
|
-
import {
|
|
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:
|
|
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: "
|
|
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="
|
|
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="
|
|
72
|
+
title={t("creditCards.settings.listType")}
|
|
71
73
|
name="credit-card-list-type"
|
|
72
74
|
value={listType}
|
|
73
75
|
onChange={setListType}
|
|
74
|
-
options={
|
|
76
|
+
options={creditCardListTypeOptions}
|
|
75
77
|
/>
|
|
76
78
|
</SettingsDrawer>
|
|
77
79
|
);
|
package/src/features/credit-cards/components/DeleteCreditCardDrawer/DeleteCreditCardDrawer.tsx
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
InputText,
|
|
11
11
|
} from "../../../shared/components";
|
|
12
12
|
import { useBuyerPortal } from "../../../shared/hooks";
|
|
13
|
-
import {
|
|
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:
|
|
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
|
|
56
|
+
<BasicDrawer.Heading
|
|
57
|
+
title={t("creditCards.delete.title")}
|
|
58
|
+
onClose={close}
|
|
59
|
+
/>
|
|
54
60
|
<BasicDrawer.Body>
|
|
55
61
|
<div>
|
|
56
62
|
<p>
|
|
57
|
-
|
|
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>
|
|
72
|
+
<p>{t("creditCards.delete.confirmUnitName")}</p>
|
|
68
73
|
<br />
|
|
69
74
|
<InputText
|
|
70
|
-
label="
|
|
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
|
-
|
|
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
|
-
|
|
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 {
|
|
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
|
-
? "
|
|
35
|
-
: "
|
|
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:
|
|
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>
|
|
62
|
+
<p>{t("creditCards.edit.proceedConfirm")}</p>
|
|
64
63
|
<br />
|
|
65
64
|
</div>
|
|
66
65
|
) : (
|
|
67
66
|
<InputText
|
|
68
|
-
label="
|
|
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
|
-
|
|
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
|
|
90
|
+
{onConfirmationStep
|
|
91
|
+
? t("shared.buttons.confirm")
|
|
92
|
+
: t("shared.buttons.save")}
|
|
92
93
|
</BasicDrawer.Button>
|
|
93
94
|
</BasicDrawer.Footer>
|
|
94
95
|
</BasicDrawer>
|
package/src/features/credit-cards/components/RemoveCreditCardDrawer/RemoveCreditCardDrawer.tsx
CHANGED
|
@@ -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 {
|
|
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:
|
|
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="
|
|
58
|
+
title={t("creditCards.delete.removeFromUnitTitle")}
|
|
57
59
|
onClose={close}
|
|
58
60
|
/>
|
|
59
61
|
<BasicDrawer.Body>
|
|
60
62
|
<div>
|
|
61
63
|
<p>
|
|
62
|
-
{"
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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
|
-
|
|
80
|
+
{t("shared.buttons.cancel")}
|
|
78
81
|
</BasicDrawer.Button>
|
|
79
82
|
<BasicDrawer.Button variant="confirm" onClick={handleConfirmClick}>
|
|
80
|
-
|
|
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: "
|
|
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="
|
|
140
|
+
pageName={t("shared.labels.contract")}
|
|
138
141
|
>
|
|
139
142
|
<section data-fs-credit-card-section>
|
|
140
|
-
<HeaderInside title="
|
|
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
|
|
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="
|
|
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
|
/>
|
package/src/features/org-units/components/AddAllToOrgUnitDropdown/AddAllToOrgUnitDropdown.tsx
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
124
|
+
{t("shared.orgUnitDropdown.addAddress")}
|
|
123
125
|
</DropdownItem>
|
|
124
126
|
<DropdownItem onClick={openCreditCardDrawer}>
|
|
125
127
|
<Icon name="CreditCard" {...sizeProps} />
|
|
126
|
-
|
|
128
|
+
{t("shared.orgUnitDropdown.addCreditCard")}
|
|
127
129
|
</DropdownItem>
|
|
128
130
|
<DropdownItem onClick={openAccountingFieldDrawer}>
|
|
129
131
|
<Icon name="TableEdit" {...sizeProps} />
|
|
130
|
-
|
|
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
|
-
|
|
140
|
+
{t("shared.orgUnitDropdown.addUser")}
|
|
139
141
|
</DropdownItem>
|
|
140
142
|
<DropdownItem onClick={openOrganizationDrawer}>
|
|
141
143
|
<Icon name="Folder" {...sizeProps} />
|
|
142
|
-
|
|
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
|
-
|
|
150
|
+
{t("shared.orgUnitDropdown.addBudget")}
|
|
149
151
|
</DropdownItem>
|
|
150
152
|
<DropdownItem onClick={openBuyingPolicyDrawer}>
|
|
151
153
|
<Icon name="Rebase" {...sizeProps} />
|
|
152
|
-
|
|
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
|
-
|
|
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 {
|
|
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({
|
|
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: "
|
|
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: "
|
|
55
|
+
label: "orgUnitDetails.auth.smsAccessCode",
|
|
53
56
|
});
|
|
54
57
|
}
|
|
55
58
|
if (sso) {
|
|
56
59
|
options.push({
|
|
57
60
|
method: AuthenticationMethod.SSO,
|
|
58
|
-
label: "
|
|
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:
|
|
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: "
|
|
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
|
|
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>
|
|
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
|
-
|
|
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>
|
|
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
|
-
|
|
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
|
-
|
|
305
|
+
{t("shared.buttons.save")}
|
|
294
306
|
</BasicDrawer.Button>
|
|
295
307
|
</BasicDrawer.Footer>
|
|
296
308
|
</BasicDrawer>
|