cell array view fix

This commit is contained in:
Jan Prochazka
2022-02-17 13:06:49 +01:00
parent ca79db53ee
commit 29fa8445e2

View File

@@ -34,7 +34,7 @@
</script> </script>
<script lang="ts"> <script lang="ts">
import _, { join } from 'lodash'; import _, { isPlainObject, join } from 'lodash';
import ShowFormButton from '../formview/ShowFormButton.svelte'; import ShowFormButton from '../formview/ShowFormButton.svelte';
import { getBoolSettingsValue } from '../settings/settingsTools'; import { getBoolSettingsValue } from '../settings/settingsTools';
import { arrayToHexString, isJsonLikeLongString, safeJsonParse } from 'dbgate-tools'; import { arrayToHexString, isJsonLikeLongString, safeJsonParse } from 'dbgate-tools';
@@ -170,21 +170,26 @@
{#if _.isArray(jsonParsedValue || value)} {#if _.isArray(jsonParsedValue || value)}
<ShowFormButton <ShowFormButton
icon="icon open-in-new" icon="icon open-in-new"
on:click={() => on:click={() => {
openNewTab( if (_.every(jsonParsedValue || value, x => _.isPlainObject(x))) {
{ openNewTab(
title: 'Data #', {
icon: 'img free-table', title: 'Data #',
tabComponent: 'FreeTableTab', icon: 'img free-table',
props: {}, tabComponent: 'FreeTableTab',
}, props: {},
{
editor: {
rows: jsonParsedValue || value,
structure: { __isDynamicStructure: true, columns: [] },
}, },
} {
)} editor: {
rows: jsonParsedValue || value,
structure: { __isDynamicStructure: true, columns: [] },
},
}
);
} else {
openJsonDocument(jsonParsedValue || value, undefined, true);
}
}}
/> />
{/if} {/if}