This is an automated email from the ASF dual-hosted git repository.
betodealmeida pushed a commit to branch semantic-view-dashboard-filters
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to
refs/heads/semantic-view-dashboard-filters by this push:
new 2f2091122ee Fix label
2f2091122ee is described below
commit 2f2091122ee8043812975b9fe22328bfb0972475
Author: Beto Dealmeida <[email protected]>
AuthorDate: Wed May 27 14:37:46 2026 -0400
Fix label
---
.../src/features/datasets/DatasetSelectLabel/index.tsx | 14 +++++++-------
superset-frontend/src/features/semanticLayers/label.ts | 12 ++++++++++++
2 files changed, 19 insertions(+), 7 deletions(-)
diff --git
a/superset-frontend/src/features/datasets/DatasetSelectLabel/index.tsx
b/superset-frontend/src/features/datasets/DatasetSelectLabel/index.tsx
index f93acd5391e..40ed2f38986 100644
--- a/superset-frontend/src/features/datasets/DatasetSelectLabel/index.tsx
+++ b/superset-frontend/src/features/datasets/DatasetSelectLabel/index.tsx
@@ -19,6 +19,7 @@
import { Tooltip } from '@superset-ui/core/components';
import { t } from '@apache-superset/core/translation';
import { styled } from '@apache-superset/core/theme';
+import { parentLabelLower } from 'src/features/semanticLayers/label';
type Database = {
database_name: string;
@@ -104,14 +105,13 @@ export const DatasetSelectLabel = (item: Dataset) => (
</div>
<div className="tooltip-description">
<div>
- {t('Database')}: {item.database.database_name}
- </div>
- <div>
- {t('Schema')}:{' '}
- {item.schema && isValidValue(item.schema)
- ? item.schema
- : t('Not defined')}
+ {parentLabelLower(item.kind)}: {item.database.database_name}
</div>
+ {item.schema && isValidValue(item.schema) &&
+ <div>
+ {t('Schema')}:{' '}{item.schema}
+ </div>
+ }
</div>
</TooltipContent>
}
diff --git a/superset-frontend/src/features/semanticLayers/label.ts
b/superset-frontend/src/features/semanticLayers/label.ts
index 1788f5c9f37..6411fbd39dc 100644
--- a/superset-frontend/src/features/semanticLayers/label.ts
+++ b/superset-frontend/src/features/semanticLayers/label.ts
@@ -63,3 +63,15 @@ export const databasesLabel = () => sl(t('Databases'),
t('Data connections'));
/** Lower-case plural: "databases" / "data connections" */
export const databasesLabelLower = () =>
sl(t('databases'), t('data connections'));
+
+// ---------------------------------------------------------------------------
+// Per-datasource parent label
+// ---------------------------------------------------------------------------
+
+/**
+ * Returns the label for the parent of a datasource: "database" for datasets,
+ * "semantic layer" for semantic views. Pass the `kind` field from the
+ * combined datasource list response.
+ */
+export const parentLabelLower = (kind?: string) =>
+ kind === 'semantic_view' ? t('semantic layer') : t('database');