tirkarthi commented on code in PR #51541: URL: https://github.com/apache/airflow/pull/51541#discussion_r2137933397
########## airflow-core/src/airflow/ui/src/components/DagActions/inlineMessage.tsx: ########## @@ -22,11 +22,11 @@ import type { TFunction } from "i18next"; export const getInlineMessage = (isPendingDryRun: boolean, totalEntries: number, translate: TFunction) => isPendingDryRun ? ( <Skeleton height="20px" width="100px" /> - ) : totalEntries > 1 ? ( + ) : totalEntries === 1 ? ( <Text color="fg.success" fontSize="sm"> {translate("backfill.affectedOne")} </Text> - ) : totalEntries > 0 ? ( + ) : totalEntries > 1 ? ( <Text color="fg.success" fontSize="sm"> {translate("backfill.affectedMultiple", { count: totalEntries })} Review Comment: Sorry, I don't get the comment. Are you referring to something like below to have a part for no entries and then merge the logic for entries > 0 to use the relevant key? ```diff diff --git a/airflow-core/src/airflow/ui/src/components/DagActions/inlineMessage.tsx b/airflow-core/src/airflow/ui/src/components/DagActions/inlineMessage.tsx index f6e4deb12f..bee1763406 100644 --- a/airflow-core/src/airflow/ui/src/components/DagActions/inlineMessage.tsx +++ b/airflow-core/src/airflow/ui/src/components/DagActions/inlineMessage.tsx @@ -22,16 +22,14 @@ import type { TFunction } from "i18next"; export const getInlineMessage = (isPendingDryRun: boolean, totalEntries: number, translate: TFunction) => isPendingDryRun ? ( <Skeleton height="20px" width="100px" /> - ) : totalEntries > 1 ? ( - <Text color="fg.success" fontSize="sm"> - {translate("backfill.affectedOne")} - </Text> - ) : totalEntries > 0 ? ( - <Text color="fg.success" fontSize="sm"> - {translate("backfill.affectedMultiple", { count: totalEntries })} - </Text> - ) : ( + ) : totalEntries === 0 ? ( <Text color="fg.error" fontSize="sm" fontWeight="medium"> {translate("backfill.affectedNone")} </Text> + ) : ( + <Text color="fg.success" fontSize="sm"> + {translate(totalEntries > 1 ? "backfill.affectedMultiple" : "backfill.affectedOne", { + count: totalEntries, + })} + </Text> ); ``` -- 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