fixes database widget collapsing problems

This commit is contained in:
Jan Prochazka 2023-03-13 20:03:52 +01:00
parent df4230ea1d
commit a45782098a

View File

@ -46,25 +46,34 @@
<PinnedObjectsList />
</WidgetColumnBarItem>
{#if conid && (database || singleDatabase)}
{#if driver?.databaseEngineTypes?.includes('sql') || driver?.databaseEngineTypes?.includes('document')}
<WidgetColumnBarItem
title={driver?.databaseEngineTypes?.includes('document') ? 'Collections' : 'Tables, views, functions'}
name="dbObjects"
storageName="dbObjectsWidget"
>
<SqlObjectList {conid} {database} />
</WidgetColumnBarItem>
{:else if driver?.databaseEngineTypes?.includes('keyvalue')}
<WidgetColumnBarItem title={'Keys'} name="dbObjects" storageName="dbObjectsWidget">
<DbKeysTree {conid} {database} />
</WidgetColumnBarItem>
{/if}
{:else}
<WidgetColumnBarItem title="Database content" name="dbObjects" storageName="dbObjectsWidget">
<WidgetsInnerContainer>
<ErrorInfo message="Database not selected" icon="img alert" />
</WidgetsInnerContainer>
</WidgetColumnBarItem>
{/if}
<WidgetColumnBarItem
title={driver?.databaseEngineTypes?.includes('document') ? 'Collections' : 'Tables, views, functions'}
name="dbObjects"
storageName="dbObjectsWidget"
show={conid &&
(database || singleDatabase) &&
(driver?.databaseEngineTypes?.includes('sql') || driver?.databaseEngineTypes?.includes('document'))}
>
<SqlObjectList {conid} {database} />
</WidgetColumnBarItem>
<WidgetColumnBarItem
title={'Keys'}
name="dbObjects"
storageName="dbObjectsWidget"
show={conid && (database || singleDatabase) && driver?.databaseEngineTypes?.includes('keyvalue')}
>
<DbKeysTree {conid} {database} />
</WidgetColumnBarItem>
<WidgetColumnBarItem
title="Database content"
name="dbObjects"
storageName="dbObjectsWidget"
skip={conid && (database || singleDatabase)}
>
<WidgetsInnerContainer>
<ErrorInfo message="Database not selected" icon="img alert" />
</WidgetsInnerContainer>
</WidgetColumnBarItem>
</WidgetColumnBar>