Skip to content

Commit

Permalink
Upgrade to react 18 and chakra 2
Browse files Browse the repository at this point in the history
  • Loading branch information
bbovenzi committed Jun 13, 2022
1 parent bc78eb5 commit 2b70877
Show file tree
Hide file tree
Showing 7 changed files with 656 additions and 580 deletions.
12 changes: 7 additions & 5 deletions airflow/www/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
"@testing-library/jest-dom": "^5.15.0",
"@testing-library/react": "^12.1.2",
"@testing-library/react-hooks": "^7.0.2",
"@types/react": "^18.0.12",
"@types/react-dom": "^18.0.5",
"@typescript-eslint/eslint-plugin": "^5.13.0",
"@typescript-eslint/parser": "^5.0.0",
"babel": "^6.23.0",
Expand Down Expand Up @@ -76,9 +78,9 @@
"webpack-manifest-plugin": "^2.2.0"
},
"dependencies": {
"@chakra-ui/react": "^1.8.3",
"@chakra-ui/react": "^2.2.0",
"@emotion/cache": "^11.4.0",
"@emotion/react": "^11.4.1",
"@emotion/react": "^11.9.3",
"@emotion/styled": "^11",
"axios": "^0.26.0",
"bootstrap-3-typeahead": "^4.0.2",
Expand All @@ -91,14 +93,14 @@
"datatables.net": "^1.11.4",
"datatables.net-bs": "^1.11.4",
"eonasdan-bootstrap-datetimepicker": "^4.17.47",
"framer-motion": "^4",
"framer-motion": "4.1.17",
"jquery": ">=3.5.0",
"jshint": "^2.13.4",
"lodash": "^4.17.21",
"moment-timezone": "^0.5.34",
"nvd3": "^1.8.6",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-icons": "^4.3.1",
"react-query": "^3.34.16",
"react-router-dom": "^6.3.0",
Expand Down
2 changes: 1 addition & 1 deletion airflow/www/static/js/grid/components/TaskName.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const TaskName = ({
<Text
display="inline"
ml={level * 4 + 4}
isTruncated
noOfLines={1}
>
{label}
{isMapped && (
Expand Down
1 change: 0 additions & 1 deletion airflow/www/static/js/grid/dagRuns/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ const DagRuns = () => {
return (
<Tr
borderBottomWidth={3}
borderBottomColor="gray.200"
position="relative"
>
<Td
Expand Down
4 changes: 2 additions & 2 deletions airflow/www/static/js/grid/details/content/Dag.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const Dag = () => {
<Tbody>
{durations.length > 0 && (
<>
<Tr borderBottomWidth={2} borderBottomColor="gray.300" borderBottomStyle="solid">
<Tr borderBottomWidth={2} borderBottomColor="gray.300">
<Td><Heading size="sm">DAG Runs Summary</Heading></Td>
<Td />
</Tr>
Expand Down Expand Up @@ -142,7 +142,7 @@ const Dag = () => {
</Tr>
</>
)}
<Tr borderBottomWidth={2} borderBottomColor="gray.300" borderBottomStyle="solid">
<Tr borderBottomWidth={2} borderBottomColor="gray.300">
<Td>
<Heading size="sm">DAG Summary</Heading>
</Td>
Expand Down
18 changes: 5 additions & 13 deletions airflow/www/static/js/grid/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@
/* global document */

import React from 'react';
import ReactDOM from 'react-dom';
import { createRoot } from 'react-dom/client';
import { BrowserRouter } from 'react-router-dom';
import { ChakraProvider, extendTheme } from '@chakra-ui/react';
import { ChakraProvider } from '@chakra-ui/react';
import { CacheProvider } from '@emotion/react';
import createCache from '@emotion/cache';
import { QueryClient, QueryClientProvider } from 'react-query';

import Main from './Main';
import theme from './theme';
import { ContainerRefProvider } from './context/containerRef';
import { TimezoneProvider } from './context/timezone';
import { AutoRefreshProvider } from './context/autorefresh';
Expand Down Expand Up @@ -60,16 +61,6 @@ const queryClient = new QueryClient({
},
});

const theme = extendTheme({
components: {
Tooltip: {
baseStyle: {
fontSize: 'md',
},
},
},
});

function App() {
return (
<React.StrictMode>
Expand All @@ -92,4 +83,5 @@ function App() {
);
}

ReactDOM.render(<App />, mainElement);
const reactRoot = createRoot(mainElement);
reactRoot.render(<App />);
39 changes: 39 additions & 0 deletions airflow/www/static/js/grid/theme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*!
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { extendTheme } from '@chakra-ui/react';

const theme = extendTheme({
styles: {
global: {
'*, *::before, &::after': {
borderColor: 'gray.200',
},
},
},
components: {
Tooltip: {
baseStyle: {
fontSize: 'md',
},
},
},
});

export default theme;
Loading

0 comments on commit 2b70877

Please sign in to comment.