mirror of
https://github.com/apache/superset.git
synced 2026-05-06 16:34:32 +00:00
feat: hack db connection modal ctabtns (#20017)
* add flow for dbconnmodal to datasetmodal * fix bug * second part * fix dataset to sql lab * fix lint * more lint * add key value * fix type * add new styling * remove undefined from types
This commit is contained in:
committed by
GitHub
parent
4137fe03a0
commit
9da7c1f7b8
@@ -81,7 +81,7 @@ const TableLabel = styled.span`
|
||||
|
||||
interface TableSelectorProps {
|
||||
clearable?: boolean;
|
||||
database?: DatabaseObject;
|
||||
database?: DatabaseObject | null;
|
||||
emptyState?: ReactNode;
|
||||
formMode?: boolean;
|
||||
getDbList?: (arg0: any) => {};
|
||||
@@ -166,12 +166,11 @@ const TableSelector: FunctionComponent<TableSelectorProps> = ({
|
||||
onTableSelectChange,
|
||||
}) => {
|
||||
const [currentDatabase, setCurrentDatabase] = useState<
|
||||
DatabaseObject | undefined
|
||||
DatabaseObject | null | undefined
|
||||
>(database);
|
||||
const [currentSchema, setCurrentSchema] = useState<string | undefined>(
|
||||
schema,
|
||||
);
|
||||
|
||||
const [tableOptions, setTableOptions] = useState<TableOption[]>([]);
|
||||
const [tableSelectValue, setTableSelectValue] = useState<
|
||||
SelectValue | undefined
|
||||
@@ -190,6 +189,10 @@ const TableSelector: FunctionComponent<TableSelectorProps> = ({
|
||||
}
|
||||
}, [database, tableSelectMode]);
|
||||
|
||||
useEffect(() => {
|
||||
setCurrentDatabase(database);
|
||||
}, [database]);
|
||||
|
||||
useEffect(() => {
|
||||
if (tableSelectMode === 'single') {
|
||||
setTableSelectValue(
|
||||
|
||||
Reference in New Issue
Block a user