feat: add empty states to sqlab editor and select (#19598)

* feat: add empty states to sqlab editor and select

* add suggestions and test

* update type

* lint fix and add suggestions

* fix typo

* run lint

* remove unused code

* fix test

* remove redux for propagation and other suggestions

* add t

* lint

* fix text and remove code

* ts and fix t in p

* fix spelling

* remove unused prop

* add fn to prop change state

* remove unused code

* remove unused types

* update code and test

* fix lint

* fix ts

* update ts

* add type export and fix test

* Update superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx

Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com>

* Update superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx

Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com>

* Update superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx

Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com>

* Update superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx

Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com>

* remove handlerror and unused code

Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com>
This commit is contained in:
Phillip Kelley-Dotson
2022-04-15 15:09:07 -07:00
committed by GitHub
parent 154f1ea8c9
commit 06ec88eb99
9 changed files with 147 additions and 17 deletions

View File

@@ -82,6 +82,7 @@ const TableLabel = styled.span`
interface TableSelectorProps {
clearable?: boolean;
database?: DatabaseObject;
emptyState?: ReactNode;
formMode?: boolean;
getDbList?: (arg0: any) => {};
handleError: (msg: string) => void;
@@ -92,6 +93,7 @@ interface TableSelectorProps {
onTablesLoad?: (options: Array<any>) => void;
readOnly?: boolean;
schema?: string;
onEmptyResults?: (searchText?: string) => void;
sqlLabMode?: boolean;
tableValue?: string | string[];
onTableSelectChange?: (value?: string | string[], schema?: string) => void;
@@ -146,6 +148,7 @@ const TableOption = ({ table }: { table: Table }) => {
const TableSelector: FunctionComponent<TableSelectorProps> = ({
database,
emptyState,
formMode = false,
getDbList,
handleError,
@@ -155,6 +158,7 @@ const TableSelector: FunctionComponent<TableSelectorProps> = ({
onSchemasLoad,
onTablesLoad,
readOnly = false,
onEmptyResults,
schema,
sqlLabMode = true,
tableSelectMode = 'single',
@@ -286,10 +290,12 @@ const TableSelector: FunctionComponent<TableSelectorProps> = ({
<DatabaseSelector
key={currentDatabase?.id}
db={currentDatabase}
emptyState={emptyState}
formMode={formMode}
getDbList={getDbList}
handleError={handleError}
onDbChange={readOnly ? undefined : internalDbChange}
onEmptyResults={onEmptyResults}
onSchemaChange={readOnly ? undefined : internalSchemaChange}
onSchemasLoad={onSchemasLoad}
schema={currentSchema}