diff --git a/packages/tools/src/stringTools.ts b/packages/tools/src/stringTools.ts index 3b93522d2..f2eeacff9 100644 --- a/packages/tools/src/stringTools.ts +++ b/packages/tools/src/stringTools.ts @@ -150,7 +150,7 @@ export function stringifyCellValue( if (value === true) return { value: 'true', gridStyle: 'valueCellStyle' }; if (value === false) return { value: 'false', gridStyle: 'valueCellStyle' }; - + if (editorTypes?.parseHexAsBuffer) { if (value?.type == 'Buffer' && _isArray(value.data)) { return { value: '0x' + arrayToHexString(value.data), gridStyle: 'valueCellStyle' }; @@ -167,28 +167,26 @@ export function stringifyCellValue( } } } - if (editorTypes?.parseJsonArray) { - if (_isArray(value)) { - switch (intent) { - case 'gridCellIntent': - return stringifyJsonToGrid(value); - case 'multilineEditorIntent': - return { value: JSON.stringify(value) }; - default: - return { value: JSON.stringify(value, null, 2), gridStyle: 'valueCellStyle' }; - } + + if (_isArray(value)) { + switch (intent) { + case 'gridCellIntent': + return stringifyJsonToGrid(value); + case 'multilineEditorIntent': + return { value: JSON.stringify(value, null, 2) }; + default: + return { value: JSON.stringify(value), gridStyle: 'valueCellStyle' }; } } - if (editorTypes?.parseJsonObject) { - if (_isPlainObject(value)) { - switch (intent) { - case 'gridCellIntent': - return stringifyJsonToGrid(value); - case 'multilineEditorIntent': - return { value: JSON.stringify(value) }; - default: - return { value: JSON.stringify(value, null, 2), gridStyle: 'valueCellStyle' }; - } + + if (_isPlainObject(value)) { + switch (intent) { + case 'gridCellIntent': + return stringifyJsonToGrid(value); + case 'multilineEditorIntent': + return { value: JSON.stringify(value, null, 2) }; + default: + return { value: JSON.stringify(value), gridStyle: 'valueCellStyle' }; } } diff --git a/packages/web/src/datagrid/DataGridCell.svelte b/packages/web/src/datagrid/DataGridCell.svelte index f6d9b80e7..54825b543 100644 --- a/packages/web/src/datagrid/DataGridCell.svelte +++ b/packages/web/src/datagrid/DataGridCell.svelte @@ -3,10 +3,7 @@ import ShowFormButton from '../formview/ShowFormButton.svelte'; import { detectTypeIcon, getConvertValueMenu, isJsonLikeLongString, safeJsonParse } from 'dbgate-tools'; import { openJsonDocument } from '../tabs/JsonTab.svelte'; - import openNewTab from '../utility/openNewTab'; import CellValue from './CellValue.svelte'; - import { showModal } from '../modals/modalTools'; - import EditCellDataModal from '../modals/EditCellDataModal.svelte'; import { openJsonLinesData } from '../utility/openJsonLinesData'; import ShowFormDropDownButton from '../formview/ShowFormDropDownButton.svelte'; diff --git a/packages/web/src/datagrid/DataGridCore.svelte b/packages/web/src/datagrid/DataGridCore.svelte index fc5031724..c8a637957 100644 --- a/packages/web/src/datagrid/DataGridCore.svelte +++ b/packages/web/src/datagrid/DataGridCore.svelte @@ -343,7 +343,7 @@