From 4ad932b05a2d59a698f44b6af1547549b6386130 Mon Sep 17 00:00:00 2001 From: Pooja Patil Date: Mon, 26 Apr 2021 21:44:42 -0700 Subject: [PATCH 1/5] Support deep linking for simulator --- .../toolbar/TreeBuilderToolbar.vue | 24 +++++++------------ src/router/trees.js | 5 ++++ src/store/clipboard/index.ts | 7 ++++++ src/views/InteractionDesigner.vue | 8 +++++-- 4 files changed, 26 insertions(+), 18 deletions(-) diff --git a/src/components/interaction-designer/toolbar/TreeBuilderToolbar.vue b/src/components/interaction-designer/toolbar/TreeBuilderToolbar.vue index ea83ba69f..0ce94dbdf 100644 --- a/src/components/interaction-designer/toolbar/TreeBuilderToolbar.vue +++ b/src/components/interaction-designer/toolbar/TreeBuilderToolbar.vue @@ -38,7 +38,7 @@ :class="{active: isEditable}" @click.native.prevent="handlePersistFlow(editOrViewTreeJsUrl)"> {{isEditable ? trans('flow-builder.view-flow') : trans('flow-builder.edit-flow')}} - + -
+
@@ -164,7 +164,7 @@ export default { ...mapGetters('flow', ['activeFlow']), ...mapGetters('builder', ['activeBlock', 'isEditable']), - ...mapGetters('clipboard', ['isSimulatorActive']), + ...mapGetters('clipboard', ['hasSimulator']), jsKey() { return lodash.get(this.selectedBlock, 'jsKey') @@ -238,6 +238,9 @@ export default { ele.scrollIntoView({ behavior: 'smooth', block: 'center' }) } } + if (this.$route.name === 'flow-simulator' && this.hasSimulator()) { + this.setSimulatorActive(true) + } }, 500) console.debug('Vuej tree interaction designer mounted!') }, @@ -255,6 +258,7 @@ export default { ...mapMutations('builder', ['activateBlock']), ...mapActions('builder', ['setIsEditable']), ...mapMutations('flow', ['flow_setActiveFlowId']), + ...mapActions('clipboard', ['setSimulatorActive']), ...mapActions([ 'attemptSaveTree', From 2d4b934358f1f33f5c781ea1fe174374c754dc07 Mon Sep 17 00:00:00 2001 From: Pooja Patil Date: Tue, 1 Jun 2021 18:50:38 -0700 Subject: [PATCH 2/5] VMO-3852 Removing extra space --- .../toolbar/TreeBuilderToolbar.vue | 28 ------------------- 1 file changed, 28 deletions(-) diff --git a/src/components/interaction-designer/toolbar/TreeBuilderToolbar.vue b/src/components/interaction-designer/toolbar/TreeBuilderToolbar.vue index 75034bdc5..41051339d 100644 --- a/src/components/interaction-designer/toolbar/TreeBuilderToolbar.vue +++ b/src/components/interaction-designer/toolbar/TreeBuilderToolbar.vue @@ -384,70 +384,42 @@ export default class TreeBuilderToolbar extends mixins(Routes, Permissions, Lang // ########### VUEX ############### @State(({ trees: { tree } }) => tree) tree!: any - @State(({ trees: { ui } }) => ui) ui!: any - @Getter isTreeSaving!: number | boolean - @Getter isBlockAvailableByBlockClass?: any - @Getter hasChanges!: boolean - @Getter isTreeValid!: boolean - @Getter selectedBlock?: IBlock - @Getter isFeatureTreeSaveEnabled!: boolean - @Getter isFeatureTreeSendEnabled!: boolean - @Getter isFeatureTreeDuplicateEnabled!: boolean - @Getter isFeatureViewResultsEnabled!: boolean - @Getter isFeatureSimulatorEnabled!: boolean - @Getter isFeatureUpdateInteractionTotalsEnabled!: boolean - @Getter isResourceEditorEnabled!: boolean - @Mutation setTreeSaving!: (isSaving: boolean) => void - @Action attemptSaveTree!: void // Flow @flowVuexNamespace.Getter activeFlow?: IFlow - @flowVuexNamespace.Getter activeFlowContainer?: IContext - @flowVuexNamespace.Getter hasOfflineMode?: boolean - @flowVuexNamespace.State flows?: IFlow[] - @flowVuexNamespace.State resources?: IResource[] - @flowVuexNamespace.Action flow_removeBlock!: ({ flowId, blockId }: { flowId?: string; blockId: IBlock['uuid'] | undefined }) => void - @flowVuexNamespace.Action flow_addBlankBlockByType!: ({ type, ...props }: Partial) => Promise - @flowVuexNamespace.Action flow_duplicateBlock!: ({ flowId, blockId }: { flowId?: string; blockId: IBlock['uuid'] | undefined }) => Promise - @flowVuexNamespace.Action flow_persist!: ({ persistRoute, flowContainer }: { persistRoute: any; flowContainer?: IContext }) => Promise // Builder @builderVuexNamespace.Getter isEditable!: boolean - @builderVuexNamespace.State activeBlockId?: IBlock['uuid'] - @builderVuexNamespace.Getter activeBlock?: IBlock - @builderVuexNamespace.Action importFlowsAndResources!: ({ flows, resources }: { flows: IFlow[]; resources: IResource[]}) => Promise - @builderVuexNamespace.Mutation activateBlock!: ({ blockId }: { blockId: IBlock['uuid'] | null}) => void // Clipboard @clipboardVuexNamespace.Action setSimulatorActive!: (value: boolean) => void - @clipboardVuexNamespace.Action hasSimulator!: () => boolean } From 13370846f979de19e30e96b7a6623a3d06992180 Mon Sep 17 00:00:00 2001 From: Pooja Patil Date: Tue, 1 Jun 2021 18:59:05 -0700 Subject: [PATCH 3/5] VMO-3852 Fix for TS error --- .../interaction-designer/toolbar/TreeBuilderToolbar.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/interaction-designer/toolbar/TreeBuilderToolbar.vue b/src/components/interaction-designer/toolbar/TreeBuilderToolbar.vue index 41051339d..a149c0a51 100644 --- a/src/components/interaction-designer/toolbar/TreeBuilderToolbar.vue +++ b/src/components/interaction-designer/toolbar/TreeBuilderToolbar.vue @@ -257,7 +257,7 @@ export default class TreeBuilderToolbar extends mixins(Routes, Permissions, Lang get editOrViewTreeJsUrl() { return { params: { - id: this.activeFlow.uuid, + id: this.activeFlow?.uuid, mode: this.isEditable ? 'view' : 'edit', }, } From 56985e5b91e37c1c6c830998adbe4b07aa5e8159 Mon Sep 17 00:00:00 2001 From: Pooja Patil Date: Mon, 28 Jun 2021 17:07:43 -0700 Subject: [PATCH 4/5] VMO-3852 Updating snapshot --- .../unit/__snapshots__/storybook.spec.ts.snap | 65 ++----------------- 1 file changed, 5 insertions(+), 60 deletions(-) diff --git a/tests/unit/__snapshots__/storybook.spec.ts.snap b/tests/unit/__snapshots__/storybook.spec.ts.snap index 55b4a5e2f..1f7a3fd09 100644 --- a/tests/unit/__snapshots__/storybook.spec.ts.snap +++ b/tests/unit/__snapshots__/storybook.spec.ts.snap @@ -473,18 +473,7 @@ exports[`Storyshots InteractionDesigner/Toolbar Edit Flow 1`] = ` -
- -
+
-
- -
+
-
- -
+
-
- -
+
-
- -
+
Date: Thu, 12 Aug 2021 22:37:25 -0700 Subject: [PATCH 5/5] VMO-3852 Some minor fixes --- src/store/clipboard/index.ts | 2 +- src/views/InteractionDesigner.vue | 14 -------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/src/store/clipboard/index.ts b/src/store/clipboard/index.ts index 9effba04c..3a6dbe1b1 100644 --- a/src/store/clipboard/index.ts +++ b/src/store/clipboard/index.ts @@ -40,7 +40,7 @@ export const mutations: MutationTree = { export const actions: ActionTree = { setSimulatorActive({ commit }, value) { commit('setSimulatorActive', value) - const routeName = value ? 'flow-simulator' : 'flow-details' + const routeName = value ? 'flow-simulator' : 'flow-canvas' router.replace({ name: routeName, }) diff --git a/src/views/InteractionDesigner.vue b/src/views/InteractionDesigner.vue index 88c6871af..fd62a5d92 100644 --- a/src/views/InteractionDesigner.vue +++ b/src/views/InteractionDesigner.vue @@ -10,20 +10,6 @@ v-if="isSimulatorActive" class="tree-sidebar-container" :class="{ 'slide-out': !$route.meta.isSidebarShown,}"> - -