fixes from testing

This commit is contained in:
Jan Prochazka
2021-03-25 08:39:07 +01:00
parent 4e4447de8a
commit 0d0bd29812
5 changed files with 25 additions and 6 deletions

View File

@@ -78,6 +78,7 @@ registerCommand({
toolbar: true,
toolbarOrder: 2,
name: 'Query',
toolbarName: 'New query',
keyText: 'Ctrl+Q',
onClick: () => newQuery(),
});

View File

@@ -10,6 +10,7 @@
export let gridCoreComponent;
export let formViewComponent;
export let formDisplay;
export let display;
export let isDetailView = false;
export let showReferences = false;
@@ -35,7 +36,7 @@
name="references"
height="30%"
collapsed={isDetailView}
skip={!showReferences}
skip={!showReferences || !display.hasReferences}
>
<ReferenceManager {...$$props} {managerSize} />
</WidgetColumnBarItem>

View File

@@ -93,11 +93,11 @@
{value.toString()}
{/if}
{#if hintFieldsAllowed && hintFieldsAllowed.includes(col.uniqueName) && rowData}
{#if hintFieldsAllowed && hintFieldsAllowed.includes(col.uniqueName) && rowData && rowData[col.hintColumnName]}
<span class="hint">{rowData[col.hintColumnName]}</span>
{/if}
{#if col.foreignKey && rowData[col.uniqueName]}
{#if col.foreignKey && rowData && rowData[col.uniqueName]}
<ShowFormButton on:click={() => onSetFormView(rowData, col)} />
{/if}
{/if}

View File

@@ -9,14 +9,14 @@
{#if isSmall}
<div class="container-small">
<FontIcon {icon} />
{message}
{message || 'Unknown error'}
</div>
{:else}
<div class="container">
<div class="icon">
<FontIcon {icon} />
</div>
{message}
{message || 'Unknown error'}
</div>
{/if}

View File

@@ -111,6 +111,7 @@
import tabs from '../tabs';
import { setSelectedTab } from '../utility/common';
import contextMenu from '../utility/contextMenu';
import { getConnectionInfo } from '../utility/metadataLoaders';
$: currentDbKey =
$currentDatabase && $currentDatabase.name && $currentDatabase.connection
@@ -172,11 +173,27 @@
}
return res;
};
const handleSetDb = async props => {
const { conid, database } = props || {};
if (conid) {
const connection = await getConnectionInfo({ conid, database });
if (connection) {
$currentDatabase = { connection, name: database };
return;
}
}
$currentDatabase = null;
};
</script>
{#each dbKeys as dbKey}
<div class="db-wrapper">
<div class="db-name" class:selected={tabsByDb[dbKey][0].tabDbKey == currentDbKey}>
<div
class="db-name"
class:selected={tabsByDb[dbKey][0].tabDbKey == currentDbKey}
on:click={() => handleSetDb(tabsByDb[dbKey][0].props)}
>
<FontIcon icon={getDbIcon(dbKey)} />
{tabsByDb[dbKey][0].tabDbName}
</div>