Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(hycu): add link to manage contacts #14263

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"account_contacts_service_category_NUTANIX": "Nutanix",
"account_contacts_service_category_DEDICATED_CLUSTER": "3-AZ server",
"account_contacts_service_category_PACK_SIP_TRUNK": "Packs SIP Trunk",
"account_contacts_service_category_HYCU": "HYCU",
"account_contacts_service_contact_admin": "Contact administrateur",
"account_contacts_service_contact_tech": "Contact technique",
"account_contacts_service_contact_billing": "Contact facturation",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const AVAILABLE_SERVICES = [
'LOGS',
'NUTANIX',
'DEDICATED_CLUSTER',
'HYCU',
];

export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ import {
DashboardTile,
DateFormat,
Description,
Links,
LinkType,
useFormattedDate,
useServiceDetails,
} from '@ovh-ux/manager-react-components';
import { ODS_THEME_COLOR_INTENT } from '@ovhcloud/ods-common-theming';
import { ODS_ICON_NAME, ODS_ICON_SIZE } from '@ovhcloud/ods-components';
import { ODS_ICON_NAME } from '@ovhcloud/ods-components';
import {
OsdsIcon,
OsdsLink,
Expand Down Expand Up @@ -43,6 +45,11 @@ const BillingInformationsTile = ({ serviceName }: { serviceName: string }) => {
{ searchText: serviceName },
]);

const {
data: contactUrl,
isLoading: isLoadingContactUrl,
} = useNavigationGetUrl(['dedicated', '#/contacts/services', {}]);

const openTerminateModal = () =>
navigate(
urls.dashboard_terminate.replace(subRoutes.serviceName, serviceName),
Expand Down Expand Up @@ -100,17 +107,33 @@ const BillingInformationsTile = ({ serviceName }: { serviceName: string }) => {
value: (
<div className="flex flex-col gap-4">
<div>
{isLoading
? Array.from({ length: 3 }).map((_, index) => (
<OsdsSkeleton key={index} />
))
: serviceDetails?.data.customer.contacts.map((contact) => (
{isLoading ? (
<>
<OsdsSkeleton />
<OsdsSkeleton />
<OsdsSkeleton />
</>
) : (
<>
{serviceDetails?.data.customer.contacts.map((contact) => (
<Description key={contact.type}>{`${
contact.customerCode
} ${t(
`hycu_dashboard_contact_type_${contact.type}`,
)}`}</Description>
))}
</>
)}
{isLoadingContactUrl ? (
<OsdsSkeleton />
) : (
<Links
href={(contactUrl as string) ?? '#'}
type={LinkType.next}
label={t('hycu_dashboard_field_label_manage_contacts')}
className="mt-4"
/>
)}
</div>
</div>
),
Expand Down
Loading