mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix: Show Ask AI only on Code Node (#6336)
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
>
|
||||
<div ref="codeNodeEditor" class="code-node-editor-input ph-no-capture"></div>
|
||||
<n8n-button
|
||||
v-if="isCloud && (isEditorHovered || isEditorFocused)"
|
||||
v-if="aiButtonEnabled && (isEditorHovered || isEditorFocused)"
|
||||
size="small"
|
||||
type="tertiary"
|
||||
:class="$style['ask-ai-button']"
|
||||
@@ -38,7 +38,6 @@ import { workflowHelpers } from '@/mixins/workflowHelpers'; // for json field co
|
||||
import { ASK_AI_MODAL_KEY, CODE_NODE_TYPE } from '@/constants';
|
||||
import { codeNodeEditorEventBus } from '@/event-bus';
|
||||
import { useRootStore } from '@/stores/n8nRoot.store';
|
||||
import { useSettingsStore } from '@/stores/settings.store';
|
||||
|
||||
import { readOnlyEditorExtensions, writableEditorExtensions } from './baseExtensions';
|
||||
import { CODE_PLACEHOLDERS } from './constants';
|
||||
@@ -50,6 +49,10 @@ export default defineComponent({
|
||||
name: 'code-node-editor',
|
||||
mixins: [linterExtension, completerExtension, workflowHelpers],
|
||||
props: {
|
||||
aiButtonEnabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
mode: {
|
||||
type: String as PropType<CodeExecutionMode>,
|
||||
validator: (value: CodeExecutionMode): boolean => CODE_EXECUTION_MODES.includes(value),
|
||||
@@ -97,9 +100,6 @@ export default defineComponent({
|
||||
},
|
||||
computed: {
|
||||
...mapStores(useRootStore),
|
||||
isCloud() {
|
||||
return useSettingsStore().deploymentType === 'cloud';
|
||||
},
|
||||
content(): string {
|
||||
if (!this.editor) return '';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user