Skip to content
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 @@ -302,7 +302,7 @@ export const useImportPolicy = ({
setIsPending(true);
const policy = await readFileAsJSON(files[0], t);

importUserPolicy(projectId, userId, policy);
await importUserPolicy(projectId, userId, policy);
onSuccess();
} catch (e) {
onError(e as Error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default function ArchivePage() {
onError: (error: ApiError) => {
addErrorMessage({
i18nKey:
'pci_projects_project_storages_cold_archive_containers_container_archive_success_message',
'pci_projects_project_storages_cold_archive_containers_container_archive_error_message',
error,
values: {
containerName: archiveName,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { useState } from 'react';
import { useNavigate } from 'react-router-dom';
import { useNavigate, useParams } from 'react-router-dom';
import { useTranslation } from 'react-i18next';
import {
Alert,
AlertDescription,
Button,
Card,
CardContent,
Expand Down Expand Up @@ -66,6 +64,7 @@ const OrderFunnel = ({
suggestions,
catalog,
);
const { projectId } = useParams();
const projectData = usePciProject();
const navigate = useNavigate();
const { toast } = useToast();
Expand All @@ -80,7 +79,9 @@ const OrderFunnel = ({
});
},
onSuccess: (service) => {
navigate(`../${service.id}`);
navigate(
`/pci/projects/${projectId}/databases-analytics/${service.category}/services/${service.id}`,
);
toast({
title: t('successCreatingService'),
});
Expand Down
20 changes: 6 additions & 14 deletions packages/manager/apps/pci-kubernetes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,15 @@
"scripts": {
"build": "tsc --project tsconfig.build.json && vite build",
"build:strict": "tsc --project tsconfig.json && vite build",
"coverage": "vitest run --coverage",
"coverage": "manager-test run --coverage",
"lint": "eslint ./src",
"lint:modern": "manager-lint --config eslint.config.mjs ./src",
"lint:modern:fix": "manager-lint --fix --config eslint.config.mjs ./src",
"start": "vite",
"test": "vitest run",
"test:watch": "vitest"
"test": "manager-test run",
"test:watch": "manager-test"
},
"dependencies": {
"@datatr-ux/ods-tailwind-config": "1.0.3",
"@datatr-ux/ovhcloud-types": "1.0.8",
"@datatr-ux/uxlib": "0.0.10",
"@hookform/resolvers": "^3.3.4",
"@ovh-ux/manager-common-translations": "^0.19.2",
"@ovh-ux/manager-config": "^8.6.4",
Expand All @@ -34,7 +31,9 @@
"@ovhcloud/ods-common-stencil": "17.2.2",
"@ovhcloud/ods-common-theming": "17.2.2",
"@ovhcloud/ods-components": "17.2.2",
"@ovhcloud/ods-react": "^19.0.2",
"@ovhcloud/ods-theme-blue-jeans": "17.2.2",
"@ovhcloud/ods-themes": "^19.0.2",
"@tanstack/react-query": "^5.51.21",
"@tanstack/react-table": "^8.17.3",
"clsx": "^2.1.1",
Expand All @@ -58,21 +57,14 @@
"@ovh-ux/manager-static-analysis-kit": "^0.11.0",
"@ovh-ux/manager-vite-config": "^0.13.3",
"@tanstack/react-query-devtools": "^5.51.21",
"@testing-library/dom": "^10.1.0",
"@testing-library/jest-dom": "^6.4.5",
"@testing-library/react": "^16.0.0",
"@testing-library/user-event": "^14.5.2",
"@types/jest": "^29.5.12",
"@types/react": "^18.2.79",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.0",
"@vitest/coverage-v8": "^2.1.9",
"autoprefixer": "^10.4.19",
"postcss": "^8.4.38",
"rollup": "^4.18.0",
"tailwindcss": "^3.4.4",
"typescript": "^5.4.5",
"vitest": "^2.1.9"
"typescript": "^5.4.5"
},
"regions": [
"CA",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@
"kube_common_node_pool_deploy_description": "Bei einem über drei Availability Zones (AZ) verteilten Kubernetes-Cluster wird empfohlen, Node-Pools je Zone einzusetzen, um Resilienz und Hochverfügbarkeit zu gewährleisten. Diese Konfiguration ermöglicht eine gleichmäßige Verteilung Ihrer Workloads auf die AZs. Das erhöht die Fehlertoleranz und sorgt für eine optimale Betriebskontinuität.",
"kube_node_pool": "Node-Pool konfigurieren",
"kube_common_estimation_price_free": "Kostenlos",
"kube_common_estimation_total_price": "Geschätzter Gesamtpreis:"
"kube_common_estimation_total_price": "Geschätzter Gesamtpreis:",
"kube_common_node_pool_estimation_cost_tile": "Monatliche Schätzung"
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@
"kube_common_node_pool_deploy_description": "To achieve high availability and resilience within a three-zone Kubernetes cluster, we recommend deploying one node pool per zone. This configuration allows you to distribute your workloads evenly across the AZ. In addition, it improves fault tolerance and ensures service uptime.",
"kube_node_pool": "Configure node pool",
"kube_common_estimation_price_free": "Free",
"kube_common_estimation_total_price": "Estimated total price:"
"kube_common_estimation_total_price": "Total estimated price:",
"kube_common_node_pool_estimation_cost_tile": "Monthly estimate"
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@
"kube_common_node_pool_deploy_description": "En un clúster Kubernetes repartido en tres zonas de disponibilidad (AZ), se recomienda utilizar pools de nodos por zona para garantizar la resiliencia y la alta disponibilidad. Esta configuración le permite distribuir de manera equilibrada sus cargas de trabajo entre las AZ. Mejora así la tolerancia a fallos y garantiza una continuidad del servicio óptima.",
"kube_node_pool": "Configurar el pool de nodos",
"kube_common_estimation_price_free": "Gratis",
"kube_common_estimation_total_price": "Precio total aproximado:"
"kube_common_estimation_total_price": "Precio total estimado:",
"kube_common_node_pool_estimation_cost_tile": "Estimación mensual"
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"kube_common_node_pool_configure_true": "Configurer des pools de nœuds",
"kube_common_node_pool_configure_false": " Créer un cluster sans pool de nœuds",
"kube_common_node_pool_estimated_cost": "Estimation coût mensuel du cluster :",
"kube_common_node_pool_estimation_cost_tile": "Estimation mensuelle",
"kube_common_node_pool_estimation_text": "Cette estimation n'inclut pas une éventuelle réduction liée aux Savings Plans.",
"kube_common_node_pool_estimation_price": "Pools de nœuds :",
"kube_common_estimation_total_price": "Prix total estimé :",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"kube_common_node_pool_configure_true": "Configurer des pools de nœuds",
"kube_common_node_pool_configure_false": " Créer un cluster sans pool de nœuds",
"kube_common_node_pool_estimated_cost": "Estimation coût mensuel du cluster :",
"kube_common_node_pool_estimation_cost_tile": "Estimation mensuelle",
"kube_common_node_pool_estimation_text": "Cette estimation n'inclut pas une éventuelle réduction liée aux Savings Plans.",
"kube_common_node_pool_estimation_price": "Pools de nœuds :",
"kube_common_estimation_total_price": "Prix total estimé :",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@
"kube_common_node_pool_deploy_description": "In un cluster Kubernetes ripartito su tre Availability Zone (AZ), l'utilizzo di pool di nodi per zona è consigliato per assicurare resilienza e alta disponibilità. Questa configurazione permette di distribuire in modo equilibrato i tuoi workload tra le AZ. Migliora la tolleranza ai guasti e garantisce una continuità di servizio ottimale.",
"kube_node_pool": "Configurare il pool di nodi",
"kube_common_estimation_price_free": "Gratis",
"kube_common_estimation_total_price": "Prezzo totale stimato:"
"kube_common_estimation_total_price": "Prezzo totale stimato:",
"kube_common_node_pool_estimation_cost_tile": "Stima mensile"
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@
"kube_common_node_pool_deploy_description": "W klastrze Kubernetes rozproszonym w trzech strefach dostępności (AZ) zaleca się używanie pul węzłów w każdej strefie, w celu zapewnienia odporności i wysokiej dostępności. Dzięki tej konfiguracji możesz równomiernie rozdzielić obciążenia między AZ, co poprawia tolerancję na awarie i zapewnia optymalną ciągłość usługi.",
"kube_node_pool": "Konfiguracja puli węzłów",
"kube_common_estimation_price_free": "Gratis",
"kube_common_estimation_total_price": "Szacunkowa cena całkowita:"
"kube_common_estimation_total_price": "Szacowana cena całkowita:",
"kube_common_node_pool_estimation_cost_tile": "Miesięczna wycena"
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@
"kube_common_node_pool_deploy_description": "Num cluster Kubernetes repartido por três Availability Zones (AZ), é recomendada a utilização de pools de nós por zonas para assegurar a resiliência e a alta disponibilidade. Esta configuração permite distribuir de forma equilibrada as suas cargas de trabalho entre as AZ. Assim, melhora-se a tolerância a falhas e garante-se uma continuidade de serviço ideal.",
"kube_node_pool": "Configurar o pool de nós",
"kube_common_estimation_price_free": "Grátis",
"kube_common_estimation_total_price": "Preço total estimado:"
"kube_common_estimation_total_price": "Preço total estimado:",
"kube_common_node_pool_estimation_cost_tile": "Estimativa mensal"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
import { render } from '@testing-library/react';
import { describe, it, vi } from 'vitest';

import { wrapper } from '@/wrapperRenders';

import BillingStep, { TBillingStepProps } from './BillingStep.component';

const defaultProps: TBillingStepProps = {
price: 0,
monthlyPrice: 0,
monthlyBilling: {
isComingSoon: false,
isChecked: false,
check: vi.fn(),
},
warn: false,
};

vi.mock('@ovh-ux/manager-react-components', async () => ({
...(await vi.importActual('@ovh-ux/manager-react-components')),
useProjectUrl: vi.fn().mockReturnValue('mockProjectUrl'),
useCatalogPrice: () => ({
getTextPrice: (price: number) => price,
getFormattedCatalogPrice: (price: number) => price,
getFormattedHourlyCatalogPrice: (price: number) => price + ' /Hour',
getFormattedMonthlyCatalogPrice: (price: number) => price + ' /Month',
}),
}));

describe('BillingStep', () => {
describe('Hourly billing', () => {
it('should render hourly billing tile with price from props', () => {
const props = {
...defaultProps,
price: 5248,
};
const { getByTestId } = render(<BillingStep {...props} />, { wrapper });

const hourlyTile = getByTestId('hourly_tile');

expect(hourlyTile.innerHTML).toContain('5248');
// monthly price
expect(hourlyTile.innerHTML).toContain('3831040');
});
it('should call getFormattedMonthlyCatalogPrice with the correct value', () => {});
});
describe('Monthly billing', () => {
it('should not show monthly billing tile when monthlyBilling.isComingSoon is true', () => {
const props = {
...defaultProps,
monthlyPrice: undefined,
monthlyBilling: {
...defaultProps.monthlyBilling,
isComingSoon: true,
},
};
const { queryByTestId } = render(<BillingStep {...props} />, {
wrapper,
});

const monthlyTile = queryByTestId('monthly_tile');

expect(monthlyTile).not.toBeInTheDocument();
});

it('should show monthly billing tile when monthlyBilling.isComingSoon is false', () => {
const props = {
...defaultProps,
monthlyPrice: 15,
monthlyBilling: {
...defaultProps.monthlyBilling,
isComingSoon: false,
},
};
const { queryByTestId } = render(<BillingStep {...props} />, {
wrapper,
});

const monthlyTile = queryByTestId('monthly_tile');

expect(monthlyTile?.innerHTML).toContain('15');
});

it('should show is coming soon message if monthly billing coming soon', () => {
const props = {
...defaultProps,
monthlyBilling: {
...defaultProps.monthlyBilling,
isComingSoon: true,
},
};
const { queryByTestId } = render(<BillingStep {...props} />, {
wrapper,
});

const yesMessage = queryByTestId('coming_soon_message');
const noMessage = queryByTestId('billing_description');

expect(yesMessage).toBeInTheDocument();
expect(noMessage).not.toBeInTheDocument();
});

it('should not show is coming soon message if monthly billing is not coming soon', () => {
const props = {
...defaultProps,
monthlyBilling: {
...defaultProps.monthlyBilling,
isComingSoon: false,
},
};
const { queryByTestId } = render(<BillingStep {...props} />, {
wrapper,
});

const yesMessage = queryByTestId('coming_soon_message');
const noMessage = queryByTestId('billing_description');

expect(yesMessage).not.toBeInTheDocument();
expect(noMessage).toBeInTheDocument();
});
});
describe('Warn message', () => {
it("should show warn message if it's enabled", () => {
const props = {
...defaultProps,
warn: true,
};
const { queryByTestId } = render(<BillingStep {...props} />, { wrapper });

const warnMessage = queryByTestId('warn_message');

expect(warnMessage).toBeInTheDocument();
});

it("should not show warn message if it's enabled", () => {
const props = {
...defaultProps,
warn: false,
};
const { queryByTestId } = render(<BillingStep {...props} />, { wrapper });

const warnMessage = queryByTestId('warn_message');

expect(warnMessage).not.toBeInTheDocument();
});
});
});
Loading
Loading