You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ly...@apache.org on 2023/01/05 21:58:16 UTC
[superset] 03/07: Create dataset polish/bug fix
This is an automated email from the ASF dual-hosted git repository.
lyndsi pushed a commit to branch lyndsi/enable-dataset-creation
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 3981b7d60a2cf7f79f1cc43864e6a1fc55b22d6a
Author: lyndsiWilliams <kc...@gmail.com>
AuthorDate: Tue Nov 29 10:02:33 2022 -0600
Create dataset polish/bug fix
---
.../SqlLab/components/SqlEditorLeftBar/index.tsx | 22 ++++++++++++++++++++++
.../data/dataset/AddDataset/LeftPanel/index.tsx | 1 +
2 files changed, 23 insertions(+)
diff --git a/superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx b/superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx
index cc62022a12..37fd50244f 100644
--- a/superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx
+++ b/superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx
@@ -95,6 +95,28 @@ const collapseStyles = (theme: SupersetTheme) => css`
}
`;
+const NO_DATABASES_MATCH_TITLE = t('No databases match your search');
+const NO_DATABASES_AVAILABLE_TITLE = t('There are no databases available');
+const MANAGE_YOUR_DATABASES_TEXT = t('Manage your databases');
+const HERE_TEXT = t('here');
+
+export const emptyStateComponent = (emptyResultsWithSearch: boolean) => (
+ <EmptyStateSmall
+ image="empty.svg"
+ title={
+ emptyResultsWithSearch
+ ? NO_DATABASES_MATCH_TITLE
+ : NO_DATABASES_AVAILABLE_TITLE
+ }
+ description={
+ <p>
+ {MANAGE_YOUR_DATABASES_TEXT}{' '}
+ <a href="/databaseview/list">{HERE_TEXT}</a>
+ </p>
+ }
+ />
+);
+
const SqlEditorLeftBar = ({
database,
queryEditorId,
diff --git a/superset-frontend/src/views/CRUD/data/dataset/AddDataset/LeftPanel/index.tsx b/superset-frontend/src/views/CRUD/data/dataset/AddDataset/LeftPanel/index.tsx
index 4f7dfca196..f11b476195 100644
--- a/superset-frontend/src/views/CRUD/data/dataset/AddDataset/LeftPanel/index.tsx
+++ b/superset-frontend/src/views/CRUD/data/dataset/AddDataset/LeftPanel/index.tsx
@@ -40,6 +40,7 @@ import {
emptyStateComponent,
} from 'src/components/EmptyState';
import { useToasts } from 'src/components/MessageToasts/withToasts';
+import { emptyStateComponent } from 'src/SqlLab/components/SqlEditorLeftBar';
import { DatasetActionType } from '../types';
interface LeftPanelProps {