You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/04/27 17:25:28 UTC

[GitHub] [airflow] bbovenzi opened a new pull request, #23290: Store grid view selection in url params

bbovenzi opened a new pull request, #23290:
URL: https://github.com/apache/airflow/pull/23290

   Store the selected dag run and task instance with `dag_run_id` and `task_id` url params for Grid view.
   
   This allowed us to simplify `useSelection` to no longer need useContext. Then I moved some non-components from `/tree` to `/tree/utils`
   
   ---
   **^ Add meaningful description above**
   
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
   In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in a newsfragement file, named `{pr_number}.significant.rst`, in [newsfragments](https://github.com/apache/airflow/tree/main/newsfragments).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] staufferl16 commented on a diff in pull request #23290: Store grid view selection in url params

Posted by GitBox <gi...@apache.org>.
staufferl16 commented on code in PR #23290:
URL: https://github.com/apache/airflow/pull/23290#discussion_r860168119


##########
airflow/www/static/js/tree/api/useTasks.js:
##########
@@ -27,5 +27,8 @@ export default function useTasks(dagId) {
   return useQuery(
     ['tasks', dagId],
     () => axios.get(tasksUrl),
+    {
+      placeholderData: { tasks: [] },

Review Comment:
   Is this argument a default return value for the `useQuery` function?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] bbovenzi commented on pull request #23290: Store grid view selection in url params

Posted by GitBox <gi...@apache.org>.
bbovenzi commented on PR #23290:
URL: https://github.com/apache/airflow/pull/23290#issuecomment-1111371191

   CC: @staufferl16 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] ashb commented on a diff in pull request #23290: Store grid view selection in url params

Posted by GitBox <gi...@apache.org>.
ashb commented on code in PR #23290:
URL: https://github.com/apache/airflow/pull/23290#discussion_r861695004


##########
airflow/www/static/js/tree/dagRuns/index.test.jsx:
##########
@@ -42,13 +42,13 @@ const Wrapper = ({ children }) => {
           <ContainerRefProvider value={{}}>
             <TimezoneProvider value={{ timezone: 'UTC' }}>
               <AutoRefreshProvider value={{ isRefreshOn: false, stopRefresh: () => {} }}>
-                <SelectionProvider value={{ onSelect: () => {}, selected: {} }}>
+                <MemoryRouter>

Review Comment:
   Oh. This is a `test.jsx` :D 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] bbovenzi commented on a diff in pull request #23290: Store grid view selection in url params

Posted by GitBox <gi...@apache.org>.
bbovenzi commented on code in PR #23290:
URL: https://github.com/apache/airflow/pull/23290#discussion_r861825371


##########
airflow/www/static/js/tree/dagRuns/index.test.jsx:
##########
@@ -42,13 +42,13 @@ const Wrapper = ({ children }) => {
           <ContainerRefProvider value={{}}>
             <TimezoneProvider value={{ timezone: 'UTC' }}>
               <AutoRefreshProvider value={{ isRefreshOn: false, stopRefresh: () => {} }}>
-                <SelectionProvider value={{ onSelect: () => {}, selected: {} }}>
+                <MemoryRouter>

Review Comment:
   Yes, tests aren't run on an actual browser so we use a different router.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] bbovenzi merged pull request #23290: Store grid view selection in url params

Posted by GitBox <gi...@apache.org>.
bbovenzi merged PR #23290:
URL: https://github.com/apache/airflow/pull/23290


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] bbovenzi commented on a diff in pull request #23290: Store grid view selection in url params

Posted by GitBox <gi...@apache.org>.
bbovenzi commented on code in PR #23290:
URL: https://github.com/apache/airflow/pull/23290#discussion_r860181096


##########
airflow/www/static/js/tree/api/useTasks.js:
##########
@@ -27,5 +27,8 @@ export default function useTasks(dagId) {
   return useQuery(
     ['tasks', dagId],
     () => axios.get(tasksUrl),
+    {
+      placeholderData: { tasks: [] },

Review Comment:
   Yes, but it doesn't affect the cache https://react-query.tanstack.com/guides/placeholder-query-data



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] github-actions[bot] commented on pull request #23290: Store grid view selection in url params

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #23290:
URL: https://github.com/apache/airflow/pull/23290#issuecomment-1113169488

   The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest main or amend the last commit of the PR, and push it with --force-with-lease.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] ashb commented on a diff in pull request #23290: Store grid view selection in url params

Posted by GitBox <gi...@apache.org>.
ashb commented on code in PR #23290:
URL: https://github.com/apache/airflow/pull/23290#discussion_r861694666


##########
airflow/www/static/js/tree/dagRuns/index.test.jsx:
##########
@@ -42,13 +42,13 @@ const Wrapper = ({ children }) => {
           <ContainerRefProvider value={{}}>
             <TimezoneProvider value={{ timezone: 'UTC' }}>
               <AutoRefreshProvider value={{ isRefreshOn: false, stopRefresh: () => {} }}>
-                <SelectionProvider value={{ onSelect: () => {}, selected: {} }}>
+                <MemoryRouter>

Review Comment:
   Why do we use MemoryRouter here but BrowserRouter elsewhere?
   
   Does MemoryRouter mean that components here don't change the URL, right?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org