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, toolbar: true,
toolbarOrder: 2, toolbarOrder: 2,
name: 'Query', name: 'Query',
toolbarName: 'New query',
keyText: 'Ctrl+Q', keyText: 'Ctrl+Q',
onClick: () => newQuery(), onClick: () => newQuery(),
}); });

View File

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

View File

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

View File

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

View File

@@ -111,6 +111,7 @@
import tabs from '../tabs'; import tabs from '../tabs';
import { setSelectedTab } from '../utility/common'; import { setSelectedTab } from '../utility/common';
import contextMenu from '../utility/contextMenu'; import contextMenu from '../utility/contextMenu';
import { getConnectionInfo } from '../utility/metadataLoaders';
$: currentDbKey = $: currentDbKey =
$currentDatabase && $currentDatabase.name && $currentDatabase.connection $currentDatabase && $currentDatabase.name && $currentDatabase.connection
@@ -172,11 +173,27 @@
} }
return res; 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> </script>
{#each dbKeys as dbKey} {#each dbKeys as dbKey}
<div class="db-wrapper"> <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)} /> <FontIcon icon={getDbIcon(dbKey)} />
{tabsByDb[dbKey][0].tabDbName} {tabsByDb[dbKey][0].tabDbName}
</div> </div>