mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-13 05:47:31 -08:00
🐛 Fix bug that expressions could not be displayed in read-only mode
This commit is contained in:
parent
012818b804
commit
001c6b7cc9
|
@ -12,23 +12,22 @@ import 'quill/dist/quill.core.css';
|
||||||
|
|
||||||
import Quill, { DeltaOperation } from 'quill';
|
import Quill, { DeltaOperation } from 'quill';
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import AutoFormat, { AutoformatHelperAttribute } from 'quill-autoformat';
|
import AutoFormat from 'quill-autoformat';
|
||||||
import {
|
import {
|
||||||
NodeParameterValue,
|
NodeParameterValue,
|
||||||
Workflow,
|
Workflow,
|
||||||
WorkflowDataProxy,
|
|
||||||
} from 'n8n-workflow';
|
} from 'n8n-workflow';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
IExecutionResponse,
|
|
||||||
IVariableItemSelected,
|
IVariableItemSelected,
|
||||||
IVariableSelectorOption,
|
|
||||||
} from '@/Interface';
|
} from '@/Interface';
|
||||||
|
import { genericHelpers } from '@/components/mixins/genericHelpers';
|
||||||
import { workflowHelpers } from '@/components/mixins/workflowHelpers';
|
import { workflowHelpers } from '@/components/mixins/workflowHelpers';
|
||||||
|
|
||||||
import mixins from 'vue-typed-mixins';
|
import mixins from 'vue-typed-mixins';
|
||||||
|
|
||||||
export default mixins(
|
export default mixins(
|
||||||
|
genericHelpers,
|
||||||
workflowHelpers,
|
workflowHelpers,
|
||||||
)
|
)
|
||||||
.extend({
|
.extend({
|
||||||
|
@ -119,7 +118,7 @@ export default mixins(
|
||||||
};
|
};
|
||||||
|
|
||||||
this.editor = new Quill(this.$refs['expression-editor'] as Element, {
|
this.editor = new Quill(this.$refs['expression-editor'] as Element, {
|
||||||
readOnly: !!this.resolvedValue,
|
readOnly: !!this.resolvedValue || this.isReadOnly,
|
||||||
modules: {
|
modules: {
|
||||||
autoformat: {},
|
autoformat: {},
|
||||||
keyboard: {
|
keyboard: {
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<prism-editor v-if="!codeEditDialogVisible" :lineNumbers="true" :readonly="true" :code="displayValue" language="js"></prism-editor>
|
<prism-editor v-if="!codeEditDialogVisible" :lineNumbers="true" :readonly="true" :code="displayValue" language="js"></prism-editor>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-input v-else v-model="tempValue" ref="inputField" size="small" :type="getStringInputType" :rows="getArgument('rows')" :value="displayValue" :disabled="isReadOnly" @change="valueChanged" @keydown.stop @focus="setFocus" :title="displayTitle" :placeholder="isValueExpression?'':parameter.placeholder">
|
<el-input v-else v-model="tempValue" ref="inputField" size="small" :type="getStringInputType" :rows="getArgument('rows')" :value="displayValue" :disabled="!isValueExpression && isReadOnly" @change="valueChanged" @keydown.stop @focus="setFocus" :title="displayTitle" :placeholder="isValueExpression?'':parameter.placeholder">
|
||||||
<font-awesome-icon v-if="!isValueExpression && !isReadOnly" slot="suffix" icon="external-link-alt" class="edit-window-button clickable" title="Open Edit Window" @click="displayEditDialog()" />
|
<font-awesome-icon v-if="!isValueExpression && !isReadOnly" slot="suffix" icon="external-link-alt" class="edit-window-button clickable" title="Open Edit Window" @click="displayEditDialog()" />
|
||||||
</el-input>
|
</el-input>
|
||||||
</div>
|
</div>
|
||||||
|
@ -523,9 +523,6 @@ export default mixins(
|
||||||
this.valueChanged(value);
|
this.valueChanged(value);
|
||||||
},
|
},
|
||||||
setFocus () {
|
setFocus () {
|
||||||
if (this.isReadOnly === true) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (this.isValueExpression) {
|
if (this.isValueExpression) {
|
||||||
this.expressionEditDialogVisible = true;
|
this.expressionEditDialogVisible = true;
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue