Skip to content

Commit decaaa3

Browse files
authored
Fix mappedStates case (apache#30916)
* Fix mappedStates case * remove stray console log
1 parent 014031a commit decaaa3

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

airflow/www/static/js/dag/InstanceTooltip.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import React from "react";
2121
import { Box, Text } from "@chakra-ui/react";
22+
import { snakeCase } from "lodash";
2223

2324
import { getGroupAndMapSummary } from "src/utils";
2425
import { formatDuration, getDuration } from "src/datetime_utils";
@@ -46,11 +47,11 @@ const InstanceTooltip = ({
4647
});
4748

4849
childTaskMap.forEach((key, val) => {
50+
const childState = snakeCase(val);
4951
if (key > 0) {
5052
summary.push(
51-
// eslint-disable-next-line react/no-array-index-key
52-
<Text key={val} ml="10px">
53-
{val}
53+
<Text key={childState} ml="10px">
54+
{childState}
5455
{": "}
5556
{key}
5657
</Text>

airflow/www/static/js/dag/details/taskInstance/Details.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import React from "react";
2121
import { Text, Flex, Table, Tbody, Tr, Td, Divider } from "@chakra-ui/react";
22+
import { snakeCase } from "lodash";
2223

2324
import { getGroupAndMapSummary } from "src/utils";
2425
import { getDuration, formatDuration } from "src/datetime_utils";
@@ -59,15 +60,15 @@ const Details = ({ instance, group, dagId }: Props) => {
5960
});
6061

6162
childTaskMap.forEach((key, val) => {
63+
const childState = snakeCase(val);
6264
if (key > 0) {
6365
summary.push(
64-
// eslint-disable-next-line react/no-array-index-key
65-
<Tr key={val}>
66+
<Tr key={childState}>
6667
<Td />
6768
<Td>
6869
<Flex alignItems="center">
69-
<SimpleStatus state={val as TaskState} mx={2} />
70-
{val}
70+
<SimpleStatus state={childState as TaskState} mx={2} />
71+
{childState}
7172
{": "}
7273
{key}
7374
</Flex>

0 commit comments

Comments
 (0)