mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(editor): Disable context menu actions in read-only mode (#7789)
Github issue / Community forum post (link here to close automatically):
This commit is contained in:
@@ -65,6 +65,7 @@
|
||||
>
|
||||
<template #reference>
|
||||
<div
|
||||
ref="colorPopoverTrigger"
|
||||
class="option"
|
||||
data-test-id="change-sticky-color"
|
||||
:title="$locale.baseText('node.changeColor')"
|
||||
@@ -100,7 +101,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import { defineComponent, ref } from 'vue';
|
||||
import { mapStores } from 'pinia';
|
||||
|
||||
import { externalHooks } from '@/mixins/externalHooks';
|
||||
@@ -127,8 +128,18 @@ export default defineComponent({
|
||||
name: 'Sticky',
|
||||
mixins: [externalHooks, nodeBase, nodeHelpers, workflowHelpers],
|
||||
setup() {
|
||||
const contextMenu = useContextMenu();
|
||||
return { contextMenu };
|
||||
const colorPopoverTrigger = ref<HTMLDivElement>();
|
||||
const forceActions = ref(false);
|
||||
const setForceActions = (value: boolean) => {
|
||||
forceActions.value = value;
|
||||
};
|
||||
const contextMenu = useContextMenu((action) => {
|
||||
if (action === 'change_color') {
|
||||
setForceActions(true);
|
||||
colorPopoverTrigger.value?.click();
|
||||
}
|
||||
});
|
||||
return { colorPopoverTrigger, contextMenu, forceActions, setForceActions };
|
||||
},
|
||||
props: {
|
||||
nodeViewScale: {
|
||||
@@ -208,17 +219,16 @@ export default defineComponent({
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
forceActions: false,
|
||||
isResizing: false,
|
||||
isTouchActive: false,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
onShowPopover() {
|
||||
this.forceActions = true;
|
||||
this.setForceActions(true);
|
||||
},
|
||||
onHidePopover() {
|
||||
this.forceActions = false;
|
||||
this.setForceActions(false);
|
||||
},
|
||||
async deleteNode() {
|
||||
// Wait a tick else vue causes problems because the data is gone
|
||||
|
||||
Reference in New Issue
Block a user