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

New release - HPC & Enabler - w43 #13652

Merged
merged 4 commits into from
Oct 21, 2024
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ node_modules
cache
dist
!**/iam/**/types
!**/apps/**/types
.memsourcerc.yaml
/docs/docs/public/assets/json/packages.json
.extras*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
import { OsdsText } from '@ovhcloud/ods-components/react';

export interface DescriptionProps {
children?: string;
children?: React.ReactNode;
className?: string;
}
export const Description: React.FC<DescriptionProps> = ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import { IcebergFetchParamsV2, fetchIcebergV2 } from '@ovh-ux/manager-core-api';
import { useInfiniteQuery } from '@tanstack/react-query';
import { ColumnSort } from '../../components';

interface IcebergV2Hook {
interface IcebergV2Hook<T> {
queryKey: string[];
defaultSorting?: ColumnSort;
sort?: (sorting: ColumnSort, data: T[]) => T[];
}

export const defaultPageSize = 10;
Expand All @@ -20,7 +21,7 @@ export function useResourcesIcebergV2<T = unknown>({
pageSize = defaultPageSize,
queryKey,
defaultSorting = undefined,
}: IcebergFetchParamsV2 & IcebergV2Hook) {
}: IcebergFetchParamsV2 & IcebergV2Hook<T>) {
const [flattenData, setFlattenData] = useState<T[]>([]);
const [sorting, setSorting] = useState<ColumnSort>(defaultSorting);
const {
Expand All @@ -42,7 +43,7 @@ export function useResourcesIcebergV2<T = unknown>({
});

useEffect(() => {
const flatten = data?.pages.map((page) => page.data).flat();
const flatten = data?.pages.map((page) => page.data).flat() as T[];
setFlattenData(flatten);
}, [data]);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
export interface IamObject {
id: string;
urn: string;
displayName?: string;
}

export interface IamInterface {
urns?: string[];
actions?: string[];
Expand Down
1 change: 1 addition & 0 deletions packages/manager-react-components/src/hooks/iam/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './iam.interface';
export * from './useOvhIam';
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const fetchAuthorizationCheck = async (
urn: string,
): Promise<IamCheckResponse> => {
const { data } = await apiClient.v2.post(
`/iam/resource/${urn}/authorization/check`,
`/iam/resource/${encodeURIComponent(urn)}/authorization/check`,
{
actions,
},
Expand Down
1 change: 1 addition & 0 deletions packages/manager-react-components/src/hooks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export * from './datagrid/useResourcesV6';
export * from './services';
export * from './tasks';
export * from './date';
export * from './iam';
export { useProductMaintenance } from './pci/useMaintenance';
export {
getMacroRegion,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export type ServiceDetails = {
actions: LifecycleAction[];
};
current: {
createDate: string;
creationDate: string;
pendingActions: LifecycleAction[];
state: LifecycleState;
terminationDate: string;
Expand Down
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.
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,9 +12,13 @@ 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';
import veeamBackupLogo from '@/assets/images/sidebar/veeam-backup-logo.png';

const features = [
'dedicated-cloud',
'hpc-vmware-managed-vcd',
'dedicated-cloud:sapHanaOrder',
'nutanix',
'veeam-enterprise',
Expand All @@ -31,8 +35,10 @@ const features = [
'dedicated-cloud:order',
'cloud-disk-array',
'dedicated-nasha',
'veeam-backup',
'veeam-cloud-connect:order',
'veeam-enterprise:order',
'hycu',
'vrack:bare-metal-cloud',
'vrack:order',
'vrack-services',
Expand Down Expand Up @@ -61,7 +67,7 @@ export default function HostedPrivateCloudSidebar() {
if (feature['dedicated-cloud']) {
menu.push({
id: 'hpc-dedicated-cloud',
label: t('sidebar_vmware'),
label: t('sidebar_vmware_vsphere'),
icon: getIcon('ovh-font ovh-font-dedicatedCloud'),
routeMatcher: new RegExp(`^(/configuration)?/dedicated_cloud`),
async loader() {
Expand Down Expand Up @@ -92,6 +98,36 @@ export default function HostedPrivateCloudSidebar() {
});
}

if (feature['hpc-vmware-managed-vcd']) {
menu.push({
id: 'hpc-managed-vcd',
label: t('sidebar_vmware_vcd'),
icon: getIcon('ovh-font ovh-font-dedicatedCloud'),
pathMatcher: new RegExp(`^/hpc-vmware-managed-vcd`),
async loader() {
const app = 'hpc-vmware-managed-vcd'
const services = await loadServices('/vmwareCloudDirector/organization', null, app);
const icon = getIcon('ovh-font ovh-font-dedicatedCloud');
return [
{
id: 'dedicated-vmware-vcd-all',
label: t('sidebar_vmware_all'),
href: navigation.getURL(app, '/'),
icon,
ignoreSearch: true,
},
...services.map((service) => ({
...service,
icon,
pathMatcher: new RegExp(
`^/hpc-vmware-managed-vcd/${service.serviceName}`,
),
})),
];
},
});
}

if (feature.nutanix) {
menu.push({
id: 'nutanix',
Expand Down Expand Up @@ -236,6 +272,63 @@ export default function HostedPrivateCloudSidebar() {
],
});
}

if (feature['hycu'] || feature['veeam-backup']) {
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|/veeam-backup'),
badge: 'new',
subItems: [
(feature['veeam-backup']) && {
id: 'hpc-veeam-backup',
label: t('sidebar_veeam_backup'),
icon: <img alt="" src={veeamBackupLogo} />,
pathMatcher: new RegExp('^/veeam-backup'),
async loader() {
const appId = 'veeam-backup';
const items = await loadServices('/vmwareCloudDirector/backup', null, appId);

return [
{
id: 'veeam-backup-all',
label: t('sidebar_all_veeam_backup'),
href: navigation.getURL(appId, '#/'),
ignoreSearch: true,
},
...items
];
},
},
(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
@@ -1,5 +1,5 @@
import illustration from '@/assets/images/sidebar/hosted-private-cloud.png';
import { Node } from '../node';
import { Node, NodeTag } from '../node';
import OvhProductName from '@ovh-ux/ovh-product-icons/utils/OvhProductNameEnum';

const hostedPrivateCloudUniverse: Node = {
Expand All @@ -24,14 +24,26 @@ hostedPrivateCloudUniverse.children = [
id: 'vm-ware',
idAttr: 'vm-ware-link',
universe: hostedPrivateCloudUniverse.id,
translation: 'sidebar_vmware',
translation: 'sidebar_vmware_vsphere',
serviceType: 'DEDICATEDCLOUD_VMWARE',
routing: {
application: 'dedicated',
hash: '#/dedicated_cloud',
},
features: ['dedicated-cloud'],
},
{
id: 'hpc-managed-vcd',
universe: hostedPrivateCloudUniverse.id,
translation: 'sidebar_vmware_vcd',
serviceType: 'MANAGED_VCD',
tag: NodeTag.NEW,
routing: {
application: 'hpc-vmware-managed-vcd',
hash: '#/',
},
features: ['hpc-vmware-managed-vcd'],
},
{
id: 'nutanix',
idAttr: 'nutanix-link',
Expand Down Expand Up @@ -89,6 +101,30 @@ hostedPrivateCloudUniverse.children = [
},
features: ['veeam-cloud-connect'],
},
{
id: 'hycu',
idAttr: 'hycu-link',
universe: hostedPrivateCloudUniverse.id,
translation: 'sidebar_hycu',
serviceType: 'HYCU',
tag: NodeTag.NEW,
routing: {
application: 'hycu',
hash: '',
},
features: ['hycu'],
},
{
id: 'veeam-backup',
translation: 'sidebar_veeam_backup',
serviceType: 'VEEAMBACKUP',
tag: NodeTag.NEW,
routing: {
application: 'veeam-backup',
hash: '#/',
},
features: ['veeam-backup'],
},
],
},
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,5 +199,11 @@
"sidebar_security_operations": "Abläufe",
"sidebar_security_identity": "Identität und Sicherheit",
"sidebar_zimbra": "Zimbra Mail",
"sidebar_pci_savings_plan": "Savings Plans"
"sidebar_pci_savings_plan": "Savings Plans",
"sidebar_hycu": "HYCU",
"sidebar_all_hycu": "Alle meine Lizenzen",
"sidebar_veeam_backup": "Managed Veeam für VCD",
"sidebar_all_veeam_backup": "Alle Dienstleistungen",
"sidebar_vmware_vsphere": "Managed VMware vSphere",
"sidebar_vmware_vcd": "Managed VCD"
}
Original file line number Diff line number Diff line change
Expand Up @@ -199,5 +199,11 @@
"sidebar_security_operations": "Operations",
"sidebar_security_identity": "Identity and Security",
"sidebar_reduce": "Minimise",
"sidebar_pci_savings_plan": "Savings Plan"
"sidebar_pci_savings_plan": "Savings Plan",
"sidebar_hycu": "HYCU",
"sidebar_all_hycu": "All my licenses",
"sidebar_veeam_backup": "Managed Veeam for VCD",
"sidebar_all_veeam_backup": "All services",
"sidebar_vmware_vsphere": "Managed VMware vSphere",
"sidebar_vmware_vcd": "Managed VCD"
}
Original file line number Diff line number Diff line change
Expand Up @@ -199,5 +199,11 @@
"sidebar_security_operations": "Operaciones",
"sidebar_security_identity": "Identidad y seguridad",
"sidebar_reduce": "Minimizar",
"sidebar_pci_savings_plan": "Savings Plans"
"sidebar_pci_savings_plan": "Savings Plans",
"sidebar_hycu": "HYCU",
"sidebar_all_hycu": "Todas mis licencias",
"sidebar_veeam_backup": "Managed Veeam for VCD",
"sidebar_all_veeam_backup": "Todos los servicios",
"sidebar_vmware_vsphere": "Managed VMware vSphere",
"sidebar_vmware_vcd": "Managed VCD"
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,23 @@
"sidebar_telecom_operations": "Opérations",
"sidebar_vps": "Serveurs Privés Virtuels",
"sidebar_storage_backup": "Stockage et sauvegarde",
"sidebar_veeam_backup": "Managed Veeam for VCD",
"sidebar_all_veeam_backup": "Tous les services",
"sidebar_dedicated_cloud": "Managed Bare Metal",
"sidebar_licences": "Licences",
"sidebar_hpc": "Hosted Private Cloud",
"sidebar_hpc_short": "HPC",
"sidebar_vmware": "VMware",
"sidebar_vmware_vsphere": "Managed VMware vSphere",
"sidebar_vmware_vcd": "Managed VCD",
"sidebar_vmware_all": "Tous mes services",
"sidebar_anthos_all": "Tous mes déploiements",
"sidebar_nutanix": "Nutanix",
"sidebar_cluster_all": "Tous mes clusters",
"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
Loading
Loading