From 54ef71180dd442686d76557b0171375f695c4dc8 Mon Sep 17 00:00:00 2001 From: Romain Jamet Date: Fri, 20 Dec 2024 17:12:46 +0100 Subject: [PATCH] fix(kms): fix UI post ods18 upgrade ref: MANAGER-16501 Signed-off-by: Romain Jamet --- .../src/components/Listing/ListingCells.tsx | 7 +- .../CredentialDatagridCells.tsx | 3 +- .../Create/OrderConfirmation.tsx | 60 ++++++----- .../layout-helpers/Create/RegionSelector.tsx | 99 +++++++++---------- .../BillingInformationsTile.tsx | 2 +- .../InformationsTile.tsx | 4 +- .../menu/KmsActionMenu.component.tsx | 7 +- .../src/pages/create/index.tsx | 1 + .../credentialList/CredentialList.page.tsx | 4 +- .../serviceKeyList/ServiceKeyList.page.tsx | 44 ++++----- .../src/pages/listing/index.tsx | 12 +-- .../src/pages/serviceKey/ServiceKey.page.tsx | 4 +- 12 files changed, 122 insertions(+), 125 deletions(-) diff --git a/packages/manager/apps/key-management-service/src/components/Listing/ListingCells.tsx b/packages/manager/apps/key-management-service/src/components/Listing/ListingCells.tsx index e08362d69ad7..70fabd112d6e 100644 --- a/packages/manager/apps/key-management-service/src/components/Listing/ListingCells.tsx +++ b/packages/manager/apps/key-management-service/src/components/Listing/ListingCells.tsx @@ -13,7 +13,11 @@ import { useOvhTracking, } from '@ovh-ux/manager-react-shell-client'; import { useNavigate } from 'react-router-dom'; -import { ODS_ICON_NAME, ODS_SPINNER_SIZE } from '@ovhcloud/ods-components'; +import { + ODS_BUTTON_VARIANT, + ODS_ICON_NAME, + ODS_SPINNER_SIZE, +} from '@ovhcloud/ods-components'; import { OdsSpinner } from '@ovhcloud/ods-components/react'; import { OKMS } from '@/types/okms.type'; import { OkmsAllServiceKeys } from '@/types/okmsServiceKey.type'; @@ -138,6 +142,7 @@ export const DatagridServiceKeyActionMenu = (props: OkmsAllServiceKeys) => { id={`service-key-actions-${props.id}`} isLoading={isPending} isCompact + variant={ODS_BUTTON_VARIANT.ghost} icon={ODS_ICON_NAME.ellipsisVertical} items={actionList} /> diff --git a/packages/manager/apps/key-management-service/src/components/credential/credentialDatagrid/CredentialDatagridCells.tsx b/packages/manager/apps/key-management-service/src/components/credential/credentialDatagrid/CredentialDatagridCells.tsx index 1fbe6776ed1e..594c5f530477 100644 --- a/packages/manager/apps/key-management-service/src/components/credential/credentialDatagrid/CredentialDatagridCells.tsx +++ b/packages/manager/apps/key-management-service/src/components/credential/credentialDatagrid/CredentialDatagridCells.tsx @@ -13,7 +13,7 @@ import { PageLocation, useOvhTracking, } from '@ovh-ux/manager-react-shell-client'; -import { ODS_BUTTON_COLOR } from '@ovhcloud/ods-components'; +import { ODS_BUTTON_COLOR, ODS_BUTTON_VARIANT } from '@ovhcloud/ods-components'; import { OkmsCredential } from '@/types/okmsCredential.type'; import { useFormattedDate } from '@/hooks/useFormattedDate'; import { CredentialStatus } from '../credentialStatus/CredentialStatus.component'; @@ -140,6 +140,7 @@ export const DatagridCredentialCellActions = (credential: OkmsCredential) => { ); diff --git a/packages/manager/apps/key-management-service/src/components/layout-helpers/Create/OrderConfirmation.tsx b/packages/manager/apps/key-management-service/src/components/layout-helpers/Create/OrderConfirmation.tsx index e1eafc1b7a22..fa5de065bcbf 100644 --- a/packages/manager/apps/key-management-service/src/components/layout-helpers/Create/OrderConfirmation.tsx +++ b/packages/manager/apps/key-management-service/src/components/layout-helpers/Create/OrderConfirmation.tsx @@ -5,13 +5,13 @@ import { PageLocation, useOvhTracking, } from '@ovh-ux/manager-react-shell-client'; -import { OdsText, OdsButton, OdsCard } from '@ovhcloud/ods-components/react'; +import { OdsText, OdsButton } from '@ovhcloud/ods-components/react'; import { ODS_TEXT_PRESET, ODS_BUTTON_SIZE, ODS_BUTTON_COLOR, } from '@ovhcloud/ods-components'; -import { LinkType, Links, Subtitle } from '@ovh-ux/manager-react-components'; +import { LinkType, Links } from '@ovh-ux/manager-react-components'; import { useNavigate } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; import { ROUTES_URLS } from '@/routes/routes.constants'; @@ -38,34 +38,32 @@ const OrderConfirmation = ({ region }: OrderConfirmationProps) => { }, [orderLink]); return ( - <> - -
- - {t('key_management_service_create_order_initiated_title')} - - - {t('key_management_service_create_order_initiated_subtitle')} - - - trackClick({ - location: PageLocation.funnel, - buttonType: ButtonType.externalLink, - actionType: 'navigation', - actions: ['go-back-order'], - }) - } - /> - - {t('key_management_service_create_order_initiated_info')} - -
-
+
+
+ + {t('key_management_service_create_order_initiated_title')} + + + {t('key_management_service_create_order_initiated_subtitle')} + + + trackClick({ + location: PageLocation.funnel, + buttonType: ButtonType.externalLink, + actionType: 'navigation', + actions: ['go-back-order'], + }) + } + /> + + {t('key_management_service_create_order_initiated_info')} + +
{ }} label={t('key_management_service_create_order_initiated_cta_done')} /> - +
); }; diff --git a/packages/manager/apps/key-management-service/src/components/layout-helpers/Create/RegionSelector.tsx b/packages/manager/apps/key-management-service/src/components/layout-helpers/Create/RegionSelector.tsx index 3b16080c10ac..6a84ced6f605 100644 --- a/packages/manager/apps/key-management-service/src/components/layout-helpers/Create/RegionSelector.tsx +++ b/packages/manager/apps/key-management-service/src/components/layout-helpers/Create/RegionSelector.tsx @@ -3,7 +3,6 @@ import { useTranslation } from 'react-i18next'; import { OdsText, OdsSelect, - OdsFormField, OdsButton, OdsSpinner, } from '@ovhcloud/ods-components/react'; @@ -57,59 +56,53 @@ const RegionSelector = ({ ); } return ( - <> -
- -
- - {t('key_management_service_create_region_title')} - - - {t('key_management_service_create_region_description')} - - {isLoading && ( - - )} -
- {orderCatalogOKMS && !isLoading && ( - { - const value = v.detail.value?.toString(); +
+
+ + {t('key_management_service_create_region_title')} + + + {t('key_management_service_create_region_description')} + + {isLoading && ( + + )} + {orderCatalogOKMS && !isLoading && ( + { + const value = v.detail.value?.toString(); - if (value) { - trackClick({ - location: PageLocation.funnel, - buttonType: ButtonType.select, - actionType: 'action', - actions: ['select_location', value], - }); + if (value) { + trackClick({ + location: PageLocation.funnel, + buttonType: ButtonType.select, + actionType: 'action', + actions: ['select_location', value], + }); - selectRegion(value); - } - }} - > - {orderCatalogOKMS.plans[0].configurations[0].values.map( - (region) => ( - - ), - )} - - )} - + selectRegion(value); + } + }} + > + {orderCatalogOKMS.plans[0].configurations[0].values.map( + (region) => ( + + ), + )} + + )}
- +
); }; diff --git a/packages/manager/apps/key-management-service/src/components/layout-helpers/Dashboard/GeneralInformationsTiles/BillingInformationsTile.tsx b/packages/manager/apps/key-management-service/src/components/layout-helpers/Dashboard/GeneralInformationsTiles/BillingInformationsTile.tsx index 67f446d878e6..2a4ccc18247a 100644 --- a/packages/manager/apps/key-management-service/src/components/layout-helpers/Dashboard/GeneralInformationsTiles/BillingInformationsTile.tsx +++ b/packages/manager/apps/key-management-service/src/components/layout-helpers/Dashboard/GeneralInformationsTiles/BillingInformationsTile.tsx @@ -104,7 +104,7 @@ const BillingInformationsTile = ({ 'key_management_service_dashboard_field_label_next_billing_date', ), value: ( -
+
+
navigate(ROUTES_URLS.okmsUpdateName)} diff --git a/packages/manager/apps/key-management-service/src/components/menu/KmsActionMenu.component.tsx b/packages/manager/apps/key-management-service/src/components/menu/KmsActionMenu.component.tsx index 0878684626cd..c49679eda842 100644 --- a/packages/manager/apps/key-management-service/src/components/menu/KmsActionMenu.component.tsx +++ b/packages/manager/apps/key-management-service/src/components/menu/KmsActionMenu.component.tsx @@ -5,7 +5,11 @@ import { useOvhTracking, } from '@ovh-ux/manager-react-shell-client'; import React from 'react'; -import { ODS_BUTTON_COLOR, ODS_ICON_NAME } from '@ovhcloud/ods-components'; +import { + ODS_BUTTON_COLOR, + ODS_BUTTON_VARIANT, + ODS_ICON_NAME, +} from '@ovhcloud/ods-components'; import { useTranslation } from 'react-i18next'; import { useNavigate } from 'react-router-dom'; import { OKMS } from '@/types/okms.type'; @@ -39,6 +43,7 @@ const KmsActionMenu = ({ id }: OKMS) => { items={items} isCompact icon={ODS_ICON_NAME.ellipsisVertical} + variant={ODS_BUTTON_VARIANT.ghost} /> ); }; diff --git a/packages/manager/apps/key-management-service/src/pages/create/index.tsx b/packages/manager/apps/key-management-service/src/pages/create/index.tsx index de347e69e3a1..8b4c392f4353 100644 --- a/packages/manager/apps/key-management-service/src/pages/create/index.tsx +++ b/packages/manager/apps/key-management-service/src/pages/create/index.tsx @@ -13,6 +13,7 @@ export default function Create() { const { t } = useTranslation('key-management-service/create'); const [isOrderInitiated, setIsOrderInitiated] = useState(false); const [selectedRegion, setSelectedRegion] = useState(undefined); + return (
{ ); return ( -
+
{t('key_management_service_credential_headline')} @@ -44,7 +43,6 @@ const CredentialList = () => { isLoading={isLoadingIam} size={ODS_BUTTON_SIZE.sm} color={ODS_BUTTON_COLOR.primary} - variant={ODS_BUTTON_VARIANT.outline} className="w-fit" onClick={() => { trackClick({ diff --git a/packages/manager/apps/key-management-service/src/pages/dashboard/serviceKeyList/ServiceKeyList.page.tsx b/packages/manager/apps/key-management-service/src/pages/dashboard/serviceKeyList/ServiceKeyList.page.tsx index 0a8350fdfd6f..2a8300b3f755 100644 --- a/packages/manager/apps/key-management-service/src/pages/dashboard/serviceKeyList/ServiceKeyList.page.tsx +++ b/packages/manager/apps/key-management-service/src/pages/dashboard/serviceKeyList/ServiceKeyList.page.tsx @@ -6,7 +6,6 @@ import { ODS_MESSAGE_COLOR, ODS_BUTTON_SIZE, ODS_ICON_NAME, - ODS_BUTTON_VARIANT, ODS_TEXT_PRESET, ODS_BUTTON_ICON_ALIGNMENT, ODS_BUTTON_COLOR, @@ -102,7 +101,7 @@ export default function Keys() { ); return ( -
+
{t('key_management_service_service-keys_headline')} @@ -111,28 +110,25 @@ export default function Keys() { {tError('manager_error_page_default')} )} -
- { - trackClick({ - location: PageLocation.page, - buttonType: ButtonType.button, - actionType: 'action', - actions: ['create_encryption_key'], - }); - navigate(ROUTES_URLS.createKmsServiceKey); - }} - urn={okms.iam.urn} - iamActions={[kmsIamActions.serviceKeyCreate]} - label={t('key_management_service_service-keys_cta_create')} - icon={ODS_ICON_NAME.plus} - iconAlignment={ODS_BUTTON_ICON_ALIGNMENT.left} - /> -
+ { + trackClick({ + location: PageLocation.page, + buttonType: ButtonType.button, + actionType: 'action', + actions: ['create_encryption_key'], + }); + navigate(ROUTES_URLS.createKmsServiceKey); + }} + urn={okms.iam.urn} + iamActions={[kmsIamActions.serviceKeyCreate]} + label={t('key_management_service_service-keys_cta_create')} + icon={ODS_ICON_NAME.plus} + iconAlignment={ODS_BUTTON_ICON_ALIGNMENT.left} + /> } > -
+
{ clearNotifications(); @@ -132,9 +130,7 @@ export default function Listing() { }} label={t('key_management_service_listing_add_kms_button')} /> -
- {flattenData && ( -
+ {flattenData && ( fetchNextPage()} contentAlignLeft /> -
- )} + )} +
diff --git a/packages/manager/apps/key-management-service/src/pages/serviceKey/ServiceKey.page.tsx b/packages/manager/apps/key-management-service/src/pages/serviceKey/ServiceKey.page.tsx index 048e63525129..039dc206b01a 100644 --- a/packages/manager/apps/key-management-service/src/pages/serviceKey/ServiceKey.page.tsx +++ b/packages/manager/apps/key-management-service/src/pages/serviceKey/ServiceKey.page.tsx @@ -17,6 +17,7 @@ import { ODS_BUTTON_VARIANT, ODS_ICON_NAME, ODS_BUTTON_COLOR, + ODS_BUTTON_SIZE, } from '@ovhcloud/ods-components'; import { ButtonType, @@ -145,7 +146,7 @@ export default function Key() { 'key_management_service_service-keys_dashboard_field_name', ), value: ( -
+