bbovenzi commented on code in PR #46939:
URL: https://github.com/apache/airflow/pull/46939#discussion_r1970517739
##########
airflow/ui/src/pages/Run/Header.tsx:
##########
@@ -36,44 +34,39 @@ export const Header = ({
readonly dagRun: DAGRunResponse;
readonly isRefreshing?: boolean;
}) => (
- <Box borderColor="border" borderRadius={8} borderWidth={1} p={2}>
- <Flex alignItems="center" justifyContent="space-between" mb={2}>
- <HStack alignItems="center" gap={2}>
- <FiBarChart size="1.75rem" />
- <Heading size="lg">
- <strong>Run: </strong>
- {dagRun.dag_run_id}
- </Heading>
- <StateBadge state={dagRun.state}>{dagRun.state}</StateBadge>
- {isRefreshing ? <Spinner /> : <div />}
- </HStack>
- <HStack>
- {dagRun.note === null || dagRun.note.length === 0 ? undefined : (
- <DisplayMarkdownButton
- header="Dag Run Note"
- icon={<FiMessageSquare color="black" />}
- mdContent={dagRun.note}
- text="Note"
- />
- )}
+ <HeaderCard
+ actions={
+ <>
<ClearRunButton dagRun={dagRun} />
<MarkRunAsButton dagRun={dagRun} />
- </HStack>
- </Flex>
- <SimpleGrid columns={4} gap={4}>
- <Stat label="Run Type">
- <HStack>
- <RunTypeIcon runType={dagRun.run_type} />
- <Text>{dagRun.run_type}</Text>
- </HStack>
- </Stat>
- <Stat label="Start">
- <Time datetime={dagRun.start_date} />
- </Stat>
- <Stat label="End">
- <Time datetime={dagRun.end_date} />
- </Stat>
- <Stat label="Duration">{getDuration(dagRun.start_date,
dagRun.end_date)}s</Stat>
- </SimpleGrid>
- </Box>
+ </>
+ }
+ icon={<FiBarChart />}
+ isRefreshing={isRefreshing}
+ note={dagRun.note}
+ state={dagRun.state}
+ stats={[
+ ...(dagRun.logical_date === null
+ ? []
+ : [
+ {
+ label: "Logical Date",
+ value: <Time datetime={dagRun.logical_date} />,
+ },
+ ]),
+ {
+ label: "Run Type",
+ value: (
+ <HStack>
+ <RunTypeIcon runType={dagRun.run_type} />
+ <Text>{dagRun.run_type}</Text>
+ </HStack>
+ ),
+ },
+ { label: "Start", value: <Time datetime={dagRun.start_date} /> },
+ { label: "End", value: <Time datetime={dagRun.end_date} /> },
+ { label: "Duration", value: `${getDuration(dagRun.start_date,
dagRun.end_date)}s` },
Review Comment:
Will update in a later pr
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]