🐛 Fix bug that expressions could not be displayed in read-only mode

This commit is contained in:
Jan Oberhauser 2021-04-04 17:58:25 +02:00
parent 012818b804
commit 001c6b7cc9
2 changed files with 5 additions and 9 deletions

View file

@ -12,23 +12,22 @@ import 'quill/dist/quill.core.css';
import Quill, { DeltaOperation } from 'quill';
// @ts-ignore
import AutoFormat, { AutoformatHelperAttribute } from 'quill-autoformat';
import AutoFormat from 'quill-autoformat';
import {
NodeParameterValue,
Workflow,
WorkflowDataProxy,
} from 'n8n-workflow';
import {
IExecutionResponse,
IVariableItemSelected,
IVariableSelectorOption,
} from '@/Interface';
import { genericHelpers } from '@/components/mixins/genericHelpers';
import { workflowHelpers } from '@/components/mixins/workflowHelpers';
import mixins from 'vue-typed-mixins';
export default mixins(
genericHelpers,
workflowHelpers,
)
.extend({
@ -119,7 +118,7 @@ export default mixins(
};
this.editor = new Quill(this.$refs['expression-editor'] as Element, {
readOnly: !!this.resolvedValue,
readOnly: !!this.resolvedValue || this.isReadOnly,
modules: {
autoformat: {},
keyboard: {

View file

@ -10,7 +10,7 @@
<prism-editor v-if="!codeEditDialogVisible" :lineNumbers="true" :readonly="true" :code="displayValue" language="js"></prism-editor>
</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()" />
</el-input>
</div>
@ -523,9 +523,6 @@ export default mixins(
this.valueChanged(value);
},
setFocus () {
if (this.isReadOnly === true) {
return;
}
if (this.isValueExpression) {
this.expressionEditDialogVisible = true;
return;