Skip to content

Commit

Permalink
✨ Handling production execution mode to hide the pin data in node det…
Browse files Browse the repository at this point in the history
…ails view
  • Loading branch information
MiloradFilipovic committed Nov 14, 2022
1 parent a3826df commit eb2bf04
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 2 deletions.
5 changes: 5 additions & 0 deletions packages/editor-ui/src/components/InputPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
:mappingEnabled="!readOnly"
:showMappingHint="draggableHintShown"
:distanceFromActive="currentNodeDepth"
:isProductionExecutionPreview="isProductionExecutionPreview"
paneType="input"
@itemHover="$emit('itemHover', $event)"
@linkRun="onLinkRun"
Expand Down Expand Up @@ -107,6 +108,10 @@ export default mixins(
readOnly: {
type: Boolean,
},
isProductionExecutionPreview: {
type: Boolean,
default: false,
},
},
data() {
return {
Expand Down
2 changes: 2 additions & 0 deletions packages/editor-ui/src/components/NodeDetailsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
:currentNodeName="inputNodeName"
:sessionId="sessionId"
:readOnly="readOnly || hasForeignCredential"
:isProductionExecutionPreview="isProductionExecutionPreview"
@linkRun="onLinkRunToInput"
@unlinkRun="() => onUnlinkRun('input')"
@runChange="onRunInputIndexChange"
Expand All @@ -73,6 +74,7 @@
:sessionId="sessionId"
:isReadOnly="readOnly || hasForeignCredential"
:blockUI="blockUi && isTriggerNode"
:isProductionExecutionPreview="isProductionExecutionPreview"
@linkRun="onLinkRunToOutput"
@unlinkRun="() => onUnlinkRun('output')"
@runChange="onRunOutputIndexChange"
Expand Down
5 changes: 5 additions & 0 deletions packages/editor-ui/src/components/OutputPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
:sessionId="sessionId"
:isReadOnly="isReadOnly"
:blockUI="blockUI"
:isProductionExecutionPreview="isProductionExecutionPreview"
paneType="output"
@runChange="onRunIndexChange"
@linkRun="onLinkRun"
Expand Down Expand Up @@ -119,6 +120,10 @@ export default mixins(
type: Boolean,
default: false,
},
isProductionExecutionPreview: {
type: Boolean,
default: false,
},
},
computed: {
...mapStores(
Expand Down
8 changes: 6 additions & 2 deletions packages/editor-ui/src/components/RunData.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div :class="$style.container">
<n8n-callout
v-if="canPinData && hasPinData && !editMode.enabled"
v-if="canPinData && hasPinData && !editMode.enabled && !isProductionExecutionPreview"
theme="secondary"
icon="thumbtack"
:class="$style['pinned-data-callout']"
Expand Down Expand Up @@ -448,6 +448,10 @@ export default mixins(
type: Boolean,
default: false,
},
isProductionExecutionPreview: {
type: Boolean,
default: false,
},
},
data () {
return {
Expand Down Expand Up @@ -630,7 +634,7 @@ export default mixins(
inputData (): INodeExecutionData[] {
let inputData = this.rawInputData;
if (this.node && this.pinData) {
if (this.node && this.pinData && !this.isProductionExecutionPreview) {
inputData = Array.isArray(this.pinData)
? this.pinData.map((value) => ({
json: value,
Expand Down
3 changes: 3 additions & 0 deletions packages/editor-ui/src/views/NodeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
<node-details-view
:readOnly="isReadOnly"
:renaming="renamingActive"
:isProductionExecutionPreview="isProductionExecutionPreview"
@valueChanged="valueChanged"
@stopExecution="stopExecution"
/>
Expand Down Expand Up @@ -3137,6 +3138,8 @@ export default mixins(
}
} else if (json && json.command === 'openExecution') {
try {
// If this NodeView is used in preview mode (in iframe) it will not have access to the main app store
// so everything it needs has to be sent using post messages and passed down to child components
this.isProductionExecutionPreview = json.executionMode !== 'manual';
await this.openExecution(json.executionId);
Expand Down

0 comments on commit eb2bf04

Please sign in to comment.