value lookup works also for views

This commit is contained in:
Jan Prochazka 2021-11-20 12:42:50 +01:00
parent 4f01bc5bcb
commit 731a0b5d64

View File

@ -7,7 +7,6 @@
import DefineDictionaryDescriptionModal from './DefineDictionaryDescriptionModal.svelte'; import DefineDictionaryDescriptionModal from './DefineDictionaryDescriptionModal.svelte';
import ScrollableTableControl from '../elements/ScrollableTableControl.svelte'; import ScrollableTableControl from '../elements/ScrollableTableControl.svelte';
import axiosInstance from '../utility/axiosInstance'; import axiosInstance from '../utility/axiosInstance';
import { getTableInfo } from '../utility/metadataLoaders';
import { getDictionaryDescription } from '../utility/dictionaryDescriptionTools'; import { getDictionaryDescription } from '../utility/dictionaryDescriptionTools';
import { onMount } from 'svelte'; import { onMount } from 'svelte';
import { dumpSqlSelect } from 'dbgate-sqltree'; import { dumpSqlSelect } from 'dbgate-sqltree';
@ -25,8 +24,9 @@
export let driver; export let driver;
export let multiselect = false; export let multiselect = false;
// console.log('ValueLookupModal', conid, database, pureName, schemaName, columnName, driver);
let rows = null; let rows = null;
let tableInfo;
let isLoading = false; let isLoading = false;
let search = ''; let search = '';
@ -34,11 +34,7 @@
let checkedKeys = []; let checkedKeys = [];
async function reload() { async function reload() {
tableInfo = await getTableInfo({ conid, database, schemaName, pureName }); const dmp = driver.createDumper();
if (!tableInfo) return;
const dmp = driver.createDumper();
const select = { const select = {
commandType: 'select', commandType: 'select',
distinct: true, distinct: true,
@ -126,7 +122,7 @@
<LoadingInfo message="Loading data" /> <LoadingInfo message="Loading data" />
{/if} {/if}
{#if !isLoading && tableInfo && rows} {#if !isLoading && rows}
<div class="tableWrapper"> <div class="tableWrapper">
<ScrollableTableControl <ScrollableTableControl
{rows} {rows}