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 #13244

Merged
merged 18 commits into from
Oct 18, 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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
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,42 @@ 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',
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
@@ -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 Down Expand Up @@ -89,6 +89,19 @@ 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'],
},
],
},
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,5 +199,7 @@
"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"
}
Original file line number Diff line number Diff line change
Expand Up @@ -199,5 +199,7 @@
"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"
}
Original file line number Diff line number Diff line change
Expand Up @@ -199,5 +199,7 @@
"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"
}
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
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
Original file line number Diff line number Diff line change
Expand Up @@ -199,5 +199,7 @@
"sidebar_security_operations": "Operazioni",
"sidebar_security_identity": "Identità e sicurezza",
"sidebar_reduce": "Riduci",
"sidebar_pci_savings_plan": "Savings Plan"
"sidebar_pci_savings_plan": "Savings Plan",
"sidebar_hycu": "HYCU",
"sidebar_all_hycu": "Tutte le mie licenze"
}
Original file line number Diff line number Diff line change
Expand Up @@ -199,5 +199,7 @@
"sidebar_security_operations": "Operacje",
"sidebar_security_identity": "Tożsamość i bezpieczeństwo",
"sidebar_reduce": "Zmniejsz",
"sidebar_pci_savings_plan": "Savings Plans"
"sidebar_pci_savings_plan": "Savings Plans",
"sidebar_hycu": "HYCU",
"sidebar_all_hycu": "Wszystkie moje licencje"
}
Original file line number Diff line number Diff line change
Expand Up @@ -199,5 +199,7 @@
"sidebar_security_operations": "Operações",
"sidebar_security_identity": "Identidade e Segurança",
"sidebar_reduce": "Reduzir",
"sidebar_pci_savings_plan": "Savings Plans"
"sidebar_pci_savings_plan": "Savings Plans",
"sidebar_hycu": "HYCU",
"sidebar_all_hycu": "Todas as minhas licenças"
}
2 changes: 2 additions & 0 deletions packages/manager/apps/hycu/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
e2e/reports
e2e/coverage
3 changes: 3 additions & 0 deletions packages/manager/apps/hycu/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# @ovh-ux/manager-hycu-app

> Backup HYCU for OVHcloud
20 changes: 20 additions & 0 deletions packages/manager/apps/hycu/cucumber.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const isCI = process.env.CI;

module.exports = {
default: {
paths: ['e2e/features/**/*.feature'],
require: [
'../../../../playwright-helpers/bdd-setup.ts',
'e2e/**/*.step.ts',
],
requireModule: ['ts-node/register'],
format: [
'summary',
isCI ? 'progress' : 'progress-bar',
!isCI && ['html', 'e2e/reports/cucumber-results-report.html'],
!isCI && ['usage-json', 'e2e/reports/cucumber-usage-report.json'],
].filter(Boolean),
formatOptions: { snippetInterface: 'async-await' },
retry: 1,
},
};
22 changes: 22 additions & 0 deletions packages/manager/apps/hycu/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="mobile-web-app-capable" content="yes" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>OVHcloud</title>
<link rel="shortcut icon" href="images/favicon.png" />
<link rel="apple-touch-icon" href="images/touchicon-180.png" />
</head>
<body>
<noscript>
<strong>
We're sorry but this application doesn't work properly without
JavaScript enabled. Please enable it to continue.
</strong>
</noscript>
<div id="root"></div>
<script type="module" src="./src/index.tsx"></script>
</body>
</html>
11 changes: 11 additions & 0 deletions packages/manager/apps/hycu/mocks/example/example-data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{
"id": 20374
},
{
"id": 20375
},
{
"id": 20379
}
]
30 changes: 30 additions & 0 deletions packages/manager/apps/hycu/mocks/example/example.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { Handler } from '../../../../../../playwright-helpers';
import exampleList from './example-data.json';

export type GetExampleMocksParams = { isKo?: boolean; nb?: number };

export const getExampleMocks = ({
isKo,
nb = Number.POSITIVE_INFINITY,
}: GetExampleMocksParams): Handler[] => [
{
url: '*',
response: isKo
? {
message: 'Example error',
}
: exampleList.slice(0, nb),
status: isKo ? 500 : 200,
api: 'v6',
},
{
url: '*',
response: isKo
? {
message: 'Example error',
}
: exampleList.slice(0, nb),
status: isKo ? 500 : 200,
api: 'v2',
},
];
1 change: 1 addition & 0 deletions packages/manager/apps/hycu/mocks/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './example/example';
66 changes: 66 additions & 0 deletions packages/manager/apps/hycu/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"name": "@ovh-ux/manager-hycu-app",
"version": "0.0.0",
"private": true,
"description": "Backup HYCU for OVHcloud",
"repository": {
"type": "git",
"url": "git+https://github.com/ovh/manager.git",
"directory": "packages/manager/apps/hycu"
},
"license": "BSD-3-Clause",
"author": "OVH SAS",
"scripts": {
"build": "tsc && vite build",
"dev": "tsc && vite",
"start": "lerna exec --stream --scope='@ovh-ux/manager-hycu-app' --include-dependencies -- npm run build --if-present",
"start:dev": "lerna exec --stream --scope='@ovh-ux/manager-hycu-app' --include-dependencies -- npm run dev --if-present",
"start:watch": "lerna exec --stream --parallel --scope='@ovh-ux/manager-hycu-app' --include-dependencies -- npm run dev:watch --if-present",
"test": "vitest run"
},
"dependencies": {
"@ovh-ux/manager-config": "*",
"@ovh-ux/manager-core-api": "*",
"@ovh-ux/manager-core-utils": "*",
"@ovh-ux/manager-react-components": "*",
"@ovh-ux/manager-react-core-application": "*",
"@ovh-ux/manager-react-shell-client": "*",
"@ovh-ux/manager-tailwind-config": "*",
"@ovh-ux/request-tagger": "*",
"@ovhcloud/ods-common-core": "17.2.1",
"@ovhcloud/ods-common-theming": "17.2.1",
"@ovhcloud/ods-components": "17.2.1",
"@ovhcloud/ods-theme-blue-jeans": "17.2.1",
"@tanstack/react-query": "^5.51.21",
"@tanstack/react-query-devtools": "^5.51.21",
"axios": "^1.1.2",
"clsx": "^1.2.1",
"i18next": "^23.8.2",
"i18next-http-backend": "^2.4.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-i18next": "^14.0.5",
"react-router-dom": "^6.3.0",
"tailwindcss": "^3.4.4"
},
"devDependencies": {
"@cucumber/cucumber": "^10.3.1",
"@ovh-ux/manager-vite-config": "*",
"@testing-library/jest-dom": "^6.5.0",
"@testing-library/react": "^16.0.1",
"@testing-library/user-event": "^14.5.2",
"@types/jest": "^29.5.13",
"@vitejs/plugin-react": "^4.3.2",
"element-internals-polyfill": "^1.3.12",
"eslint-plugin-prettier": "^5.2.1",
"msw": "2.1.7",
"typescript": "^5.1.6",
"vite": "^5.2.13",
"vitest": "^2.1.2"
},
"regions": [
"CA",
"EU",
"US"
]
}
6 changes: 6 additions & 0 deletions packages/manager/apps/hycu/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"title": "Dashboard-Seite",
"error_service": "Unsere Info-Dienstleistungen",
"general_informations": "Allgemeine Informationen",
"tab2": "TAB 2",
"back_link": "Zurück zur Liste"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"title": "Dashboard page",
"error_service": "Our info services",
"general_informations": "General information",
"tab2": "Tab 2",
"back_link": "Back to list"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"title": "Dashboard page",
"error_service": "No services info",
"general_informations": "Datos generales",
"tab2": "Tabulador 2",
"back_link": "Volver a la lista"
}
Loading
Loading