fix: Create dataset polish/bug fix (#22262)

This commit is contained in:
Lyndsi Kay Williams
2022-12-20 10:05:40 -06:00
committed by GitHub
parent 7f4e522f1a
commit 6b20e74442
10 changed files with 166 additions and 89 deletions

View File

@@ -49,7 +49,7 @@ import { TableSelectorMultiple } from 'src/components/TableSelector';
import { IconTooltip } from 'src/components/IconTooltip';
import useQueryEditor from 'src/SqlLab/hooks/useQueryEditor';
import { DatabaseObject } from 'src/components/DatabaseSelector';
import { EmptyStateSmall } from 'src/components/EmptyState';
import { emptyStateComponent } from 'src/components/EmptyState';
import {
getItem,
LocalStorageKeys,
@@ -197,23 +197,6 @@ const SqlEditorLeftBar = ({
const shouldShowReset = window.location.search === '?reset=1';
const tableMetaDataHeight = height - 130; // 130 is the height of the selects above
const emptyStateComponent = (
<EmptyStateSmall
image="empty.svg"
title={
emptyResultsWithSearch
? t('No databases match your search')
: t('There are no databases available')
}
description={
<p>
{t('Manage your databases')}{' '}
<a href="/databaseview/list">{t('here')}</a>
</p>
}
/>
);
const handleSchemaChange = useCallback((schema: string) => {
if (queryEditor) {
dispatch(queryEditorSetSchema(queryEditor, schema));
@@ -248,7 +231,7 @@ const SqlEditorLeftBar = ({
<div data-test="sql-editor-left-bar" className="SqlEditorLeftBar">
<TableSelectorMultiple
onEmptyResults={onEmptyResults}
emptyState={emptyStateComponent}
emptyState={emptyStateComponent(emptyResultsWithSearch)}
database={userSelectedDb}
getDbList={handleDbList}
handleError={handleError}