bbovenzi commented on code in PR #46968:
URL: https://github.com/apache/airflow/pull/46968#discussion_r1966023512
##########
airflow/ui/src/pages/TaskInstances.tsx:
##########
@@ -141,18 +143,24 @@ const taskInstanceColumns = (
},
];
-const STATE_PARAM = "state";
-
export const TaskInstances = () => {
const { dagId, runId, taskId } = useParams();
const [searchParams, setSearchParams] = useSearchParams();
const { setTableURLState, tableURLState } = useTableURLState();
const { pagination, sorting } = tableURLState;
const [sort] = sorting;
const orderBy = sort ? `${sort.desc ? "-" : ""}${sort.id}` : "-start_date";
+ const {
+ END_DATE: END_DATE_PARAM,
+ NAME_PATTERN: NAME_PATTERN_PARAM,
+ START_DATE: START_DATE_PARAM,
+ STATE: STATE_PARAM,
+ }: SearchParamsKeysType = SearchParamsKeys;
Review Comment:
Again, let's move this outside of the component itself
##########
airflow/ui/src/pages/Dashboard/HistoricalMetrics/MetricSection.tsx:
##########
@@ -42,9 +45,11 @@ export const MetricSection = ({ runs, state, total }:
MetricSectionProps) => {
<VStack align="left" gap={1} mb={4} ml={0} pl={0}>
<Flex justify="space-between">
<HStack>
- <StateBadge fontSize="md" state={state}>
- {runs}
- </StateBadge>
+ <Link
href={`/webapp/${kind}?state=${state}&start_date=${startDate}&end_date=${endDate}`}>
Review Comment:
Let's use the Link from react-router-dom so that we don't have to hardcode
`/webapp/` If we want the link to be styled like chakra, we just wrap the
RouterLink with the chakra one and pass the param `asChild` (look at our
TaskInstances and DagRuns pages for examples`
##########
airflow/ui/src/pages/DagRuns.tsx:
##########
@@ -118,17 +117,26 @@ export const DagRuns = () => {
const { pagination, sorting } = tableURLState;
const [sort] = sorting;
const orderBy = sort ? `${sort.desc ? "-" : ""}${sort.id}` : "-run_after";
+ const {
+ END_DATE: END_DATE_PARAM,
+ START_DATE: START_DATE_PARAM,
+ STATE: STATE_PARAM,
+ }: SearchParamsKeysType = SearchParamsKeys;
Review Comment:
We can declare this outside of the component so we don't redeclare it every
time the component mounts.
##########
airflow/ui/src/pages/DagRuns.tsx:
##########
@@ -154,7 +162,7 @@ export const DagRuns = () => {
});
setSearchParams(searchParams);
},
- [pagination, searchParams, setSearchParams, setTableURLState, sorting],
+ [pagination, searchParams, setSearchParams, setTableURLState, sorting,
STATE_PARAM],
Review Comment:
If we do the above comment then we don't need STATE_PARAM here
--
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]