RoyLee1224 commented on code in PR #50626:
URL: https://github.com/apache/airflow/pull/50626#discussion_r2093669109


##########
airflow-core/src/airflow/ui/src/pages/Dashboard/HistoricalMetrics/TaskInstanceMetrics.tsx:
##########
@@ -53,36 +54,40 @@ export const TaskInstanceMetrics = ({
   startDate,
   taskInstanceStates,
   total,
-}: TaskInstanceMetricsProps) => (
-  <Box borderRadius={5} borderWidth={1} mt={2} p={4}>
-    <HStack>
-      <RouterLink
-        to={`/task_instances?start_date=${startDate}${endDate === undefined ? 
"" : `&end_date=${endDate}`}`}
-      >
-        <StateBadge colorPalette="blue" fontSize="md" variant="solid">
-          <MdOutlineTask />
-          {total}
-        </StateBadge>
-      </RouterLink>
-      <Heading size="md">Task Instances</Heading>
-    </HStack>
-    <Separator my={3} />
-    <Stack gap={4}>
-      {TASK_STATES.sort((stateA, stateB) =>
-        taskInstanceStates[stateA] > taskInstanceStates[stateB] ? -1 : 1,
-      ).map((state) =>
-        taskInstanceStates[state] > 0 ? (
-          <MetricSection
-            endDate={endDate}
-            key={state}
-            kind="task_instances"
-            runs={taskInstanceStates[state]}
-            startDate={startDate}
-            state={state as TaskInstanceState}
-            total={total}
-          />
-        ) : undefined,
-      )}
-    </Stack>
-  </Box>
-);
+}: TaskInstanceMetricsProps) => {
+  const { t: translate } = useTranslation("dashboard");
+
+  return (
+    <Box borderRadius={5} borderWidth={1} mt={2} p={4}>
+      <HStack>
+        <RouterLink
+          to={`/task_instances?start_date=${startDate}${endDate === undefined 
? "" : `&end_date=${endDate}`}`}
+        >
+          <StateBadge colorPalette="blue" fontSize="md" variant="solid">
+            <MdOutlineTask />
+            {total}
+          </StateBadge>
+        </RouterLink>
+        <Heading size="md">{translate("taskInstances", { count: total 
})}</Heading>

Review Comment:
   Oops, let me fix it.
   I'll try `taskInstance_one`, `taskInstance_other` as keys.
   And I will implement this pluralize logic to Dag Run(s) and Asset Event(s) 
as well.



-- 
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-unsubscr...@airflow.apache.org

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

Reply via email to