readonly connection fixes

This commit is contained in:
Jan Prochazka
2024-08-27 11:20:43 +02:00
parent b9737533bd
commit db6d5f498b
3 changed files with 4 additions and 2 deletions

View File

@@ -32,6 +32,7 @@
export let onDictionaryLookup = null; export let onDictionaryLookup = null;
export let onSetValue; export let onSetValue;
export let editorTypes = null; export let editorTypes = null;
export let isReadonly;
$: value = col.isStructured ? _.get(rowData || {}, col.uniquePath) : (rowData || {})[col.uniqueName]; $: value = col.isStructured ? _.get(rowData || {}, col.uniquePath) : (rowData || {})[col.uniqueName];
@@ -102,7 +103,7 @@
{/if} {/if}
{:else if col.foreignKey && rowData && rowData[col.uniqueName] && !isCurrentCell} {:else if col.foreignKey && rowData && rowData[col.uniqueName] && !isCurrentCell}
<ShowFormButton on:click={() => onSetFormView(rowData, col)} /> <ShowFormButton on:click={() => onSetFormView(rowData, col)} />
{:else if col.foreignKey && isCurrentCell && onDictionaryLookup} {:else if col.foreignKey && isCurrentCell && onDictionaryLookup && !isReadonly}
<ShowFormButton icon="icon dots-horizontal" on:click={onDictionaryLookup} /> <ShowFormButton icon="icon dots-horizontal" on:click={onDictionaryLookup} />
{:else if isJson} {:else if isJson}
<ShowFormButton icon="icon open-in-new" on:click={() => openJsonDocument(value, undefined, true)} /> <ShowFormButton icon="icon open-in-new" on:click={() => openJsonDocument(value, undefined, true)} />

View File

@@ -95,6 +95,7 @@
grider.editable} grider.editable}
onDictionaryLookup={() => handleLookup(col)} onDictionaryLookup={() => handleLookup(col)}
onSetValue={value => grider.setCellValue(rowIndex, col.uniqueName, value)} onSetValue={value => grider.setCellValue(rowIndex, col.uniqueName, value)}
isReadonly={!grider.editable}
/> />
{/if} {/if}
{/each} {/each}

View File

@@ -158,7 +158,7 @@
formViewComponent={SqlFormView} formViewComponent={SqlFormView}
{display} {display}
showReferences showReferences
showMacros showMacros={!$connection?.isReadOnly}
hasMultiColumnFilter hasMultiColumnFilter
onRunMacro={handleRunMacro} onRunMacro={handleRunMacro}
macroCondition={macro => macro.type == 'transformValue'} macroCondition={macro => macro.type == 'transformValue'}