Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor js file structure #25003

Merged
merged 8 commits into from
Jul 13, 2022
Merged

Conversation

bbovenzi
Copy link
Contributor

We are going to reactify more of the UI.

  1. the datasets UI will be in react so it should share code/config with the existing grid view
  2. the grid view is going to take on more responsibility with logs, and a graph. It will eventually necome the entire DAG view so the name should reflect that.

inside of js/dag is code relevant to just the grid view split between the grid itself and the details panel
context, components, theme, api will all be shared between however many react pages we create.


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

Update jest, webpack and ts config files to allow for two aliased paths:
`app` = `static/js`
`grid` = `static/js/grid`
get ready for graph view in grid and other react pages like datasets and dag dependencies
@boring-cyborg boring-cyborg bot added area:dev-tools area:UI Related to UI/UX. For Frontend Developers. area:webserver Webserver related Issues labels Jul 12, 2022
@@ -26,8 +26,7 @@ const config = {
setupFilesAfterEnv: ['./jest-setup.js'],
moduleDirectories: ['node_modules'],
moduleNameMapper: { // Listing all aliases
'^app/(.*)$': '<rootDir>/static/js/$1',
'^grid/(.*)$': '<rootDir>/static/js/grid/$1',
'^src/(.*)$': '<rootDir>/static/js/$1',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

src made more sense than app

@@ -17,32 +17,22 @@
* under the License.
*/

/* global document */
/*
Base setup for anywhere we add react to the UI
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will reuse App for datasets and other reactified pages

@@ -22,7 +22,7 @@ import { Button, useDisclosure } from '@chakra-ui/react';

import { useMarkFailedRun } from '../../../api';
import ConfirmDialog from '../ConfirmDialog';
import { getMetaValue } from '../../../../utils';
import { getMetaValue } from '../../../utils';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a later PR I will update more js/jsx files to typescript so we can remove more relative paths. I was having issues getting relative paths for js and ts to play nicely in our existing webpack configuration.

@@ -73,7 +73,7 @@ const config = {
task: `${JS_DIR}/task.js`,
taskInstances: `${JS_DIR}/task_instances.js`,
tiLog: `${JS_DIR}/ti_log.js`,
grid: [`${JS_DIR}/grid/index.jsx`],
grid: `${JS_DIR}/dag/index.tsx`,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This key should stay as grid?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since we still have dag.js, I figured yes.

airflow/www/static/js/App.tsx Outdated Show resolved Hide resolved
airflow/www/static/js/App.tsx Outdated Show resolved Hide resolved
@bbovenzi bbovenzi merged commit 26175ee into apache:main Jul 13, 2022
@bbovenzi bbovenzi deleted the refactor-js-file-structure branch July 13, 2022 18:04
@bbovenzi bbovenzi added this to the Airflow 2.4.0 milestone Jul 13, 2022
@ephraimbuddy ephraimbuddy added the type:misc/internal Changelog: Misc changes that should appear in change log label Aug 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:dev-tools area:UI Related to UI/UX. For Frontend Developers. area:webserver Webserver related Issues type:misc/internal Changelog: Misc changes that should appear in change log
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants