chore(sqllab): Cleanup /tables/... endpoint (#21284)

This commit is contained in:
John Bodley
2022-09-13 08:22:12 -07:00
committed by GitHub
parent 59437ea6e7
commit eac6fdcd29
29 changed files with 116 additions and 468 deletions

View File

@@ -31,7 +31,6 @@ const createProps = (props = {}) => ({
id: 1,
database_name: 'main',
backend: 'sqlite',
allow_multi_schema_metadata_fetch: false,
},
schema: 'test_schema',
handleError: jest.fn(),

View File

@@ -112,9 +112,9 @@ export interface TableOption {
}
export const TableOption = ({ table }: { table: Table }) => {
const { label, type, extra } = table;
const { value, type, extra } = table;
return (
<TableLabel title={label}>
<TableLabel title={value}>
{type === 'view' ? (
<Icons.Eye iconSize="m" />
) : (
@@ -133,7 +133,7 @@ export const TableOption = ({ table }: { table: Table }) => {
size="l"
/>
)}
{label}
{value}
</TableLabel>
);
};
@@ -286,9 +286,7 @@ const TableSelector: FunctionComponent<TableSelectorProps> = ({
);
function renderTableSelect() {
const disabled =
(currentSchema && !formMode && readOnly) ||
(!currentSchema && !database?.allow_multi_schema_metadata_fetch);
const disabled = (currentSchema && !formMode && readOnly) || !currentSchema;
const header = sqlLabMode ? (
<FormLabel>{t('See table schema')}</FormLabel>