This is an automated email from the ASF dual-hosted git repository.

pierrejeambrun pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 3535bcd6f61 Fix asset events table title (#51658)
3535bcd6f61 is described below

commit 3535bcd6f611c3540d3790a65cc4e5d887bd8ea2
Author: Pierre Jeambrun <pierrejb...@gmail.com>
AuthorDate: Thu Jun 12 17:39:25 2025 +0200

    Fix asset events table title (#51658)
    
    * Fix asset events table title
    
    * Handle plural
---
 airflow-core/src/airflow/ui/src/components/Assets/AssetEvents.tsx | 8 ++++----
 airflow-core/src/airflow/ui/src/i18n/locales/en/common.json       | 4 ++++
 airflow-core/src/airflow/ui/src/i18n/locales/en/dag.json          | 3 ++-
 airflow-core/src/airflow/ui/src/pages/Dag/Overview/Overview.tsx   | 2 +-
 airflow-core/src/airflow/ui/src/pages/Run/AssetEvents.tsx         | 2 +-
 .../src/airflow/ui/src/pages/TaskInstance/AssetEvents.tsx         | 4 +++-
 6 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/airflow-core/src/airflow/ui/src/components/Assets/AssetEvents.tsx 
b/airflow-core/src/airflow/ui/src/components/Assets/AssetEvents.tsx
index 9950c982e01..8ba4b581336 100644
--- a/airflow-core/src/airflow/ui/src/components/Assets/AssetEvents.tsx
+++ b/airflow-core/src/airflow/ui/src/components/Assets/AssetEvents.tsx
@@ -44,7 +44,7 @@ type AssetEventProps = {
   readonly setOrderBy?: (order: string) => void;
   readonly setTableUrlState?: (state: TableState) => void;
   readonly tableUrlState?: TableState;
-  readonly title?: string;
+  readonly titleKey?: string;
 };
 
 export const AssetEvents = ({
@@ -54,10 +54,10 @@ export const AssetEvents = ({
   setOrderBy,
   setTableUrlState,
   tableUrlState,
-  title,
+  titleKey,
   ...rest
 }: AssetEventProps & BoxProps) => {
-  const { t: translate } = useTranslation(["dashboard", "common"]);
+  const { t: translate } = useTranslation(["dashboard", "common", "dag"]);
   const assetSortOptions = createListCollection({
     items: [
       { label: translate("sortBy.newestFirst"), value: "-timestamp" },
@@ -74,7 +74,7 @@ export const AssetEvents = ({
             {data?.total_entries ?? " "}
           </StateBadge>
           <Heading marginEnd="auto" size="md">
-            {translate("common:assetEvent", { count: data?.total_entries ?? 0 
})}
+            {translate(titleKey ?? "common:assetEvent", { count: 
data?.total_entries ?? 0 })}
           </Heading>
         </HStack>
         {setOrderBy === undefined ? undefined : (
diff --git a/airflow-core/src/airflow/ui/src/i18n/locales/en/common.json 
b/airflow-core/src/airflow/ui/src/i18n/locales/en/common.json
index cc6cd97fe12..8908acf24e5 100644
--- a/airflow-core/src/airflow/ui/src/i18n/locales/en/common.json
+++ b/airflow-core/src/airflow/ui/src/i18n/locales/en/common.json
@@ -17,6 +17,8 @@
     "auditLog": "Audit Log",
     "xcoms": "XComs"
   },
+  "createdAssetEvent_one": "Created Asset Event",
+  "createdAssetEvent_other": "Created Asset Events",
   "dag_one": "Dag",
   "dag_other": "Dags",
   "dagDetails": {
@@ -127,6 +129,8 @@
     "users": "Users"
   },
   "selectLanguage": "Select Language",
+  "sourceAssetEvent_one": "Source Asset Event",
+  "sourceAssetEvent_other": "Source Asset Events",
   "startDate": "Start Date",
   "state": "State",
   "states": {
diff --git a/airflow-core/src/airflow/ui/src/i18n/locales/en/dag.json 
b/airflow-core/src/airflow/ui/src/i18n/locales/en/dag.json
index 0c840d245cd..4e94582a22d 100644
--- a/airflow-core/src/airflow/ui/src/i18n/locales/en/dag.json
+++ b/airflow-core/src/airflow/ui/src/i18n/locales/en/dag.json
@@ -24,7 +24,8 @@
       "failedTask_other": "Failed Tasks"
     },
     "charts": {
-      "assetEvent": "Created Asset Event"
+      "assetEvent_one": "Created Asset Event",
+      "assetEvent_other": "Created Asset Events"
     },
     "failedLogs": {
       "title": "Recent Failed Task Logs",
diff --git a/airflow-core/src/airflow/ui/src/pages/Dag/Overview/Overview.tsx 
b/airflow-core/src/airflow/ui/src/pages/Dag/Overview/Overview.tsx
index faeec065e0f..20e6126de6a 100644
--- a/airflow-core/src/airflow/ui/src/pages/Dag/Overview/Overview.tsx
+++ b/airflow-core/src/airflow/ui/src/pages/Dag/Overview/Overview.tsx
@@ -142,7 +142,7 @@ export const Overview = () => {
             isLoading={isLoadingAssetEvents}
             ml={0}
             setOrderBy={setAssetSortBy}
-            title={translate("overview.charts.assetEvent")}
+            titleKey="dag:overview.charts.assetEvent"
           />
         ) : undefined}
       </HStack>
diff --git a/airflow-core/src/airflow/ui/src/pages/Run/AssetEvents.tsx 
b/airflow-core/src/airflow/ui/src/pages/Run/AssetEvents.tsx
index c7fd536b950..4d2493c5c1a 100644
--- a/airflow-core/src/airflow/ui/src/pages/Run/AssetEvents.tsx
+++ b/airflow-core/src/airflow/ui/src/pages/Run/AssetEvents.tsx
@@ -41,5 +41,5 @@ export const AssetEvents = () => {
     refetchInterval: () => (isStatePending(dagRun?.state) ? refetchInterval : 
false),
   });
 
-  return <AssetEventsTable data={data} isLoading={isLoading} title="Source 
Asset Event" />;
+  return <AssetEventsTable data={data} isLoading={isLoading} 
titleKey="common:sourceAssetEvent" />;
 };
diff --git a/airflow-core/src/airflow/ui/src/pages/TaskInstance/AssetEvents.tsx 
b/airflow-core/src/airflow/ui/src/pages/TaskInstance/AssetEvents.tsx
index d5917aa8aab..56081790d32 100644
--- a/airflow-core/src/airflow/ui/src/pages/TaskInstance/AssetEvents.tsx
+++ b/airflow-core/src/airflow/ui/src/pages/TaskInstance/AssetEvents.tsx
@@ -47,5 +47,7 @@ export const AssetEvents = () => {
     },
   );
 
-  return <AssetEventsTable data={assetEventsData} isLoading={isLoading} 
title="Created Asset Event" />;
+  return (
+    <AssetEventsTable data={assetEventsData} isLoading={isLoading} 
titleKey="common:createdAssetEvent" />
+  );
 };

Reply via email to