Skip to content

Commit 390b47d

Browse files
authored
Merge branch 'master' into ib/ansible-fix
2 parents ab84437 + c0edd22 commit 390b47d

File tree

18 files changed

+14251
-44963
lines changed

18 files changed

+14251
-44963
lines changed

console2/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88

99
# production
1010
/build
11+
/dist
12+
13+
# Vite
14+
*.local
1115

1216
# misc
1317
.DS_Store

console2/public/index.html renamed to console2/index.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
<meta charset="utf-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
77

8+
<!-- Load config before app initialization -->
89
<script src="/api/service/console/cfg"></script>
910

10-
<link id="favicon" rel="shortcut icon" href="%PUBLIC_URL%/favicon.png">
11+
<link id="favicon" rel="shortcut icon" href="/favicon.png">
1112
<base href="/" />
1213
<title>Concord</title>
1314
</head>
@@ -17,6 +18,9 @@
1718
You need to enable JavaScript to run this app.
1819
</noscript>
1920
<div id="root"></div>
21+
22+
<!-- Vite entry point -->
23+
<script type="module" src="/src/index.tsx"></script>
2024
</body>
2125

2226
</html>

console2/package-lock.json

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

console2/package.json

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,25 @@
22
"name": "concord-console",
33
"version": "1.0.0",
44
"private": true,
5+
"type": "module",
56
"devDependencies": {
67
"@babel/preset-react": "7.16.0",
78
"@datasert/cronjs-matcher": "^1.4.0",
89
"@testing-library/react": "12.1.2",
910
"@types/jest": "27.0.3",
1011
"@types/lodash": "4.14.178",
11-
"@types/node": "16.11.12",
12+
"@types/node": "20.10.0",
1213
"@types/prop-types": "15.7.4",
13-
"@types/react": "17.0.37",
14-
"@types/react-dom": "17.0.11",
14+
"@types/react": "18.2.45",
15+
"@types/react-dom": "18.2.18",
1516
"@types/react-redux": "7.1.20",
1617
"@types/react-router": "5.1.17",
1718
"@types/react-router-dom": "5.3.2",
1819
"@types/redux-logger": "3.0.9",
1920
"@types/sinon": "10.0.6",
2021
"@types/styled-components": "5.1.17",
21-
"@types/webpack-env": "1.16.3",
2222
"@typescript-eslint/typescript-estree": "5.35.1",
23+
"@vitejs/plugin-react": "^4.2.1",
2324
"babel-cli": "6.26.0",
2425
"babel-core": "7.0.0-bridge.0",
2526
"babel-preset-es2015": "6.24.1",
@@ -31,7 +32,8 @@
3132
"redux-devtools-extension": "2.13.9",
3233
"shx": "0.3.3",
3334
"ts-node": "10.4.0",
34-
"typescript": "4.8.2"
35+
"typescript": "5.3.3",
36+
"vite": "^5.0.8"
3537
},
3638
"dependencies": {
3739
"@monaco-editor/react": "4.3.1",
@@ -45,15 +47,14 @@
4547
"lodash": "4.17.21",
4648
"parse-domain": "4.1.0",
4749
"query-string": "7.0.1",
48-
"react": "17.0.2",
49-
"react-dom": "17.0.2",
50+
"react": "18.2.0",
51+
"react-dom": "18.2.0",
5052
"react-hook-form": "7.21.2",
5153
"react-idle-timer": "5.4.1",
5254
"react-json-view": "1.21.3",
5355
"react-redux": "7.2.6",
5456
"react-router": "5.2.0",
5557
"react-router-dom": "5.2.0",
56-
"react-scripts": "4.0.3",
5758
"react-spring": "9.3.2",
5859
"reakit": "1.3.11",
5960
"redux": "4.1.2",
@@ -68,12 +69,12 @@
6869
"url-search-params-polyfill": "8.1.1"
6970
},
7071
"scripts": {
71-
"start": "export SET NODE_OPTIONS=--openssl-legacy-provider && react-scripts start",
72-
"build": "export SET NODE_OPTIONS=--openssl-legacy-provider && ./npm.sh run hack:remove-sui-css-dep && export SET BUILD_PATH='./target/classes/META-INF/console2' && react-scripts build",
73-
"hack:remove-sui-css-dep": "shx --silent sed -i @import /*import node_modules/semantic-ui-css/semantic.min.css > /dev/null 2>&1",
74-
"dev": "export SET NODE_OPTIONS=--openssl-legacy-provider && babel-node --presets es2015 scripts/devServer.js",
75-
"test": "react-scripts test",
76-
"test:watch": "./npm.sh test --watch",
72+
"start": "vite",
73+
"dev": "vite",
74+
"build": "vite build",
75+
"build:check": "tsc && vite build",
76+
"preview": "vite preview",
77+
"test": "vitest",
7778
"pretty": "prettier --tab-width 4 --print-width 100 --single-quote --jsx-bracket-same-line --arrow-parens 'always' parser 'typescript' --write 'src/**/*.{ts,tsx}'"
7879
},
7980
"eslintConfig": {

console2/src/components/molecules/ProcessLogViewer/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ class ProcessLogViewer extends React.Component<Props, State> {
300300
<Button onClick={() => loadWholeLog(opts)}>Show the whole log</Button>
301301
)}
302302
<Button
303-
disabled={process === undefined}
303+
disabled={!instanceId}
304304
onClick={() => window.open(`/api/v1/process/${instanceId}/log`, '_blank')}>
305305
Raw
306306
</Button>

console2/src/components/organisms/CheckpointView/CheckpointPopup/RestoreProcess.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import { AnyAction, Dispatch } from 'redux';
3030
import { ConcordKey } from '../../../../api/common';
3131
import { actions } from '../../../../state/data/processes';
3232
import { isFinal, ProcessStatus } from '../../../../api/process';
33-
import { isFunction } from 'util';
33+
import { isFunction } from 'lodash';
3434

3535
interface ExternalProps {
3636
children?: RenderCallback;

console2/src/components/organisms/ProcessLogActivityV2/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ const ProcessLogActivityV2 = ({
260260

261261
<Button.Group>
262262
<Button
263-
disabled={process === undefined}
263+
disabled={!instanceId}
264264
onClick={() => window.open(`/api/v1/process/${instanceId}/log`, '_blank')}>
265265
Raw
266266
</Button>

console2/src/components/pages/AboutPage/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class AboutPage extends React.PureComponent {
3737
<p>
3838
Server version: <ServerVersion />
3939
</p>
40-
<p>Console version: {process.env.REACT_APP_CONCORD_VERSION || 'n/a'}</p>
40+
<p>Console version: {import.meta.env.VITE_CONCORD_VERSION || 'n/a'}</p>
4141
<p>Last updated: {window.concord.lastUpdated || 'n/a'}</p>
4242
</>
4343
);

console2/src/index.tsx

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020

2121
import * as React from 'react';
22-
import * as ReactDOM from 'react-dom';
22+
import { createRoot } from 'react-dom/client';
2323

2424
import 'typeface-lato';
2525
import 'semantic-ui-css/semantic.min.css';
@@ -28,17 +28,9 @@ import App from './App';
2828
import './index.css';
2929

3030
const rootEl = document.getElementById('root') as HTMLElement;
31+
const root = createRoot(rootEl);
3132

32-
ReactDOM.render(<App />, rootEl);
33-
34-
// @ts-ignore
35-
if (module.hot) {
36-
// @ts-ignore
37-
module.hot.accept('./App', () => {
38-
const NextApp = require('./App').default;
39-
ReactDOM.render(<NextApp />, rootEl);
40-
});
41-
}
33+
root.render(<App />);
4234

4335
// remove any old service worker
4436
if (navigator.serviceWorker) {

console2/src/vite-env.d.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*-
2+
* *****
3+
* Concord
4+
* -----
5+
* Copyright (C) 2017 - 2025 Walmart Inc.
6+
* -----
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
* =====
19+
*/
20+
/// <reference types="vite/client" />
21+
22+
interface ImportMetaEnv {
23+
readonly VITE_CONCORD_VERSION?: string;
24+
// Add other env variables as needed
25+
}
26+
27+
interface ImportMeta {
28+
readonly env: ImportMetaEnv;
29+
}

0 commit comments

Comments
 (0)