mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-30 13:53:59 +00:00
Merge pull request #1075 from dbgate/feature/json-wrap
feat: add jsonPreviewWrap option to settings
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import { copyTextToClipboard } from '../utility/clipboard';
|
import { copyTextToClipboard } from '../utility/clipboard';
|
||||||
import { openJsonLinesData } from '../utility/openJsonLinesData';
|
import { openJsonLinesData } from '../utility/openJsonLinesData';
|
||||||
|
import { useSettings } from '../utility/metadataLoaders';
|
||||||
|
|
||||||
setContext('json-tree-context-key', {});
|
setContext('json-tree-context-key', {});
|
||||||
|
|
||||||
@@ -23,6 +24,9 @@
|
|||||||
export let isInserted = false;
|
export let isInserted = false;
|
||||||
export let isModified = false;
|
export let isModified = false;
|
||||||
|
|
||||||
|
const settings = useSettings();
|
||||||
|
$: wrap = $settings?.['behaviour.jsonPreviewWrap'];
|
||||||
|
|
||||||
setContext('json-tree-default-expanded', expandAll);
|
setContext('json-tree-default-expanded', expandAll);
|
||||||
if (slicedKeyCount) setContext('json-tree-sliced-key-count', slicedKeyCount);
|
if (slicedKeyCount) setContext('json-tree-sliced-key-count', slicedKeyCount);
|
||||||
|
|
||||||
@@ -66,6 +70,7 @@
|
|||||||
class:isDeleted
|
class:isDeleted
|
||||||
class:isInserted
|
class:isInserted
|
||||||
class:isModified
|
class:isModified
|
||||||
|
class:wrap
|
||||||
>
|
>
|
||||||
<JSONNode
|
<JSONNode
|
||||||
{key}
|
{key}
|
||||||
@@ -115,6 +120,9 @@
|
|||||||
list-style: none;
|
list-style: none;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
ul.wrap :global(li) {
|
||||||
|
white-space: normal;
|
||||||
|
}
|
||||||
ul,
|
ul,
|
||||||
ul :global(ul) {
|
ul :global(ul) {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|||||||
@@ -431,6 +431,12 @@ ORDER BY
|
|||||||
|
|
||||||
<FormCheckboxField name="behaviour.useTabPreviewMode" label="Use tab preview mode" defaultValue={true} />
|
<FormCheckboxField name="behaviour.useTabPreviewMode" label="Use tab preview mode" defaultValue={true} />
|
||||||
|
|
||||||
|
<FormCheckboxField
|
||||||
|
name="behaviour.jsonPreviewWrap"
|
||||||
|
label={_t('settings.behaviour.jsonPreviewWrap', { defaultMessage: 'Wrap json in preview' })}
|
||||||
|
defaultValue={false}
|
||||||
|
/>
|
||||||
|
|
||||||
<div class="tip">
|
<div class="tip">
|
||||||
<FontIcon icon="img tip" /> When you single-click or select a file in the "Tables, Views, Functions" view, it
|
<FontIcon icon="img tip" /> When you single-click or select a file in the "Tables, Views, Functions" view, it
|
||||||
is shown in a preview mode and reuses an existing tab (preview tab). This is useful if you are quickly browsing
|
is shown in a preview mode and reuses an existing tab (preview tab). This is useful if you are quickly browsing
|
||||||
|
|||||||
Reference in New Issue
Block a user