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,7 +170,8 @@
{#if _.isArray(jsonParsedValue || value)} {#if _.isArray(jsonParsedValue || value)}
<ShowFormButton <ShowFormButton
icon="icon open-in-new" icon="icon open-in-new"
on:click={() => on:click={() => {
if (_.every(jsonParsedValue || value, x => _.isPlainObject(x))) {
openNewTab( openNewTab(
{ {
title: 'Data #', title: 'Data #',
@@ -184,7 +185,11 @@
structure: { __isDynamicStructure: true, columns: [] }, structure: { __isDynamicStructure: true, columns: [] },
}, },
} }
)} );
} else {
openJsonDocument(jsonParsedValue || value, undefined, true);
}
}}
/> />
{/if} {/if}