mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-12 23:54:07 -08:00
🐛 Do now allow to edit JavaScript code in read-only mode
This commit is contained in:
parent
001c6b7cc9
commit
cf73387214
|
@ -6,7 +6,7 @@
|
||||||
{{parameter.displayName}}:
|
{{parameter.displayName}}:
|
||||||
</div>
|
</div>
|
||||||
<div class="text-editor" @keydown.stop>
|
<div class="text-editor" @keydown.stop>
|
||||||
<prism-editor :lineNumbers="true" :code="value" @change="valueChanged" language="js"></prism-editor>
|
<prism-editor :lineNumbers="true" :code="value" :readonly="isReadOnly" @change="valueChanged" language="js"></prism-editor>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
@ -14,42 +14,43 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Vue from 'vue';
|
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import PrismEditor from 'vue-prism-editor';
|
import PrismEditor from 'vue-prism-editor';
|
||||||
|
|
||||||
import {
|
import { genericHelpers } from '@/components/mixins/genericHelpers';
|
||||||
Workflow,
|
|
||||||
} from 'n8n-workflow';
|
|
||||||
|
|
||||||
export default Vue.extend({
|
import mixins from 'vue-typed-mixins';
|
||||||
name: 'CodeEdit',
|
|
||||||
props: [
|
|
||||||
'dialogVisible',
|
|
||||||
'parameter',
|
|
||||||
'value',
|
|
||||||
],
|
|
||||||
components: {
|
|
||||||
PrismEditor,
|
|
||||||
},
|
|
||||||
data () {
|
|
||||||
return {
|
|
||||||
};
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
valueChanged (value: string) {
|
|
||||||
this.$emit('valueChanged', value);
|
|
||||||
},
|
|
||||||
|
|
||||||
closeDialog () {
|
export default mixins(
|
||||||
// Handle the close externally as the visible parameter is an external prop
|
genericHelpers,
|
||||||
// and is so not allowed to be changed here.
|
)
|
||||||
this.$emit('closeDialog');
|
.extend({
|
||||||
return false;
|
name: 'CodeEdit',
|
||||||
|
props: [
|
||||||
|
'dialogVisible',
|
||||||
|
'parameter',
|
||||||
|
'value',
|
||||||
|
],
|
||||||
|
components: {
|
||||||
|
PrismEditor,
|
||||||
},
|
},
|
||||||
},
|
data () {
|
||||||
});
|
return {
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
valueChanged (value: string) {
|
||||||
|
this.$emit('valueChanged', value);
|
||||||
|
},
|
||||||
|
|
||||||
|
closeDialog () {
|
||||||
|
// Handle the close externally as the visible parameter is an external prop
|
||||||
|
// and is so not allowed to be changed here.
|
||||||
|
this.$emit('closeDialog');
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
Loading…
Reference in a new issue