Skip to content

Commit d6821ce

Browse files
github-actions[bot]kqesarCyrille BourgoisYann Lojewski
authored
feat(*): pci vouchers app in reactjs
Migrating the existing Vouchers app from AngularJS to ReactJS Expose client typescript api type Add check for missing region in apps package json Make level2 attribute optional Create react shell client hooks Add paginated-datagrid & notifications Add test:turbo command Set alignment of osds-pagination to right uAPP url should be reachable directly ref: DTCORE-1675, DTCORE-1660 Signed-off-by: Florian Renaut <[email protected]> Co-authored-by: Yoann Fievez <[email protected]> Co-authored-by: Cyrille Bourgois <[email protected]> Co-authored-by: Yann Lojewski <[email protected]>
1 parent 3d2dc2f commit d6821ce

File tree

140 files changed

+6658
-2012
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+6658
-2012
lines changed

jest.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ module.exports = {
2222
'^.+\\.module\\.(css|sass|scss)$',
2323
'<rootDir>/node_modules/(?!lodash-es|@stencil)',
2424
],
25+
testPathIgnorePatterns: ['/node_modules/', '/apps/pci-vouchers/'],
2526
moduleNameMapper: {
2627
'^.+\\.module\\.(css|sass|scss)$': 'identity-obj-proxy',
2728
'.+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$':

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"start": "node -r esm scripts/start-application.js",
4242
"test:jest": "jest --runInBand",
4343
"test": "yarn lint",
44+
"test:turbo": "turbo run test",
4445
"test:scripts": "make test",
4546
"test:playwright:run": "lerna run test:e2e:script --concurrency 1"
4647
},

packages/components/ovh-at-internet/src/track.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export interface LegacyTrackingData {
1111
chapter1?: string;
1212
chapter2?: string;
1313
chapter3?: string;
14-
level2: string;
14+
level2?: string;
1515
page?: any;
1616
[key: string]: any;
1717
}

packages/components/ovh-shell/src/client/index.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { getHeaders } from '@ovh-ux/request-tagger';
99
import ShellClient from './shell-client';
1010
import StandaloneShellClient from './standalone-shell-client';
1111
import IFrameMessageBus from '../message-bus/iframe';
12+
import { ShellClientApi } from './api';
1213

1314
function fetchApplications(): Promise<Record<string, Application>> {
1415
return useReket(true).get('/applications', {
@@ -89,7 +90,9 @@ export function initStandaloneClientApi(
8990
return client.init().then(() => client.getApi());
9091
}
9192

92-
export default function init(applicationId: ApplicationId) {
93+
export default async function init(
94+
applicationId: ApplicationId,
95+
): Promise<ShellClientApi> {
9396
let initPromise;
9497

9598
if (isTopLevelApplication()) {
@@ -100,7 +103,7 @@ export default function init(applicationId: ApplicationId) {
100103
initPromise = initIFrameClientApi(applicationId);
101104
}
102105

103-
return initPromise.then((shellApi) => {
106+
return initPromise.then(async (shellApi) => {
104107
shellApi.ux.resetAccountSidebar();
105108
return shellApi.environment
106109
.setApplication(applicationId)

packages/manager-components/.storybook/i18n.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import i18n from 'i18next';
22
import { initReactI18next } from 'react-i18next';
33

44
i18n.use(initReactI18next).init({
5-
fallbackLng: 'fr-FR',
5+
fallbackLng: 'fr_FR',
66
interpolation: {
77
escapeValue: false,
88
},

packages/manager-components/.storybook/preview.tsx

+13-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
import React, { Suspense, useEffect } from 'react';
22
import { I18nextProvider } from 'react-i18next';
3+
import { odsSetup } from '@ovhcloud/ods-common-core';
34

45
import { Preview } from '@storybook/react';
56
import '../src/tailwind/theme.css';
67
import '@ovhcloud/ods-theme-blue-jeans/dist/index.css';
78
import i18n from './i18n';
89

10+
import '@ovhcloud/ods-theme-blue-jeans';
11+
12+
odsSetup();
13+
914
const preview: Preview = {
1015
parameters: {
1116
actions: { argTypesRegex: '^on[A-Z].*' },
@@ -44,14 +49,14 @@ export const globalTypes = {
4449
toolbar: {
4550
icon: 'globe',
4651
items: [
47-
{ value: 'fr-FR', title: 'Francais' },
48-
{ value: 'en-GB', title: 'English' },
49-
{ value: 'de-DE', title: 'Deutsch' },
50-
{ value: 'es-ES', title: 'Espagne' },
51-
{ value: 'it-IT', title: 'Italy' },
52-
{ value: 'pt-PT', title: 'Portugal' },
53-
{ value: 'pl-PL', title: 'Poland' },
54-
{ value: 'fr-CA', title: 'Canada' },
52+
{ value: 'fr_FR', title: 'Francais' },
53+
{ value: 'en_GB', title: 'English' },
54+
{ value: 'de_DE', title: 'Deutsch' },
55+
{ value: 'es_ES', title: 'Espagne' },
56+
{ value: 'it_IT', title: 'Italy' },
57+
{ value: 'pt_PT', title: 'Portugal' },
58+
{ value: 'pl_PL', title: 'Poland' },
59+
{ value: 'fr_CA', title: 'Canada' },
5560
],
5661
showName: true,
5762
},

packages/manager-components/jest.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
module.exports = {
2+
testMatch: ['<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}'],
23
testEnvironment: 'jsdom',
34
transformIgnorePatterns: [
45
'node_modules/(?!lodash-es|@ovh-ux|@ovhcloud|@stencil)',
56
],
67
setupFilesAfterEnv: ['./jest.setup.ts'],
7-
collectCoverageFrom: ['src/components/**/**.component.tsx'],
8+
collectCoverageFrom: ['src/components/**/*.component.tsx'],
89
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
9-
testMatch: ['<rootDir>/src/components/**/**/*.spec.tsx'],
1010
moduleNameMapper: {
1111
'.+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$':
1212
'<rootDir>/src/_mock_/images.tsx',

packages/manager-components/package.json

+14-7
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@
2424
"@ovhcloud/ods-common-theming": "^17.1.0",
2525
"@ovhcloud/ods-components": "^17.1.0",
2626
"@ovhcloud/ods-theme-blue-jeans": "^17.1.0",
27+
"@tanstack/react-table": "^8.11.6",
2728
"babel-preset-react-app": "^10.0.1",
28-
"i18next": "^20.4.0",
2929
"react": "18.2.0",
30-
"react-dom": "18.2.0",
31-
"react-i18next": "^11.18.1",
3230
"sass": "1.71.0",
3331
"tailwindcss": "3.3.3"
3432
},
@@ -39,6 +37,7 @@
3937
"@storybook/addon-essentials": "7.5.3",
4038
"@storybook/addon-interactions": "7.5.3",
4139
"@storybook/addon-links": "7.5.3",
40+
"storybook-addon-react-router-v6": "^2.0.10",
4241
"@storybook/addon-styling": "1.3.6",
4342
"@storybook/blocks": "7.5.3",
4443
"@storybook/react": "7.5.3",
@@ -64,23 +63,31 @@
6463
"eslint-plugin-storybook": "0.6.13",
6564
"file-loader": "^6.2.0",
6665
"husky": "8.0.3",
66+
"i18next": "^20.4.0",
6767
"jsdom": "22.1.0",
6868
"json": "11.0.0",
6969
"lint-staged": "13.2.3",
7070
"postcss": "8.4.27",
7171
"prettier": "3.0.1",
7272
"prop-types": "15.8.1",
73+
"react-dom": "18.2.0",
74+
"react-i18next": "^11.18.1",
75+
"react-router-dom": "^6.21.0",
7376
"storybook": "7.5.3",
7477
"storybook-addon-react-router-v6": "^2.0.10",
7578
"ts-jest": "^29.1.1",
7679
"typescript": "^4.3.2",
7780
"vite": "4.4.9",
7881
"vite-plugin-dts": "3.5.1",
79-
"vitest": "0.34.1"
82+
"vitest": "0.34.1",
83+
"zustand": "^4.5.0"
8084
},
81-
"peerDependencies": {
82-
"react": "18.2.0",
83-
"react-dom": "18.2.0"
85+
"optionalDependencies": {
86+
"i18next": "^20.4.0",
87+
"react-dom": "18.2.0",
88+
"react-i18next": "^11.18.1",
89+
"react-router-dom": "^6.21.0",
90+
"zustand": "^4.5.0"
8491
},
8592
"files": [
8693
"dist"

0 commit comments

Comments
 (0)