You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "bbovenzi (via GitHub)" <gi...@apache.org> on 2023/02/13 16:56:35 UTC

[GitHub] [airflow] bbovenzi commented on a diff in pull request #29413: Add a new graph inside of the grid view

bbovenzi commented on code in PR #29413:
URL: https://github.com/apache/airflow/pull/29413#discussion_r1104764231


##########
airflow/www/static/js/dag/details/index.tsx:
##########
@@ -17,23 +17,89 @@
  * under the License.
  */
 
-import React from 'react';
+import React, { useEffect, useState } from 'react';
 import {
   Flex,
-  Box,
   Divider,
+  Tabs,
+  TabList,
+  TabPanel,
+  TabPanels,
+  Tab,
+  Text,
 } from '@chakra-ui/react';
+import { useSearchParams } from 'react-router-dom';
 
 import useSelection from 'src/dag/useSelection';
+import URLSearchParamsWrapper from 'src/utils/URLSearchParamWrapper';
+import { getTask, getMetaValue } from 'src/utils';
+import { useGridData, useTaskInstance } from 'src/api';
 
 import Header from './Header';
 import TaskInstanceContent from './taskInstance';
 import DagRunContent from './dagRun';
 import DagContent from './Dag';
+import Graph from './graph';
+import MappedInstances from './taskInstance/MappedInstances';
+import Logs from './taskInstance/Logs';
+import BackToTaskSummary from './taskInstance/BackToTaskSummary';
 
-const Details = () => {
+const SHOW_GRAPH_PARAM = 'show_graph';
+const dagId = getMetaValue('dag_id')!;
+
+interface Props {
+  openGroupIds: string[];
+  onToggleGroups: (groupIds: string[]) => void;
+}
+
+const Details = ({ openGroupIds, onToggleGroups }: Props) => {
   const { selected: { runId, taskId, mapIndex }, onSelect } = useSelection();
 
+  const [searchParams, setSearchParams] = useSearchParams();
+  const showGraph = !!searchParams.get(SHOW_GRAPH_PARAM);
+  const [tabIndex, setTabIndex] = useState(showGraph ? 1 : 0);
+
+  // TODO: restore preferred tab index logic

Review Comment:
   I'll do this as a follow up with moving task actions to a modal so they can be accessed from all tabs



-- 
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