From f73267ffa5b4a265ab6be52e887747487cae10c5 Mon Sep 17 00:00:00 2001 From: Alex Grozav Date: Wed, 14 Dec 2022 15:42:21 +0200 Subject: [PATCH] fix: Update permission for showing workflow caller policy (#4916) * fix: Update permission for showing workflow caller polic * fix: remove unused store setting --- packages/editor-ui/src/Interface.ts | 1 - .../src/components/WorkflowSettings.vue | 104 +++++++++--------- .../src/plugins/i18n/locales/en.json | 4 +- packages/editor-ui/src/stores/settings.ts | 3 - 4 files changed, 54 insertions(+), 58 deletions(-) diff --git a/packages/editor-ui/src/Interface.ts b/packages/editor-ui/src/Interface.ts index c785035a27..ff23feb45d 100644 --- a/packages/editor-ui/src/Interface.ts +++ b/packages/editor-ui/src/Interface.ts @@ -805,7 +805,6 @@ export interface IN8nUISettings { deployment?: { type: string; }; - isWorkflowSharingEnabled: boolean; } export interface IWorkflowSettings extends IWorkflowSettingsWorkflow { diff --git a/packages/editor-ui/src/components/WorkflowSettings.vue b/packages/editor-ui/src/components/WorkflowSettings.vue index d0186d4d18..108990d558 100644 --- a/packages/editor-ui/src/components/WorkflowSettings.vue +++ b/packages/editor-ui/src/components/WorkflowSettings.vue @@ -41,6 +41,56 @@ +
+ + + {{ $locale.baseText('workflowSettings.callerPolicy') + ':' }} + + + + + + + + + + + + + + + + {{ $locale.baseText('workflowSettings.callerIds') + ':' }} + + + + + + + + + +
{{ $locale.baseText('workflowSettings.timezone') + ':' }} @@ -181,56 +231,6 @@ -
- - - {{ $locale.baseText('workflowSettings.callerPolicy') + ':' }} - - - - - - - - - - - - - - - - {{ $locale.baseText('workflowSettings.callerIds') + ':' }} - - - - - - - - - -
{{ $locale.baseText('workflowSettings.timeoutWorkflow') + ':' }} @@ -327,7 +327,7 @@ import { WorkflowCallerPolicyDefaultOption, } from '@/Interface'; import Modal from './Modal.vue'; -import { PLACEHOLDER_EMPTY_WORKFLOW_ID, WORKFLOW_SETTINGS_MODAL_KEY } from '../constants'; +import {EnterpriseEditionFeature, PLACEHOLDER_EMPTY_WORKFLOW_ID, WORKFLOW_SETTINGS_MODAL_KEY} from '../constants'; import mixins from 'vue-typed-mixins'; @@ -402,7 +402,7 @@ export default mixins(externalHooks, genericHelpers, restApi, showMessage).exten return this.workflowsStore.workflowId; }, isWorkflowSharingEnabled(): boolean { - return this.settingsStore.isWorkflowSharingEnabled; + return this.settingsStore.isEnterpriseFeatureEnabled(EnterpriseEditionFeature.WorkflowSharing); }, }, async mounted() { diff --git a/packages/editor-ui/src/plugins/i18n/locales/en.json b/packages/editor-ui/src/plugins/i18n/locales/en.json index dc14bedcc6..b850975f19 100644 --- a/packages/editor-ui/src/plugins/i18n/locales/en.json +++ b/packages/editor-ui/src/plugins/i18n/locales/en.json @@ -1310,8 +1310,8 @@ "workflowSettings.callerIds": "Caller IDs", "workflowSettings.callerPolicy": "This workflow can be called by", "workflowSettings.callerPolicy.options.any": "Any workflow", - "workflowSettings.callerPolicy.options.workflowsFromAList": "List of specific workflow IDs", - "workflowSettings.callerPolicy.options.none": "No workflows can call one", + "workflowSettings.callerPolicy.options.workflowsFromAList": "Selected workflows", + "workflowSettings.callerPolicy.options.none": "No other workflows", "workflowSettings.defaultTimezone": "Default - {defaultTimezoneValue}", "workflowSettings.defaultTimezoneNotValid": "Default Timezone not valid", "workflowSettings.errorWorkflow": "Error Workflow", diff --git a/packages/editor-ui/src/stores/settings.ts b/packages/editor-ui/src/stores/settings.ts index e3c23dd744..a40a50990d 100644 --- a/packages/editor-ui/src/stores/settings.ts +++ b/packages/editor-ui/src/stores/settings.ts @@ -127,9 +127,6 @@ export const useSettingsStore = defineStore(STORES.SETTINGS, { isQueueModeEnabled(): boolean { return this.settings.executionMode === 'queue'; }, - isWorkflowSharingEnabled(): boolean { - return this.settings.isWorkflowSharingEnabled; - }, workflowCallerPolicyDefaultOption(): WorkflowCallerPolicyDefaultOption { return this.settings.workflowCallerPolicyDefaultOption; },