-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add details drawer to Grid View (#22123)
* make UI and tree work with mapped tasks basic slide drawer reformat grid background colors improve rendering and add selected dag run fix hover and extra prop switch from drawer to details section add tooltip info to details use API make side panel collapsible, useTasks, dag run actions dag run actions w/ react-query task instance links task actions remove modals adjust panel width and use status color minor details styling add duration to tooltips add last scheduling decision and fix tests * move ref and selection to providers * fix test with mock providers * update TI and DR buttons * download logs and external logs * add extra links to TI details * download log bug fixes * fix extra links, hide local TZ if UTC, * confirm mark task failed/success * Update confirm modals for runs and tasks - async/await on mutations instead of useeffect - add confirmation for run actions * Fix dialog scrolling * Code cleanup and fix task clear * Fix task/run label, dialog focus, dag details overflow, panel open/close * Add timezone provider * Fix TimezoneEvent import * Improve button UX - Remove details panel title - Add button to reset root - Make "More Details" buttons more specific - Specify timezone as DAG timezone * autorefresh dag run details * auto-refresh task instance details * revert useTreeData changes None of these changes were relevant to this PR. Better to be done separately. * Address PR feedback - useState vs useDisclosure - Remove extraneous elements - Copy changes - Wire up params for runTask - Breadcrumb padding * Handle task/run action sideeffects by separating autorefresh and treeData hooks * Clean up views.py endpoints - Pass 'Accept' headers for json returns - Consolidate more endpoints to return json or redirect * pass request as arg * remove request as arg * Anticipate when the 'Accept' header is not present * Fix argument count errors * Replace hard coded urls * Replace hard coded urls in react components * Update filter upstream link * Split TaskInstance details component * Fix undefined variables in tests * init_api_connexion in tests - add readme - rename context providers to avoid confusion with Airflow Providers * Fix url params, hide last item breadcrumb links * Update task run failed copy * Fix taskinstance/list buttons Co-authored-by: Tzu-ping Chung <tp@astronomer.io> GitOrigin-RevId: 2bb26a38070a4b949bfb210ef1d5644e016e373a
- Loading branch information
1 parent
c8145fb
commit 25788e7
Showing
64 changed files
with
3,419 additions
and
578 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<!-- | ||
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. | ||
--> | ||
|
||
# Grid View | ||
|
||
In 2.3.0 the Tree view was completely rebuilt using React and renamed to Grid. Here is a primer on the new technologies used: | ||
|
||
## [React](https://reactjs.org/) | ||
|
||
The most popular javascript framework for building user interfaces with reusable components. | ||
Written as javascript and html together in `.jsx` files. | ||
In-component state can be managed via `useState()`, application state that spans many components can be managed via a context provider (see `/context` for examples), API state can be managed by React Query (see below) | ||
|
||
|
||
## [Chakra UI](https://chakra-ui.com/) | ||
|
||
A good component and helper function library. Tooltips, modals, toasts, switches, etc are all out of the box | ||
Styles are applied via global theme when initializing the app or inline with individual components like `<Box padding="5px" />` | ||
|
||
|
||
## [React Query](https://react-query.tanstack.com/) | ||
|
||
A powerful async data handler that makes it easy to manage loading/error states as well as caching, refetching, background updates, etc. | ||
This is our state management for any data that comes from an API. | ||
Each API request is its own hook. Ie `useTasks` will get all the tasks for a DAG | ||
|
||
|
||
## [React Testing Library](https://testing-library.com/docs/react-testing-library/intro/) | ||
|
||
Easily write tests for react components and hooks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/*! | ||
* 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 React from 'react'; | ||
import { Button, Link } from '@chakra-ui/react'; | ||
|
||
import { getMetaValue } from '../utils'; | ||
|
||
const root = getMetaValue('root'); | ||
const url = getMetaValue('grid_url_no_root'); | ||
|
||
const ResetRoot = () => ( | ||
root | ||
? ( | ||
<Button | ||
as={Link} | ||
variant="outline" | ||
href={url} | ||
colorScheme="blue" | ||
mr={2} | ||
title="Reset root to show the whole DAG" | ||
> | ||
Reset Root | ||
</Button> | ||
) | ||
: null | ||
); | ||
|
||
export default ResetRoot; |
Oops, something went wrong.