From da856d1c6593b43e1ce8d1becb1464c19c908e78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Tue, 30 May 2023 18:43:46 +0200 Subject: [PATCH] fix: Show `Ask AI` only on Code Node (#6336) --- .../src/components/CodeNodeEditor/CodeNodeEditor.vue | 10 +++++----- packages/editor-ui/src/components/ParameterInput.vue | 10 +++++++++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/packages/editor-ui/src/components/CodeNodeEditor/CodeNodeEditor.vue b/packages/editor-ui/src/components/CodeNodeEditor/CodeNodeEditor.vue index 1d98ae32c1..9deed663d1 100644 --- a/packages/editor-ui/src/components/CodeNodeEditor/CodeNodeEditor.vue +++ b/packages/editor-ui/src/components/CodeNodeEditor/CodeNodeEditor.vue @@ -7,7 +7,7 @@ >
, 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 ''; diff --git a/packages/editor-ui/src/components/ParameterInput.vue b/packages/editor-ui/src/components/ParameterInput.vue index 244570a4d3..682c465dba 100644 --- a/packages/editor-ui/src/components/ParameterInput.vue +++ b/packages/editor-ui/src/components/ParameterInput.vue @@ -91,6 +91,7 @@ :defaultValue="parameter.default" :language="editorLanguage" :isReadOnly="isReadOnly" + :aiButtonEnabled="settingsStore.isCloudDeployment" @valueChanged="valueChangedDebounced" /> @@ -387,6 +388,7 @@ import { useWorkflowsStore } from '@/stores/workflows.store'; import { useNDVStore } from '@/stores/ndv.store'; import { useNodeTypesStore } from '@/stores/nodeTypes.store'; import { useCredentialsStore } from '@/stores/credentials.store'; +import { useSettingsStore } from '@/stores/settings.store'; import { htmlEditorEventBus } from '@/event-bus'; import Vue from 'vue'; @@ -519,7 +521,13 @@ export default defineComponent({ }, }, computed: { - ...mapStores(useCredentialsStore, useNodeTypesStore, useNDVStore, useWorkflowsStore), + ...mapStores( + useCredentialsStore, + useNodeTypesStore, + useNDVStore, + useWorkflowsStore, + useSettingsStore, + ), expressionDisplayValue(): string { if (this.forceShowExpression) { return '';