Skip to content

Commit 1b52c2e

Browse files
committed
Merge branch 'improvement/ARTESCA-4763/upgrade-core-ui' into q/123.0
2 parents c399fe3 + a8dd96d commit 1b52c2e

24 files changed

+550
-411
lines changed

buildchain/buildchain/ui.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def run_ui_builder(cmd: str) -> docker_command.DockerRun:
125125
"src",
126126
"webpack.common.js",
127127
"webpack.prod.js",
128-
".babelrc",
128+
"babel.config.js",
129129
],
130130
)
131131

eve/main.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ models:
503503
TARGET_URL: "https://192.168.1.254:8443"
504504
command: >
505505
ssh -F ssh_config bastion --
506-
"cd metalk8s/ui &&
506+
"cd metalk8s/ui && rm -rf babel.config.js &&
507507
CYPRESS_BASE_URL=$TARGET_URL npm run test:$TEST_FILTER"
508508
workdir: *terraform_workdir
509509
haltOnFailure: true
@@ -1268,7 +1268,8 @@ stages:
12681268
workdir: build/ui
12691269
env:
12701270
CYPRESS_BASE_URL: http://localhost:80
1271-
command: >
1271+
command: |
1272+
rm -rf babel.config.js
12721273
npm run test:integration --no-update-notifier
12731274
haltOnFailure: true
12741275
- ShellCommand:

eve/workers/pod-integration-tests/ui/app.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ COPY package.json package-lock.json /home/node/
2525

2626
RUN npm config set unsafe-perm true && npm ci
2727

28-
COPY .babelrc webpack.common.js webpack.prod.js /home/node/
28+
COPY babel.config.js webpack.common.js webpack.prod.js /home/node/
2929
COPY public /home/node/public/
3030
COPY src /home/node/src/
3131

shell-ui/jest.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
module.exports = {
2-
transformIgnorePatterns: ['/node_modules/(?!vega-lite|react-to-webcomponent)'],
2+
transformIgnorePatterns: [
3+
'/node_modules/(?!vega-lite|@scality|pretty-bytes|react-to-webcomponent)',
4+
],
35
setupFilesAfterEnv: ['./src/setupTests.js'],
46
clearMocks: true,
57
moduleNameMapper: {

shell-ui/package-lock.json

Lines changed: 240 additions & 174 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

shell-ui/package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,15 @@
4747
"webpack-dev-server": "^3.11.2"
4848
},
4949
"dependencies": {
50-
"@scality/core-ui": "github:scality/core-ui.git#v0.25.0",
51-
"@scality/module-federation": "github:scality/module-federation.git#1.0.0",
50+
"@fortawesome/fontawesome-svg-core": "^1.2.36",
51+
"@fortawesome/free-solid-svg-icons": "^5.15.4",
52+
"@fortawesome/react-fontawesome": "^0.2.0",
53+
"@scality/core-ui": "github:scality/core-ui.git#v0.39.3",
54+
"@scality/module-federation": "github:scality/module-federation.git#1.1.0",
5255
"oidc-client": "^1.11.3",
5356
"oidc-react": "^1.1.5",
5457
"polished": "^4.0.5",
58+
"pretty-bytes": "^6.0.0",
5559
"quicklink": "^2.1.0",
5660
"react": "^17.0.2",
5761
"react-debounce-input": "^3.2.3",

shell-ui/src/FederatedApp.jsx

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,21 @@
11
//@flow
22
import '@fortawesome/fontawesome-free/css/all.css';
33
import {
4-
createContext,
5-
useContext,
6-
useState,
74
useEffect,
8-
lazy,
9-
Suspense,
105
type Node,
11-
useRef,
126
useMemo,
137
} from 'react';
14-
import Loader from '@scality/core-ui/dist/components/loader/Loader.component';
15-
import ReactDOM from 'react-dom';
168
import { QueryClient, QueryClientProvider } from 'react-query';
17-
import ErrorPage500 from '@scality/core-ui/dist/components/error-pages/ErrorPage500.component';
18-
import ScrollbarWrapper from '@scality/core-ui/dist/components/scrollbarwrapper/ScrollbarWrapper.component';
19-
import { ThemeProvider as StyledComponentsProvider } from 'styled-components';
20-
import type { Theme } from './navbar/theme';
21-
import { SolutionsNavbar, type Browser } from './navbar';
22-
import { string } from 'prop-types';
9+
import {ErrorPage500} from '@scality/core-ui/dist/components/error-pages/ErrorPage500.component';
10+
import {ScrollbarWrapper} from '@scality/core-ui/dist/components/scrollbarwrapper/ScrollbarWrapper.component';
11+
import { SolutionsNavbar } from './navbar';
2312
import {
2413
FederatedComponent,
2514
type FederatedComponentProps,
2615
type SolutionUI,
2716
} from '@scality/module-federation';
28-
import { useAuth as useOidcReactAuth, type AuthContextProps } from 'oidc-react';
29-
import AlertProvider from './alerts/AlertProvider';
3017
import {
3118
UIListProvider,
32-
useDeployedApps,
33-
useDeployedAppsRetriever,
3419
} from './initFederation/UIListProvider';
3520
import {
3621
ConfigurationProvider,
@@ -41,7 +26,6 @@ import { Route, Switch, Router } from 'react-router-dom';
4126
import {
4227
ShellConfigProvider,
4328
useShellConfig,
44-
type NavbarEntry,
4529
} from './initFederation/ShellConfigProvider';
4630
import { AuthConfigProvider, useAuthConfig } from './auth/AuthConfigProvider';
4731
import { AuthProvider, useAuth } from './auth/AuthProvider';

shell-ui/src/alerts/AlertProvider.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
//@flow
2-
import { createContext, useContext, type Node } from 'react';
2+
import { type Node } from 'react';
33
import { useQuery } from 'react-query';
4-
import Loader from '@scality/core-ui/dist/components/loader/Loader.component';
4+
import { Loader } from '@scality/core-ui/dist/components/loader/Loader.component';
55
import { getAlerts } from './services/alertManager';
6-
import { filterAlerts } from './services/alertUtils';
7-
import type { FilterLabels } from './services/alertUtils';
86
import { AlertContext } from './alertContext';
97

108
/**

shell-ui/src/initFederation/ConfigurationProviders.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
22
import { createContext, useContext, type Node } from 'react';
33
import { useQueries } from 'react-query';
44
import { useShellConfig } from './ShellConfigProvider';
5-
import { useHistory } from 'react-router-dom';
65
import { useDeployedApps, useDeployedAppsRetriever } from './UIListProvider';
7-
import Loader from '@scality/core-ui/dist/components/loader/Loader.component';
8-
import ErrorPage500 from '@scality/core-ui/dist/components/error-pages/ErrorPage500.component';
6+
import { Loader } from '@scality/core-ui/dist/components/loader/Loader.component';
7+
import { ErrorPage500 } from '@scality/core-ui/dist/components/error-pages/ErrorPage500.component';
98
import { useShellHistory } from './ShellHistoryProvider';
109

1110
if (!window.shellContexts) {
12-
window.shellContexts = {};
11+
window.shellContexts = {};
1312
}
1413

1514
if (!window.shellContexts.WebFingersContext) {
16-
window.shellContexts.WebFingersContext = createContext(null);
15+
window.shellContexts.WebFingersContext = createContext(null);
1716
}
1817

1918
export type OAuth2ProxyConfig = {
@@ -89,7 +88,9 @@ export function useConfigRetriever(): {
8988
| null,
9089
} {
9190
const { retrieveDeployedApps } = useDeployedAppsRetriever();
92-
const webFingerContextValue = useContext(window.shellContexts.WebFingersContext);
91+
const webFingerContextValue = useContext(
92+
window.shellContexts.WebFingersContext,
93+
);
9394
if (!webFingerContextValue) {
9495
throw new Error(
9596
"Can't use useConfigRetriever outside of ConfigurationProvider",
@@ -143,7 +144,9 @@ export function useConfig({
143144
name: string,
144145
}): RuntimeWebFinger | BuildtimeWebFinger | null {
145146
const { retrieveConfiguration } = useConfigRetriever();
146-
const webFingerContextValue = useContext(window.shellContexts.WebFingersContext);
147+
const webFingerContextValue = useContext(
148+
window.shellContexts.WebFingersContext,
149+
);
147150
if (!webFingerContextValue) {
148151
throw new Error("Can't use useConfig outside of ConfigurationProvider");
149152
}

shell-ui/src/initFederation/ShellConfigProvider.js

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
//@flow
22
import { createContext, useContext, type Node } from 'react';
3-
import ErrorPage500 from '@scality/core-ui/dist/components/error-pages/ErrorPage500.component';
4-
import Loader from '@scality/core-ui/dist/components/loader/Loader.component';
3+
import { Loader } from '@scality/core-ui/dist/components/loader/Loader.component';
4+
import { ErrorPage500 } from '@scality/core-ui/dist/components/error-pages/ErrorPage500.component';
55
import { useQuery } from 'react-query';
66

77
if (!window.shellContexts) {
8-
window.shellContexts = {};
9-
}
10-
11-
if (!window.shellContexts.ShellConfigContext) {
12-
window.shellContexts.ShellConfigContext = createContext(null);
13-
}
8+
window.shellContexts = {};
9+
}
10+
11+
if (!window.shellContexts.ShellConfigContext) {
12+
window.shellContexts.ShellConfigContext = createContext(null);
13+
}
1414

1515
export type Theme = {
1616
logoPath: string,
@@ -42,8 +42,8 @@ export type Theme = {
4242
export type NavbarEntry = {
4343
groups?: string[],
4444
label?: {
45-
en: string,
46-
fr: string,
45+
en: string,
46+
fr: string,
4747
},
4848
kind?: string,
4949
view?: string,
@@ -90,7 +90,9 @@ export const ShellConfigProvider = ({ shellConfigUrl, children }): Node => {
9090
);
9191

9292
return (
93-
<window.shellContexts.ShellConfigContext.Provider value={{ config, status }}>
93+
<window.shellContexts.ShellConfigContext.Provider
94+
value={{ config, status }}
95+
>
9496
{(status === 'idle' || status === 'loading') && (
9597
<Loader size="massive" centered={true} aria-label="loading" />
9698
)}

0 commit comments

Comments
 (0)