From b1287ba8cb7f1334d62371e765670fead0f0c2c2 Mon Sep 17 00:00:00 2001 From: Alex Grozav Date: Tue, 29 Nov 2022 15:13:10 +0200 Subject: [PATCH] feat: Add dynamic translations. Change how sharing unavailable is handled (no-changelog) (#4758) * feat: Add dynamic translations. Change how sharing unavailable is handled (no-changelog) * fix: Add not-allowed cursor for disabled share button * fix: Remove fakedoor features from workflow details * fix: Remove fakedoor code from workflow share modal * fix: change dynamic translation to match shareModal title * chore: Removed unused import --- packages/editor-ui/src/Interface.ts | 5 ++++ .../components/MainHeader/WorkflowDetails.vue | 28 ++++++++++++++++++- .../src/components/WorkflowShareModal.ee.vue | 17 +++++------ .../src/plugins/i18n/locales/en.json | 16 +++++++---- packages/editor-ui/src/stores/ui.ts | 15 ++++++++++ packages/editor-ui/src/stores/webhooks.ts | 8 +++++- 6 files changed, 73 insertions(+), 16 deletions(-) diff --git a/packages/editor-ui/src/Interface.ts b/packages/editor-ui/src/Interface.ts index 0a7fed175e8c3..ca734f6ef6b44 100644 --- a/packages/editor-ui/src/Interface.ts +++ b/packages/editor-ui/src/Interface.ts @@ -1022,6 +1022,10 @@ export interface IModalState { httpNodeParameters?: string; } +export interface NestedRecord { + [key: string]: T | NestedRecord; +} + export type IRunDataDisplayMode = 'table' | 'json' | 'binary'; export type nodePanelType = 'input' | 'output'; @@ -1095,6 +1099,7 @@ export interface UIState { currentView: string; mainPanelPosition: number; fakeDoorFeatures: IFakeDoor[]; + dynamicTranslations: NestedRecord; draggable: { isDragging: boolean; type: string; diff --git a/packages/editor-ui/src/components/MainHeader/WorkflowDetails.vue b/packages/editor-ui/src/components/MainHeader/WorkflowDetails.vue index 9b6078b5531c0..099eabed5fc94 100644 --- a/packages/editor-ui/src/components/MainHeader/WorkflowDetails.vue +++ b/packages/editor-ui/src/components/MainHeader/WorkflowDetails.vue @@ -75,6 +75,25 @@ > {{ $locale.baseText('workflowDetails.share') }} + { + return this.uiStore.dynamicTranslations; + }, isWorkflowActive(): boolean { return this.workflowsStore.isWorkflowActive; }, @@ -548,4 +570,8 @@ $--header-spacing: 20px; .deleteItem { color: var(--color-danger); } + +.disabledShareButton { + cursor: not-allowed; +} diff --git a/packages/editor-ui/src/components/WorkflowShareModal.ee.vue b/packages/editor-ui/src/components/WorkflowShareModal.ee.vue index 05219fafb161a..51eb6a4a5c984 100644 --- a/packages/editor-ui/src/components/WorkflowShareModal.ee.vue +++ b/packages/editor-ui/src/components/WorkflowShareModal.ee.vue @@ -1,7 +1,7 @@