Skip to content

Commit

Permalink
feat(container): add hycu solution
Browse files Browse the repository at this point in the history
ref: MANAGER-14495

Signed-off-by: Thibault Barske <[email protected]>
  • Loading branch information
tibs245 committed Oct 7, 2024
1 parent e9880be commit 42f09e2
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 7 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {
import {
Suspense,
useContext,
useEffect,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default function ServerSidebarVirtual({
style={{
height: `${rowVirtualizer.getTotalSize()}px`,
width: '100%',
position: 'relative',
position: 'relative'
}}
aria-label={t('sidebar_description')}
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from "react";

const getIcon = (iconClass:string ): JSX.Element => {
return <span className={`${iconClass} text-indigo-800 mr-1`} aria-hidden="true" />;}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import { OsdsIcon } from '@ovhcloud/ods-components/react';
import { ODS_ICON_NAME, ODS_ICON_SIZE } from '@ovhcloud/ods-components';
import { ODS_THEME_COLOR_INTENT } from '@ovhcloud/ods-common-theming';
import { useFeatureAvailability } from '@ovh-ux/manager-react-components';
import infinityCLoud from '@/assets/images/sidebar/infinity-cloud.png';
import hycuLogo from '@/assets/images/sidebar/hycu-logo.svg';

const features = [
'dedicated-cloud',
Expand All @@ -33,6 +35,7 @@ const features = [
'dedicated-nasha',
'veeam-cloud-connect:order',
'veeam-enterprise:order',
'hycu',
'vrack:bare-metal-cloud',
'vrack:order',
'vrack-services',
Expand Down Expand Up @@ -236,6 +239,43 @@ export default function HostedPrivateCloudSidebar() {
],
});
}
if (feature['hycu']) {
menu.push({
id: 'hpc-storage-backup',
label: t('sidebar_storage_backup'),
icon: <img className="mb-1 mr-1 w-6 aspect-square" alt="" src={infinityCLoud} />,
pathMatcher: new RegExp('^/hycu'),
badge: 'new',
ignoreSearch: true,
subItems: [
(feature['hycu']) && {
id: 'hpc-hycu',
label: t('sidebar_hycu'),
icon: <img alt="" src={hycuLogo} className="mb-1 w-6 aspect-square" />,
pathMatcher: new RegExp('^/hycu'),
badge: "new",
async loader() {
const appId = 'hycu';
const items = await loadServices('/license/hycu');

return [
{
id: 'hycu-all',
label: t('sidebar_all_hycu'),
href: navigation.getURL(appId, '#/'),
ignoreSearch: true,
},
...items.map((service) => ({
...service,
href: navigation.getURL(appId, `#/${service.serviceName}`),
}))
];
},
}
]
})
}

if (feature['key-management-service']) {
const keyIcon = <OsdsIcon name={ODS_ICON_NAME.KEY_CONCEPT} size={ODS_ICON_SIZE.xxs} color={ODS_THEME_COLOR_INTENT.text}/>
menu.push({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
"sidebar_platforms": "Plateformes",
"sidebar_platforms_services": "Plateformes et services",
"sidebar_veeam_enterprise": "Veeam Enterprise",
"sidebar_hycu": "HYCU",
"sidebar_all_hycu": "Toutes mes licenses",
"sidebar_pci": "Public Cloud",
"sidebar_pci_short": "PCP",
"sidebar_pci_new": "Créer un projet",
Expand Down
4 changes: 2 additions & 2 deletions packages/manager/apps/hycu/src/data/api/hycu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ export const getlicenseHycuListQueryKey = ['get/license/hycu'];
*/
export const getlicenseHycuList = async (
params: GetlicenseHycuListParams,
): Promise<any> => apiClient.v6.get('/license/hycu', { data: params });
): Promise<unknown> => apiClient.v6.get('/license/hycu', { data: params });

export type GetlicenseHycuServiceParams = {
/** Service name */
serviceName?: any;
serviceName?: string;
};

export const getlicenseHycuServiceQueryKey = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export default function DashboardPage() {
<OsdsTabs panel={panel}>
<OsdsTabBar slot="top">
{tabsList.map((tab: DashboardTabItemProps) => (
<NavLink to={tab.to} className="no-underline">
<NavLink key={tab.name} to={tab.to} className="no-underline">
<OsdsTabBarItem
key={`osds-tab-bar-item-${tab.name}`}
panel={tab.name}
Expand Down

0 comments on commit 42f09e2

Please sign in to comment.