From 3f4e168c1de022d12ca58a280f4b44177e9cedd5 Mon Sep 17 00:00:00 2001 From: stif59100 Date: Thu, 9 Jan 2025 09:56:51 +0100 Subject: [PATCH] feat(web-office): add button order user or licences ref:MANAGER-16542 Signed-off-by: stif59100 --- .../dashboard/users/Messages_fr_FR.json | 3 ++- .../src/pages/dashboard/users/Users.tsx | 18 ++++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/packages/manager/apps/web-office/public/translations/dashboard/users/Messages_fr_FR.json b/packages/manager/apps/web-office/public/translations/dashboard/users/Messages_fr_FR.json index aa7079f8161c..f0502fb8b46d 100644 --- a/packages/manager/apps/web-office/public/translations/dashboard/users/Messages_fr_FR.json +++ b/packages/manager/apps/web-office/public/translations/dashboard/users/Messages_fr_FR.json @@ -15,5 +15,6 @@ "dashboard_users_action_user_change_password": "Changer le mot de passe", "dashboard_users_action_user_edit": "Editer le compte", "dashboard_users_action_user_delete": "Supprimer le compte", - "dashboard_users_order_button_licenses": "Commander plus de licenses" + "dashboard_users_order_button_licenses": "Commander plus de licenses", + "dashboard_users_order_button_users": "Ajouter un utilisateur" } diff --git a/packages/manager/apps/web-office/src/pages/dashboard/users/Users.tsx b/packages/manager/apps/web-office/src/pages/dashboard/users/Users.tsx index 386c837a5a49..0a5e16e379d1 100644 --- a/packages/manager/apps/web-office/src/pages/dashboard/users/Users.tsx +++ b/packages/manager/apps/web-office/src/pages/dashboard/users/Users.tsx @@ -12,9 +12,14 @@ import { OdsText, OdsButton, } from '@ovhcloud/ods-components/react'; +import { useParams } from 'react-router-dom'; import { UserNativeType } from '@/api/users/type'; import Loading from '@/components/Loading/Loading'; -import { useOfficeLicenseDetail, useOfficeUsers } from '@/hooks'; +import { + useOfficeLicenseDetail, + useOfficeServiceType, + useOfficeUsers, +} from '@/hooks'; import { BadgeStatus } from '@/components/BadgeStatus'; import { UserStateEnum } from '@/api/api.type'; import ActionButtonUsers from './ActionButtonUsers.component'; @@ -28,6 +33,9 @@ export default function Users() { isLoading: isLoadingLicenceDetail, } = useOfficeLicenseDetail(); + const { serviceName } = useParams(); + const isPostpaidLicence = useOfficeServiceType(serviceName) === 'payAsYouGo'; + if (isLoadingUsers || isLoadingLicenceDetail) { return ; } @@ -113,11 +121,17 @@ export default function Users() {

{t('dashboard_users_download_info')}

{t('dashboard_users_download_id')} + + {columns && ( ({