From b7e66e8c64b82e3430129122997dff68dc52f28d Mon Sep 17 00:00:00 2001 From: Paul Dickerson Date: Mon, 16 Dec 2024 12:42:15 +0100 Subject: [PATCH] revert(vcd): revert resetPassword and usageTile ref: MANAGER-15191 MANAGER-15243 Signed-off-by: Paul Dickerson --- .../dashboard/Messages_fr_FR.json | 1 + ...centreGeneralInformationTile.component.tsx | 20 ++++ ...izationServiceManagementTile.component.tsx | 16 +-- .../ServicePasswordTileItem.tsx | 48 +++++++++ .../DatacentreGeneralInformation.page.tsx | 1 - .../OrganizationGeneralInformation.spec.tsx | 100 +++++++++--------- .../src/routes/routes.tsx | 31 +++--- 7 files changed, 139 insertions(+), 78 deletions(-) create mode 100644 packages/manager/apps/hpc-vmware-managed-vcd/src/components/tiles/organization-service-tile/password-tile-item/ServicePasswordTileItem.tsx diff --git a/packages/manager/apps/hpc-vmware-managed-vcd/public/translations/dashboard/Messages_fr_FR.json b/packages/manager/apps/hpc-vmware-managed-vcd/public/translations/dashboard/Messages_fr_FR.json index 9ab63c50698d..bc6793f2c272 100644 --- a/packages/manager/apps/hpc-vmware-managed-vcd/public/translations/dashboard/Messages_fr_FR.json +++ b/packages/manager/apps/hpc-vmware-managed-vcd/public/translations/dashboard/Messages_fr_FR.json @@ -24,6 +24,7 @@ "managed_vcd_dashboard_service_cancellation": "Résilier le service", "managed_vcd_dashboard_password": "Mot de passe", "managed_vcd_dashboard_password_renew": "Renouveler le mot de passe admin", + "managed_vcd_dashboard_password_tooltip": "Si vous souhaitez changer votre mot de passe administrateur, merci de contacter le support", "managed_vcd_dashboard_password_modal_title": "Changer le mot de passe", "managed_vcd_dashboard_password_modal_subtitle": "Êtes-vous certain de changer de mot de passe ?", "managed_vcd_dashboard_password_renew_success": "Vous allez recevoir un email pour visualiser votre mot de passe", diff --git a/packages/manager/apps/hpc-vmware-managed-vcd/src/components/tiles/datacentre-general-information-tile/DatacentreGeneralInformationTile.component.tsx b/packages/manager/apps/hpc-vmware-managed-vcd/src/components/tiles/datacentre-general-information-tile/DatacentreGeneralInformationTile.component.tsx index f0fb668d86cd..c1ba199f59bc 100644 --- a/packages/manager/apps/hpc-vmware-managed-vcd/src/components/tiles/datacentre-general-information-tile/DatacentreGeneralInformationTile.component.tsx +++ b/packages/manager/apps/hpc-vmware-managed-vcd/src/components/tiles/datacentre-general-information-tile/DatacentreGeneralInformationTile.component.tsx @@ -56,6 +56,15 @@ export default function DatacentreGenerationInformationTile({ ), }, + { + id: 'cpuCount', + label: tVdc('managed_vcd_vdc_vcpu_count'), + value: ( + + {vcdDatacentre?.currentState.vCPUCount?.toString()} + + ), + }, { id: 'ramCount', label: tVdc('managed_vcd_vdc_ram_count'), @@ -67,6 +76,17 @@ export default function DatacentreGenerationInformationTile({ ), }, + { + id: 'vcpuSpeed', + label: tVdc('managed_vcd_vdc_vcpu_speed'), + value: ( + + {tVdc('managed_vcd_vdc_vcpu_value', { + speed: vcdDatacentre?.currentState.vCPUSpeed, + })} + + ), + }, { id: 'interface', label: t('managed_vcd_dashboard_management_interface'), diff --git a/packages/manager/apps/hpc-vmware-managed-vcd/src/components/tiles/organization-service-tile/OrganizationServiceManagementTile.component.tsx b/packages/manager/apps/hpc-vmware-managed-vcd/src/components/tiles/organization-service-tile/OrganizationServiceManagementTile.component.tsx index 5c882e6f0158..1b3756d7f5d3 100644 --- a/packages/manager/apps/hpc-vmware-managed-vcd/src/components/tiles/organization-service-tile/OrganizationServiceManagementTile.component.tsx +++ b/packages/manager/apps/hpc-vmware-managed-vcd/src/components/tiles/organization-service-tile/OrganizationServiceManagementTile.component.tsx @@ -1,18 +1,15 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; -import { useNavigate, useParams } from 'react-router-dom'; -import { DashboardTile, Links } from '@ovh-ux/manager-react-components'; +import { DashboardTile } from '@ovh-ux/manager-react-components'; import { OsdsChip } from '@ovhcloud/ods-components/react'; import { ODS_THEME_COLOR_INTENT } from '@ovhcloud/ods-common-theming'; import { ODS_CHIP_SIZE } from '@ovhcloud/ods-components'; import ServiceRenewTileItem from './renew-tile-item/ServiceRenewTileItem'; import ServiceContactsTileItem from './contact-tile-item/ServiceContactsTileItem'; -import { subRoutes, urls } from '@/routes/routes.constant'; +import ServicePasswordTileItem from './password-tile-item/ServicePasswordTileItem'; export default function OrganizationServiceManagementTile() { const { t } = useTranslation('dashboard'); - const { id } = useParams(); - const navigate = useNavigate(); return (
@@ -41,14 +38,7 @@ export default function OrganizationServiceManagementTile() { { id: 'servicePassword', label: t('managed_vcd_dashboard_password'), - value: ( - - navigate(urls.resetPassword.replace(subRoutes.dashboard, id)) - } - /> - ), + value: , }, { id: 'serviceContacts', diff --git a/packages/manager/apps/hpc-vmware-managed-vcd/src/components/tiles/organization-service-tile/password-tile-item/ServicePasswordTileItem.tsx b/packages/manager/apps/hpc-vmware-managed-vcd/src/components/tiles/organization-service-tile/password-tile-item/ServicePasswordTileItem.tsx new file mode 100644 index 000000000000..fd80c3b81430 --- /dev/null +++ b/packages/manager/apps/hpc-vmware-managed-vcd/src/components/tiles/organization-service-tile/password-tile-item/ServicePasswordTileItem.tsx @@ -0,0 +1,48 @@ +import React from 'react'; +import { useTranslation } from 'react-i18next'; +import { ODS_THEME_COLOR_INTENT } from '@ovhcloud/ods-common-theming'; +import { + ODS_ICON_NAME, + ODS_ICON_SIZE, + ODS_CHIP_SIZE, +} from '@ovhcloud/ods-components'; +import { + OsdsChip, + OsdsIcon, + OsdsLink, + OsdsTooltip, + OsdsTooltipContent, +} from '@ovhcloud/ods-components/react'; + +export default function ServicePasswordTileItem() { + const { t } = useTranslation('dashboard'); + + return ( +
+
+ + {t('managed_vcd_dashboard_password_renew')} + + + + + {t('managed_vcd_dashboard_password_tooltip')} + + +
+ + {t('managed_vcd_dashboard_coming_soon')} + +
+ ); +} diff --git a/packages/manager/apps/hpc-vmware-managed-vcd/src/pages/dashboard/datacentre/general-informations/DatacentreGeneralInformation.page.tsx b/packages/manager/apps/hpc-vmware-managed-vcd/src/pages/dashboard/datacentre/general-informations/DatacentreGeneralInformation.page.tsx index 925a0a937bf1..d6bbd4059f14 100644 --- a/packages/manager/apps/hpc-vmware-managed-vcd/src/pages/dashboard/datacentre/general-informations/DatacentreGeneralInformation.page.tsx +++ b/packages/manager/apps/hpc-vmware-managed-vcd/src/pages/dashboard/datacentre/general-informations/DatacentreGeneralInformation.page.tsx @@ -43,7 +43,6 @@ export default function DatacentresGeneralInformationPage() { vcdDatacentre={vcdDatacentre?.data} vcdOrganization={vcdOrganization?.data} /> -
diff --git a/packages/manager/apps/hpc-vmware-managed-vcd/src/pages/dashboard/organization/general-information/OrganizationGeneralInformation.spec.tsx b/packages/manager/apps/hpc-vmware-managed-vcd/src/pages/dashboard/organization/general-information/OrganizationGeneralInformation.spec.tsx index f7d3b8425a1b..cd37d397110b 100644 --- a/packages/manager/apps/hpc-vmware-managed-vcd/src/pages/dashboard/organization/general-information/OrganizationGeneralInformation.spec.tsx +++ b/packages/manager/apps/hpc-vmware-managed-vcd/src/pages/dashboard/organization/general-information/OrganizationGeneralInformation.spec.tsx @@ -94,53 +94,55 @@ describe('Organization General Information Page', () => { await assertModalText({ container, text: 'Organization update error' }); }); - it('resets the password of the organization', async () => { - const { container } = await renderTest({ - initialRoute: `/${organizationList[1].id}`, - }); - - await assertTextVisibility( - labels.dashboard.managed_vcd_dashboard_password_renew, - ); - - const resetPasswordLink = await getButtonByLabel({ - container, - label: labels.dashboard.managed_vcd_dashboard_password_renew, - isLink: true, - }); - await waitFor(() => userEvents.click(resetPasswordLink)); - - await assertModalVisibility({ container, isVisible: true }); - - const validateButton = await getButtonByLabel({ - container, - label: labels.dashboard.managed_vcd_dashboard_edit_modal_cta_validate, - }); - await waitFor(() => userEvents.click(validateButton)); - - await assertModalVisibility({ container, isVisible: false }); - await assertTextVisibility( - labels.dashboard.managed_vcd_dashboard_password_renew_success, - ); - }); - - it('trying to reset password displays an error if reset password service is KO', async () => { - const { container } = await renderTest({ - initialRoute: `/${organizationList[0].id}/reset-password`, - isOrganizationResetPasswordKo: true, - }); - - await assertModalVisibility({ container, isVisible: true }); - - const validateButton = await getButtonByLabel({ - container, - label: labels.dashboard.managed_vcd_dashboard_edit_modal_cta_validate, - }); - await waitFor(() => userEvents.click(validateButton)); - - await assertModalVisibility({ container, isVisible: false }); - await assertTextVisibility( - labels.dashboard.managed_vcd_dashboard_password_renew_error, - ); - }); + // uncomment below: when API for resetPassword is available + // it('resets the password of the organization', async () => { + // const { container } = await renderTest({ + // initialRoute: `/${organizationList[1].id}`, + // }); + + // await assertTextVisibility( + // labels.dashboard.managed_vcd_dashboard_password_renew, + // ); + + // const resetPasswordLink = await getButtonByLabel({ + // container, + // label: labels.dashboard.managed_vcd_dashboard_password_renew, + // isLink: true, + // }); + // await waitFor(() => userEvents.click(resetPasswordLink)); + + // await assertModalVisibility({ container, isVisible: true }); + + // const validateButton = await getButtonByLabel({ + // container, + // label: labels.dashboard.managed_vcd_dashboard_edit_modal_cta_validate, + // }); + // await waitFor(() => userEvents.click(validateButton)); + + // await assertModalVisibility({ container, isVisible: false }); + // await assertTextVisibility( + // labels.dashboard.managed_vcd_dashboard_password_renew_success, + // ); + // }); + + // uncomment below: when API for resetPassword is available + // it('trying to reset password displays an error if reset password service is KO', async () => { + // const { container } = await renderTest({ + // initialRoute: `/${organizationList[0].id}/reset-password`, + // isOrganizationResetPasswordKo: true, + // }); + + // await assertModalVisibility({ container, isVisible: true }); + + // const validateButton = await getButtonByLabel({ + // container, + // label: labels.dashboard.managed_vcd_dashboard_edit_modal_cta_validate, + // }); + // await waitFor(() => userEvents.click(validateButton)); + + // await assertModalVisibility({ container, isVisible: false }); + // await assertTextVisibility( + // labels.dashboard.managed_vcd_dashboard_password_renew_error, + // ); + // }); }); diff --git a/packages/manager/apps/hpc-vmware-managed-vcd/src/routes/routes.tsx b/packages/manager/apps/hpc-vmware-managed-vcd/src/routes/routes.tsx index d396d231eb92..b4096696284b 100644 --- a/packages/manager/apps/hpc-vmware-managed-vcd/src/routes/routes.tsx +++ b/packages/manager/apps/hpc-vmware-managed-vcd/src/routes/routes.tsx @@ -85,21 +85,22 @@ export const Routes: any = [ }, }, }, - { - id: 'reset-password', - path: urls.resetPassword, - ...lazyRouteConfig(() => - import( - '@/pages/dashboard/organization/general-information/edit/EditPassword.page' - ), - ), - handle: { - tracking: { - pageName: 'reset-password', - pageType: PageType.popup, - }, - }, - }, + // uncomment below: when API for resetPassword is available + // { + // id: 'reset-password', + // path: urls.resetPassword, + // ...lazyRouteConfig(() => + // import( + // '@/pages/dashboard/organization/general-information/edit/EditPassword.page' + // ), + // ), + // handle: { + // tracking: { + // pageName: 'reset-password', + // pageType: PageType.popup, + // }, + // }, + // }, ], }, {