2019-06-23 03:35:23 -07:00
|
|
|
<template>
|
2022-12-14 01:04:10 -08:00
|
|
|
<div
|
|
|
|
:class="{
|
|
|
|
'node-settings': true,
|
|
|
|
dragging: dragging,
|
|
|
|
}"
|
|
|
|
@keydown.stop
|
|
|
|
>
|
2022-04-11 06:12:13 -07:00
|
|
|
<div :class="$style.header">
|
|
|
|
<div class="header-side-menu">
|
2022-09-29 14:28:02 -07:00
|
|
|
<NodeTitle
|
|
|
|
class="node-name"
|
|
|
|
:value="node && node.name"
|
|
|
|
:nodeType="nodeType"
|
2022-10-24 11:17:25 -07:00
|
|
|
:isReadOnly="isReadOnly"
|
2022-09-29 14:28:02 -07:00
|
|
|
@input="nameChanged"
|
|
|
|
></NodeTitle>
|
2022-12-06 02:15:07 -08:00
|
|
|
<div v-if="isExecutable">
|
2022-07-20 08:50:39 -07:00
|
|
|
<NodeExecuteButton
|
2022-10-31 10:59:53 -07:00
|
|
|
v-if="!blockUI"
|
2023-01-18 06:48:36 -08:00
|
|
|
data-test-id="node-execute-button"
|
2022-07-20 08:50:39 -07:00
|
|
|
:nodeName="node.name"
|
2022-10-31 10:59:53 -07:00
|
|
|
:disabled="outputPanelEditMode.enabled && !isTriggerNode"
|
2022-07-20 08:50:39 -07:00
|
|
|
size="small"
|
|
|
|
telemetrySource="parameters"
|
|
|
|
@execute="onNodeExecute"
|
2022-10-31 10:59:53 -07:00
|
|
|
@stopExecution="onStopExecution"
|
2022-07-20 08:50:39 -07:00
|
|
|
/>
|
2022-04-11 06:12:13 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
2022-09-29 14:28:02 -07:00
|
|
|
<NodeSettingsTabs
|
|
|
|
v-if="node && nodeValid"
|
|
|
|
v-model="openPanel"
|
|
|
|
:nodeType="nodeType"
|
|
|
|
:sessionId="sessionId"
|
|
|
|
/>
|
2019-06-23 03:35:23 -07:00
|
|
|
</div>
|
|
|
|
<div class="node-is-not-valid" v-if="node && !nodeValid">
|
2022-07-20 07:24:03 -07:00
|
|
|
<p :class="$style.warningIcon">
|
|
|
|
<font-awesome-icon icon="exclamation-triangle" />
|
|
|
|
</p>
|
|
|
|
<div class="missingNodeTitleContainer mt-s mb-xs">
|
|
|
|
<n8n-text size="large" color="text-dark" bold>
|
|
|
|
{{ $locale.baseText('nodeSettings.communityNodeUnknown.title') }}
|
|
|
|
</n8n-text>
|
|
|
|
</div>
|
|
|
|
<div v-if="isCommunityNode" :class="$style.descriptionContainer">
|
|
|
|
<div class="mb-l">
|
2022-12-14 01:04:10 -08:00
|
|
|
<i18n
|
|
|
|
path="nodeSettings.communityNodeUnknown.description"
|
|
|
|
tag="span"
|
|
|
|
@click="onMissingNodeTextClick"
|
|
|
|
>
|
2022-09-05 07:36:22 -07:00
|
|
|
<template #action>
|
|
|
|
<a
|
|
|
|
:href="`https://www.npmjs.com/package/${node.type.split('.')[0]}`"
|
|
|
|
target="_blank"
|
2022-12-14 01:04:10 -08:00
|
|
|
>{{ node.type.split('.')[0] }}</a
|
|
|
|
>
|
2022-09-05 07:36:22 -07:00
|
|
|
</template>
|
|
|
|
</i18n>
|
2022-07-20 07:24:03 -07:00
|
|
|
</div>
|
|
|
|
<n8n-link
|
|
|
|
:to="COMMUNITY_NODES_INSTALLATION_DOCS_URL"
|
|
|
|
@click="onMissingNodeLearnMoreLinkClick"
|
|
|
|
>
|
|
|
|
{{ $locale.baseText('nodeSettings.communityNodeUnknown.installLink.text') }}
|
|
|
|
</n8n-link>
|
|
|
|
</div>
|
2022-09-05 07:36:22 -07:00
|
|
|
<i18n v-else path="nodeSettings.nodeTypeUnknown.description" tag="span">
|
|
|
|
<template #action>
|
|
|
|
<a
|
|
|
|
:href="CUSTOM_NODES_DOCS_URL"
|
|
|
|
target="_blank"
|
|
|
|
v-text="$locale.baseText('nodeSettings.nodeTypeUnknown.description.customNode')"
|
|
|
|
/>
|
|
|
|
</template>
|
|
|
|
</i18n>
|
2019-06-23 03:35:23 -07:00
|
|
|
</div>
|
2022-12-14 01:04:10 -08:00
|
|
|
<div class="node-parameters-wrapper" data-test-id="node-parameters" v-if="node && nodeValid">
|
2022-12-06 02:15:07 -08:00
|
|
|
<n8n-notice
|
|
|
|
v-if="hasForeignCredential"
|
2022-12-14 01:04:10 -08:00
|
|
|
:content="
|
|
|
|
$locale.baseText('nodeSettings.hasForeignCredential', {
|
|
|
|
interpolate: { owner: workflowOwnerName },
|
|
|
|
})
|
|
|
|
"
|
2022-12-06 02:15:07 -08:00
|
|
|
/>
|
2022-04-11 06:12:13 -07:00
|
|
|
<div v-show="openPanel === 'params'">
|
2022-09-29 14:28:02 -07:00
|
|
|
<node-webhooks :node="node" :nodeType="nodeType" />
|
|
|
|
|
2022-05-24 02:36:19 -07:00
|
|
|
<parameter-input-list
|
|
|
|
:parameters="parametersNoneSetting"
|
|
|
|
:hideDelete="true"
|
2022-09-29 14:28:02 -07:00
|
|
|
:nodeValues="nodeValues"
|
2022-10-24 11:17:25 -07:00
|
|
|
:isReadOnly="isReadOnly"
|
2023-01-16 05:55:58 -08:00
|
|
|
:hiddenIssuesInputs="hiddenIssuesInputs"
|
2022-09-29 14:28:02 -07:00
|
|
|
path="parameters"
|
|
|
|
@valueChanged="valueChanged"
|
2022-06-20 12:39:24 -07:00
|
|
|
@activate="onWorkflowActivate"
|
2023-01-16 05:55:58 -08:00
|
|
|
@parameterBlur="onParameterBlur"
|
2022-05-24 02:36:19 -07:00
|
|
|
>
|
2022-12-14 01:04:10 -08:00
|
|
|
<node-credentials
|
|
|
|
:node="node"
|
|
|
|
:readonly="isReadOnly"
|
|
|
|
@credentialSelected="credentialSelected"
|
2023-01-16 05:55:58 -08:00
|
|
|
@blur="onParameterBlur"
|
|
|
|
:hide-issues="hiddenIssuesInputs.includes('credentials')"
|
2022-12-14 01:04:10 -08:00
|
|
|
/>
|
2022-05-24 02:36:19 -07:00
|
|
|
</parameter-input-list>
|
2022-04-11 06:12:13 -07:00
|
|
|
<div v-if="parametersNoneSetting.length === 0" class="no-parameters">
|
|
|
|
<n8n-text>
|
2022-05-24 02:36:19 -07:00
|
|
|
{{ $locale.baseText('nodeSettings.thisNodeDoesNotHaveAnyParameters') }}
|
2022-04-11 06:12:13 -07:00
|
|
|
</n8n-text>
|
|
|
|
</div>
|
2022-05-24 02:36:19 -07:00
|
|
|
|
|
|
|
<div v-if="isCustomApiCallSelected(nodeValues)" class="parameter-item parameter-notice">
|
|
|
|
<n8n-notice
|
2022-09-29 14:28:02 -07:00
|
|
|
:content="
|
|
|
|
$locale.baseText('nodeSettings.useTheHttpRequestNode', {
|
|
|
|
interpolate: { nodeTypeDisplayName: nodeType.displayName },
|
|
|
|
})
|
|
|
|
"
|
2022-05-24 02:36:19 -07:00
|
|
|
/>
|
|
|
|
</div>
|
2022-04-11 06:12:13 -07:00
|
|
|
</div>
|
|
|
|
<div v-show="openPanel === 'settings'">
|
2022-09-29 14:28:02 -07:00
|
|
|
<parameter-input-list
|
|
|
|
:parameters="parametersSetting"
|
|
|
|
:nodeValues="nodeValues"
|
2022-10-24 11:17:25 -07:00
|
|
|
:isReadOnly="isReadOnly"
|
2023-01-16 05:55:58 -08:00
|
|
|
:hiddenIssuesInputs="hiddenIssuesInputs"
|
2022-09-29 14:28:02 -07:00
|
|
|
path="parameters"
|
|
|
|
@valueChanged="valueChanged"
|
2023-01-16 05:55:58 -08:00
|
|
|
@parameterBlur="onParameterBlur"
|
2022-09-29 14:28:02 -07:00
|
|
|
/>
|
|
|
|
<parameter-input-list
|
|
|
|
:parameters="nodeSettings"
|
|
|
|
:hideDelete="true"
|
|
|
|
:nodeValues="nodeValues"
|
2022-10-24 11:17:25 -07:00
|
|
|
:isReadOnly="isReadOnly"
|
2023-01-16 05:55:58 -08:00
|
|
|
:hiddenIssuesInputs="hiddenIssuesInputs"
|
2022-09-29 14:28:02 -07:00
|
|
|
path=""
|
|
|
|
@valueChanged="valueChanged"
|
2023-01-16 05:55:58 -08:00
|
|
|
@parameterBlur="onParameterBlur"
|
2022-09-29 14:28:02 -07:00
|
|
|
/>
|
2022-04-11 06:12:13 -07:00
|
|
|
</div>
|
2019-06-23 03:35:23 -07:00
|
|
|
</div>
|
2022-10-31 10:59:53 -07:00
|
|
|
<n8n-block-ui :show="blockUI" />
|
2019-06-23 03:35:23 -07:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2022-09-22 08:41:15 -07:00
|
|
|
import Vue, { PropType } from 'vue';
|
2019-06-23 03:35:23 -07:00
|
|
|
import {
|
|
|
|
INodeTypeDescription,
|
|
|
|
INodeParameters,
|
|
|
|
INodeProperties,
|
|
|
|
NodeHelpers,
|
|
|
|
NodeParameterValue,
|
2022-10-18 04:33:31 -07:00
|
|
|
deepCopy,
|
2019-06-23 03:35:23 -07:00
|
|
|
} from 'n8n-workflow';
|
2022-09-29 14:28:02 -07:00
|
|
|
import { INodeUi, INodeUpdatePropertiesInformation, IUpdateInformation } from '@/Interface';
|
2019-06-23 03:35:23 -07:00
|
|
|
|
2022-07-20 07:24:03 -07:00
|
|
|
import {
|
|
|
|
COMMUNITY_NODES_INSTALLATION_DOCS_URL,
|
|
|
|
CUSTOM_NODES_DOCS_URL,
|
2022-09-22 08:41:15 -07:00
|
|
|
MAIN_NODE_PANEL_WIDTH,
|
2022-09-29 14:28:02 -07:00
|
|
|
IMPORT_CURL_MODAL_KEY,
|
2022-09-22 08:41:15 -07:00
|
|
|
} from '@/constants';
|
2022-07-20 07:24:03 -07:00
|
|
|
|
2022-04-11 06:12:13 -07:00
|
|
|
import NodeTitle from '@/components/NodeTitle.vue';
|
2019-06-23 03:35:23 -07:00
|
|
|
import ParameterInputFull from '@/components/ParameterInputFull.vue';
|
|
|
|
import ParameterInputList from '@/components/ParameterInputList.vue';
|
|
|
|
import NodeCredentials from '@/components/NodeCredentials.vue';
|
2022-05-23 08:56:15 -07:00
|
|
|
import NodeSettingsTabs from '@/components/NodeSettingsTabs.vue';
|
2019-06-23 03:35:23 -07:00
|
|
|
import NodeWebhooks from '@/components/NodeWebhooks.vue';
|
2020-01-23 15:57:34 -08:00
|
|
|
import { get, set, unset } from 'lodash';
|
2019-06-23 03:35:23 -07:00
|
|
|
|
2022-11-23 04:41:53 -08:00
|
|
|
import { externalHooks } from '@/mixins/externalHooks';
|
|
|
|
import { nodeHelpers } from '@/mixins/nodeHelpers';
|
2019-06-23 03:35:23 -07:00
|
|
|
|
|
|
|
import mixins from 'vue-typed-mixins';
|
2022-04-11 06:12:13 -07:00
|
|
|
import NodeExecuteButton from './NodeExecuteButton.vue';
|
2022-11-23 04:41:53 -08:00
|
|
|
import { isCommunityPackageName } from '@/utils';
|
2022-11-04 06:04:31 -07:00
|
|
|
import { mapStores } from 'pinia';
|
|
|
|
import { useUIStore } from '@/stores/ui';
|
|
|
|
import { useWorkflowsStore } from '@/stores/workflows';
|
|
|
|
import { useNDVStore } from '@/stores/ndv';
|
|
|
|
import { useNodeTypesStore } from '@/stores/nodeTypes';
|
2022-12-09 06:07:37 -08:00
|
|
|
import { useHistoryStore } from '@/stores/history';
|
|
|
|
import { RenameNodeCommand } from '@/models/history';
|
2022-12-14 01:04:10 -08:00
|
|
|
import useWorkflowsEEStore from '@/stores/workflows.ee';
|
2019-06-23 03:35:23 -07:00
|
|
|
|
2022-10-24 11:17:25 -07:00
|
|
|
export default mixins(externalHooks, nodeHelpers).extend({
|
2022-09-29 14:28:02 -07:00
|
|
|
name: 'NodeSettings',
|
|
|
|
components: {
|
|
|
|
NodeTitle,
|
|
|
|
NodeCredentials,
|
|
|
|
ParameterInputFull,
|
|
|
|
ParameterInputList,
|
|
|
|
NodeSettingsTabs,
|
|
|
|
NodeWebhooks,
|
|
|
|
NodeExecuteButton,
|
|
|
|
},
|
|
|
|
computed: {
|
2022-11-04 06:04:31 -07:00
|
|
|
...mapStores(
|
2022-12-09 06:07:37 -08:00
|
|
|
useHistoryStore,
|
2022-11-04 06:04:31 -07:00
|
|
|
useNodeTypesStore,
|
|
|
|
useNDVStore,
|
|
|
|
useUIStore,
|
|
|
|
useWorkflowsStore,
|
2022-12-13 00:55:31 -08:00
|
|
|
useWorkflowsEEStore,
|
2022-11-04 06:04:31 -07:00
|
|
|
),
|
|
|
|
isCurlImportModalOpen(): boolean {
|
|
|
|
return this.uiStore.isModalOpen(IMPORT_CURL_MODAL_KEY);
|
2019-06-23 03:35:23 -07:00
|
|
|
},
|
2022-12-06 02:15:07 -08:00
|
|
|
isReadOnly(): boolean {
|
|
|
|
return this.readOnly || this.hasForeignCredential;
|
|
|
|
},
|
|
|
|
isExecutable(): boolean {
|
|
|
|
return this.executable || this.hasForeignCredential;
|
|
|
|
},
|
2022-09-29 14:28:02 -07:00
|
|
|
nodeTypeName(): string {
|
|
|
|
if (this.nodeType) {
|
|
|
|
const shortNodeType = this.$locale.shortNodeType(this.nodeType.name);
|
2021-11-18 02:32:13 -08:00
|
|
|
|
2022-09-29 14:28:02 -07:00
|
|
|
return this.$locale.headerText({
|
|
|
|
key: `headers.${shortNodeType}.displayName`,
|
|
|
|
fallback: this.nodeType.name,
|
|
|
|
});
|
|
|
|
}
|
2021-11-18 02:32:13 -08:00
|
|
|
|
2022-09-29 14:28:02 -07:00
|
|
|
return '';
|
|
|
|
},
|
|
|
|
nodeTypeDescription(): string {
|
|
|
|
if (this.nodeType && this.nodeType.description) {
|
|
|
|
const shortNodeType = this.$locale.shortNodeType(this.nodeType.name);
|
2019-06-23 03:35:23 -07:00
|
|
|
|
2022-09-29 14:28:02 -07:00
|
|
|
return this.$locale.headerText({
|
|
|
|
key: `headers.${shortNodeType}.description`,
|
|
|
|
fallback: this.nodeType.description,
|
2019-06-23 03:35:23 -07:00
|
|
|
});
|
2022-09-29 14:28:02 -07:00
|
|
|
} else {
|
|
|
|
return this.$locale.baseText('nodeSettings.noDescriptionFound');
|
|
|
|
}
|
|
|
|
},
|
|
|
|
headerStyle(): object {
|
|
|
|
if (!this.node) {
|
|
|
|
return {};
|
|
|
|
}
|
2019-06-23 03:35:23 -07:00
|
|
|
|
2022-09-29 14:28:02 -07:00
|
|
|
return {
|
|
|
|
'background-color': this.node.color,
|
|
|
|
};
|
2022-04-11 06:12:13 -07:00
|
|
|
},
|
2022-11-04 06:04:31 -07:00
|
|
|
node(): INodeUi | null {
|
|
|
|
return this.ndvStore.activeNode;
|
2019-06-23 03:35:23 -07:00
|
|
|
},
|
2022-09-29 14:28:02 -07:00
|
|
|
parametersSetting(): INodeProperties[] {
|
|
|
|
return this.parameters.filter((item) => {
|
|
|
|
return item.isNodeSetting;
|
|
|
|
});
|
|
|
|
},
|
|
|
|
parametersNoneSetting(): INodeProperties[] {
|
|
|
|
return this.parameters.filter((item) => {
|
|
|
|
return !item.isNodeSetting;
|
|
|
|
});
|
|
|
|
},
|
|
|
|
parameters(): INodeProperties[] {
|
|
|
|
if (this.nodeType === null) {
|
|
|
|
return [];
|
|
|
|
}
|
|
|
|
|
|
|
|
return this.nodeType.properties;
|
|
|
|
},
|
|
|
|
outputPanelEditMode(): { enabled: boolean; value: string } {
|
2022-11-04 06:04:31 -07:00
|
|
|
return this.ndvStore.outputPanelEditMode;
|
2022-09-29 14:28:02 -07:00
|
|
|
},
|
|
|
|
isCommunityNode(): boolean {
|
|
|
|
return isCommunityPackageName(this.node.type);
|
|
|
|
},
|
2022-10-31 10:59:53 -07:00
|
|
|
isTriggerNode(): boolean {
|
2022-11-04 06:04:31 -07:00
|
|
|
return this.nodeTypesStore.isTriggerNode(this.node.type);
|
2022-10-31 10:59:53 -07:00
|
|
|
},
|
2022-12-13 00:55:31 -08:00
|
|
|
workflowOwnerName(): string {
|
|
|
|
return this.workflowsEEStore.getWorkflowOwnerName(`${this.workflowsStore.workflowId}`);
|
|
|
|
},
|
2022-09-29 14:28:02 -07:00
|
|
|
},
|
|
|
|
props: {
|
|
|
|
eventBus: {},
|
|
|
|
dragging: {
|
|
|
|
type: Boolean,
|
|
|
|
},
|
|
|
|
sessionId: {
|
|
|
|
type: String,
|
|
|
|
},
|
|
|
|
nodeType: {
|
|
|
|
type: Object as PropType<INodeTypeDescription>,
|
|
|
|
},
|
2022-12-06 02:15:07 -08:00
|
|
|
readOnly: {
|
2022-10-24 11:17:25 -07:00
|
|
|
type: Boolean,
|
2022-12-06 02:15:07 -08:00
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
hasForeignCredential: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
2022-10-24 11:17:25 -07:00
|
|
|
},
|
2022-10-31 10:59:53 -07:00
|
|
|
blockUI: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
2022-11-15 04:25:04 -08:00
|
|
|
executable: {
|
|
|
|
type: Boolean,
|
|
|
|
default: true,
|
|
|
|
},
|
2022-09-29 14:28:02 -07:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
nodeValid: true,
|
|
|
|
nodeColor: null,
|
|
|
|
openPanel: 'params',
|
|
|
|
nodeValues: {
|
|
|
|
color: '#ff0000',
|
|
|
|
alwaysOutputData: false,
|
|
|
|
executeOnce: false,
|
|
|
|
notesInFlow: false,
|
|
|
|
continueOnFail: false,
|
|
|
|
retryOnFail: false,
|
|
|
|
maxTries: 3,
|
|
|
|
waitBetweenTries: 1000,
|
|
|
|
notes: '',
|
|
|
|
parameters: {},
|
|
|
|
} as INodeParameters,
|
|
|
|
|
|
|
|
nodeSettings: [
|
|
|
|
{
|
|
|
|
displayName: this.$locale.baseText('nodeSettings.alwaysOutputData.displayName'),
|
|
|
|
name: 'alwaysOutputData',
|
|
|
|
type: 'boolean',
|
|
|
|
default: false,
|
|
|
|
noDataExpression: true,
|
|
|
|
description: this.$locale.baseText('nodeSettings.alwaysOutputData.description'),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: this.$locale.baseText('nodeSettings.executeOnce.displayName'),
|
|
|
|
name: 'executeOnce',
|
|
|
|
type: 'boolean',
|
|
|
|
default: false,
|
|
|
|
noDataExpression: true,
|
|
|
|
description: this.$locale.baseText('nodeSettings.executeOnce.description'),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: this.$locale.baseText('nodeSettings.retryOnFail.displayName'),
|
|
|
|
name: 'retryOnFail',
|
|
|
|
type: 'boolean',
|
|
|
|
default: false,
|
|
|
|
noDataExpression: true,
|
|
|
|
description: this.$locale.baseText('nodeSettings.retryOnFail.description'),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: this.$locale.baseText('nodeSettings.maxTries.displayName'),
|
|
|
|
name: 'maxTries',
|
|
|
|
type: 'number',
|
|
|
|
typeOptions: {
|
|
|
|
minValue: 2,
|
|
|
|
maxValue: 5,
|
2019-07-18 10:26:16 -07:00
|
|
|
},
|
2022-09-29 14:28:02 -07:00
|
|
|
default: 3,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
retryOnFail: [true],
|
2019-07-18 10:26:16 -07:00
|
|
|
},
|
|
|
|
},
|
2022-09-29 14:28:02 -07:00
|
|
|
noDataExpression: true,
|
|
|
|
description: this.$locale.baseText('nodeSettings.maxTries.description'),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: this.$locale.baseText('nodeSettings.waitBetweenTries.displayName'),
|
|
|
|
name: 'waitBetweenTries',
|
|
|
|
type: 'number',
|
|
|
|
typeOptions: {
|
|
|
|
minValue: 0,
|
|
|
|
maxValue: 5000,
|
2019-07-18 10:26:16 -07:00
|
|
|
},
|
2022-09-29 14:28:02 -07:00
|
|
|
default: 1000,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
retryOnFail: [true],
|
2022-06-03 08:43:37 -07:00
|
|
|
},
|
|
|
|
},
|
2022-09-29 14:28:02 -07:00
|
|
|
noDataExpression: true,
|
|
|
|
description: this.$locale.baseText('nodeSettings.waitBetweenTries.description'),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: this.$locale.baseText('nodeSettings.continueOnFail.displayName'),
|
|
|
|
name: 'continueOnFail',
|
|
|
|
type: 'boolean',
|
|
|
|
default: false,
|
|
|
|
noDataExpression: true,
|
|
|
|
description: this.$locale.baseText('nodeSettings.continueOnFail.description'),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: this.$locale.baseText('nodeSettings.notes.displayName'),
|
|
|
|
name: 'notes',
|
|
|
|
type: 'string',
|
|
|
|
typeOptions: {
|
|
|
|
rows: 5,
|
2022-06-03 08:43:37 -07:00
|
|
|
},
|
2022-09-29 14:28:02 -07:00
|
|
|
default: '',
|
|
|
|
noDataExpression: true,
|
|
|
|
description: this.$locale.baseText('nodeSettings.notes.description'),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: this.$locale.baseText('nodeSettings.notesInFlow.displayName'),
|
|
|
|
name: 'notesInFlow',
|
|
|
|
type: 'boolean',
|
|
|
|
default: false,
|
|
|
|
noDataExpression: true,
|
|
|
|
description: this.$locale.baseText('nodeSettings.notesInFlow.description'),
|
|
|
|
},
|
|
|
|
] as INodeProperties[],
|
|
|
|
COMMUNITY_NODES_INSTALLATION_DOCS_URL,
|
|
|
|
CUSTOM_NODES_DOCS_URL,
|
|
|
|
MAIN_NODE_PANEL_WIDTH,
|
2023-01-16 05:55:58 -08:00
|
|
|
hiddenIssuesInputs: [] as string[],
|
2022-09-29 14:28:02 -07:00
|
|
|
};
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
node(newNode, oldNode) {
|
|
|
|
this.setNodeValues();
|
|
|
|
},
|
|
|
|
isCurlImportModalOpen(newValue, oldValue) {
|
|
|
|
if (newValue === false) {
|
2022-11-04 06:04:31 -07:00
|
|
|
let parameters = this.uiStore.getHttpNodeParameters || '';
|
2022-09-29 14:28:02 -07:00
|
|
|
|
|
|
|
if (!parameters) return;
|
|
|
|
|
|
|
|
try {
|
|
|
|
parameters = JSON.parse(parameters) as {
|
2022-12-15 05:06:00 -08:00
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
2022-09-29 14:28:02 -07:00
|
|
|
[key: string]: any;
|
|
|
|
};
|
|
|
|
|
|
|
|
//@ts-ignore
|
|
|
|
this.valueChanged({
|
|
|
|
node: this.node.name,
|
|
|
|
name: 'parameters',
|
|
|
|
value: parameters,
|
|
|
|
});
|
|
|
|
|
2022-11-04 06:04:31 -07:00
|
|
|
this.uiStore.setHttpNodeParameters({ name: IMPORT_CURL_MODAL_KEY, parameters: '' });
|
2022-09-29 14:28:02 -07:00
|
|
|
} catch (_) {}
|
|
|
|
}
|
2019-06-23 03:35:23 -07:00
|
|
|
},
|
2022-09-29 14:28:02 -07:00
|
|
|
},
|
|
|
|
methods: {
|
2023-01-16 05:55:58 -08:00
|
|
|
populateHiddenIssuesSet() {
|
|
|
|
if (!this.node || !this.workflowsStore.isNodePristine(this.node.name)) return;
|
|
|
|
|
|
|
|
this.hiddenIssuesInputs.push('credentials');
|
|
|
|
this.parametersNoneSetting.forEach((parameter) => {
|
|
|
|
this.hiddenIssuesInputs.push(parameter.name);
|
|
|
|
});
|
|
|
|
|
|
|
|
this.workflowsStore.setNodePristine(this.node.name, false);
|
|
|
|
},
|
|
|
|
onParameterBlur(parameterName: string) {
|
|
|
|
this.hiddenIssuesInputs = this.hiddenIssuesInputs.filter((name) => name !== parameterName);
|
|
|
|
},
|
2022-09-29 14:28:02 -07:00
|
|
|
onWorkflowActivate() {
|
2023-01-16 05:55:58 -08:00
|
|
|
this.hiddenIssuesInputs = [];
|
2022-09-29 14:28:02 -07:00
|
|
|
this.$emit('activate');
|
2019-06-23 03:35:23 -07:00
|
|
|
},
|
2022-09-29 14:28:02 -07:00
|
|
|
onNodeExecute() {
|
2023-01-16 05:55:58 -08:00
|
|
|
this.hiddenIssuesInputs = [];
|
2022-09-29 14:28:02 -07:00
|
|
|
this.$emit('execute');
|
|
|
|
},
|
|
|
|
setValue(name: string, value: NodeParameterValue) {
|
|
|
|
const nameParts = name.split('.');
|
|
|
|
let lastNamePart: string | undefined = nameParts.pop();
|
|
|
|
|
|
|
|
let isArray = false;
|
|
|
|
if (lastNamePart !== undefined && lastNamePart.includes('[')) {
|
2023-01-16 05:55:58 -08:00
|
|
|
// It includes an index so we have to extract it
|
2022-09-29 14:28:02 -07:00
|
|
|
const lastNameParts = lastNamePart.match(/(.*)\[(\d+)\]$/);
|
|
|
|
if (lastNameParts) {
|
|
|
|
nameParts.push(lastNameParts[1]);
|
|
|
|
lastNamePart = lastNameParts[2];
|
|
|
|
isArray = true;
|
2019-06-23 03:35:23 -07:00
|
|
|
}
|
2022-09-29 14:28:02 -07:00
|
|
|
}
|
2019-06-23 03:35:23 -07:00
|
|
|
|
2022-09-29 14:28:02 -07:00
|
|
|
// Set the value via Vue.set that everything updates correctly in the UI
|
|
|
|
if (nameParts.length === 0) {
|
|
|
|
// Data is on top level
|
|
|
|
if (value === null) {
|
|
|
|
// Property should be deleted
|
|
|
|
// @ts-ignore
|
|
|
|
Vue.delete(this.nodeValues, lastNamePart);
|
|
|
|
} else {
|
|
|
|
// Value should be set
|
|
|
|
// @ts-ignore
|
|
|
|
Vue.set(this.nodeValues, lastNamePart, value);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
// Data is on lower level
|
|
|
|
if (value === null) {
|
|
|
|
// Property should be deleted
|
|
|
|
// @ts-ignore
|
|
|
|
let tempValue = get(this.nodeValues, nameParts.join('.')) as
|
|
|
|
| INodeParameters
|
|
|
|
| INodeParameters[];
|
|
|
|
Vue.delete(tempValue as object, lastNamePart as string);
|
|
|
|
|
|
|
|
if (isArray === true && (tempValue as INodeParameters[]).length === 0) {
|
|
|
|
// If a value from an array got delete and no values are left
|
|
|
|
// delete also the parent
|
|
|
|
lastNamePart = nameParts.pop();
|
|
|
|
tempValue = get(this.nodeValues, nameParts.join('.')) as INodeParameters;
|
|
|
|
Vue.delete(tempValue as object, lastNamePart as string);
|
2019-06-23 03:35:23 -07:00
|
|
|
}
|
|
|
|
} else {
|
2022-09-29 14:28:02 -07:00
|
|
|
// Value should be set
|
|
|
|
if (typeof value === 'object') {
|
2019-06-23 03:35:23 -07:00
|
|
|
// @ts-ignore
|
2022-10-18 04:33:31 -07:00
|
|
|
Vue.set(get(this.nodeValues, nameParts.join('.')), lastNamePart, deepCopy(value));
|
2019-06-23 03:35:23 -07:00
|
|
|
} else {
|
2022-09-29 14:28:02 -07:00
|
|
|
// @ts-ignore
|
|
|
|
Vue.set(get(this.nodeValues, nameParts.join('.')), lastNamePart, value);
|
2019-06-23 03:35:23 -07:00
|
|
|
}
|
|
|
|
}
|
2022-09-29 14:28:02 -07:00
|
|
|
}
|
|
|
|
},
|
|
|
|
credentialSelected(updateInformation: INodeUpdatePropertiesInformation) {
|
|
|
|
// Update the values on the node
|
2022-11-04 06:04:31 -07:00
|
|
|
this.workflowsStore.updateNodeProperties(updateInformation);
|
2019-06-23 03:35:23 -07:00
|
|
|
|
2022-11-04 06:04:31 -07:00
|
|
|
const node = this.workflowsStore.getNodeByName(updateInformation.name);
|
2019-06-23 03:35:23 -07:00
|
|
|
|
2022-11-04 06:04:31 -07:00
|
|
|
if (node) {
|
|
|
|
// Update the issues
|
|
|
|
this.updateNodeCredentialIssues(node);
|
|
|
|
}
|
2021-05-11 20:12:53 -07:00
|
|
|
|
2022-09-29 14:28:02 -07:00
|
|
|
this.$externalHooks().run('nodeSettings.credentialSelected', { updateInformation });
|
|
|
|
},
|
|
|
|
nameChanged(name: string) {
|
2022-12-09 06:07:37 -08:00
|
|
|
if (this.node) {
|
|
|
|
this.historyStore.pushCommandToUndo(new RenameNodeCommand(this.node.name, name, this));
|
|
|
|
}
|
2022-09-29 14:28:02 -07:00
|
|
|
// @ts-ignore
|
|
|
|
this.valueChanged({
|
|
|
|
value: name,
|
|
|
|
name: 'name',
|
|
|
|
});
|
|
|
|
},
|
|
|
|
valueChanged(parameterData: IUpdateInformation) {
|
|
|
|
let newValue: NodeParameterValue;
|
|
|
|
|
|
|
|
if (parameterData.hasOwnProperty('value')) {
|
|
|
|
// New value is given
|
|
|
|
newValue = parameterData.value as string | number;
|
|
|
|
} else {
|
|
|
|
// Get new value from nodeData where it is set already
|
|
|
|
newValue = get(this.nodeValues, parameterData.name) as NodeParameterValue;
|
|
|
|
}
|
|
|
|
// Save the node name before we commit the change because
|
|
|
|
// we need the old name to rename the node properly
|
|
|
|
const nodeNameBefore = parameterData.node || this.node.name;
|
2022-11-04 06:04:31 -07:00
|
|
|
const node = this.workflowsStore.getNodeByName(nodeNameBefore);
|
|
|
|
|
|
|
|
if (node === null) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2022-09-29 14:28:02 -07:00
|
|
|
if (parameterData.name === 'name') {
|
|
|
|
// Name of node changed so we have to set also the new node name as active
|
|
|
|
|
|
|
|
// Update happens in NodeView so emit event
|
|
|
|
const sendData = {
|
|
|
|
value: newValue,
|
|
|
|
oldValue: nodeNameBefore,
|
|
|
|
name: parameterData.name,
|
|
|
|
};
|
|
|
|
this.$emit('valueChanged', sendData);
|
|
|
|
} else if (parameterData.name === 'parameters') {
|
2022-11-04 06:04:31 -07:00
|
|
|
const nodeType = this.nodeTypesStore.getNodeType(node.type, node.typeVersion);
|
2022-09-29 14:28:02 -07:00
|
|
|
if (!nodeType) {
|
|
|
|
return;
|
2019-06-23 03:35:23 -07:00
|
|
|
}
|
|
|
|
|
2022-09-29 14:28:02 -07:00
|
|
|
// Get only the parameters which are different to the defaults
|
|
|
|
let nodeParameters = NodeHelpers.getNodeParameters(
|
|
|
|
nodeType.properties,
|
|
|
|
node.parameters,
|
|
|
|
false,
|
|
|
|
false,
|
|
|
|
node,
|
|
|
|
);
|
2019-07-14 05:10:16 -07:00
|
|
|
|
2022-09-29 14:28:02 -07:00
|
|
|
const oldNodeParameters = Object.assign({}, nodeParameters);
|
2019-06-23 03:35:23 -07:00
|
|
|
|
2022-09-29 14:28:02 -07:00
|
|
|
// Copy the data because it is the data of vuex so make sure that
|
|
|
|
// we do not edit it directly
|
2022-10-18 04:33:31 -07:00
|
|
|
nodeParameters = deepCopy(nodeParameters);
|
2019-06-23 03:35:23 -07:00
|
|
|
|
2022-09-29 14:28:02 -07:00
|
|
|
for (const parameterName of Object.keys(parameterData.value)) {
|
|
|
|
//@ts-ignore
|
|
|
|
newValue = parameterData.value[parameterName];
|
2019-06-23 03:35:23 -07:00
|
|
|
|
2019-07-14 05:10:16 -07:00
|
|
|
// Remove the 'parameters.' from the beginning to just have the
|
|
|
|
// actual parameter name
|
2022-09-29 14:28:02 -07:00
|
|
|
const parameterPath = parameterName.split('.').slice(1).join('.');
|
2019-07-14 05:10:16 -07:00
|
|
|
|
|
|
|
// Check if the path is supposed to change an array and if so get
|
|
|
|
// the needed data like path and index
|
2019-09-19 14:19:34 -07:00
|
|
|
const parameterPathArray = parameterPath.match(/(.*)\[(\d+)\]$/);
|
2019-07-14 05:10:16 -07:00
|
|
|
|
|
|
|
// Apply the new value
|
2022-09-29 14:28:02 -07:00
|
|
|
//@ts-ignore
|
|
|
|
if (parameterData[parameterName] === undefined && parameterPathArray !== null) {
|
2019-07-14 05:10:16 -07:00
|
|
|
// Delete array item
|
|
|
|
const path = parameterPathArray[1];
|
|
|
|
const index = parameterPathArray[2];
|
|
|
|
const data = get(nodeParameters, path);
|
|
|
|
|
|
|
|
if (Array.isArray(data)) {
|
|
|
|
data.splice(parseInt(index, 10), 1);
|
|
|
|
Vue.set(nodeParameters as object, path, data);
|
|
|
|
}
|
2019-06-23 03:35:23 -07:00
|
|
|
} else {
|
2020-01-23 15:57:34 -08:00
|
|
|
if (newValue === undefined) {
|
|
|
|
unset(nodeParameters as object, parameterPath);
|
|
|
|
} else {
|
|
|
|
set(nodeParameters as object, parameterPath, newValue);
|
|
|
|
}
|
2019-07-14 05:10:16 -07:00
|
|
|
}
|
2019-06-23 03:35:23 -07:00
|
|
|
|
2022-09-29 14:28:02 -07:00
|
|
|
this.$externalHooks().run('nodeSettings.valueChanged', {
|
|
|
|
parameterPath,
|
|
|
|
newValue,
|
|
|
|
parameters: this.parameters,
|
|
|
|
oldNodeParameters,
|
|
|
|
});
|
|
|
|
}
|
2019-06-23 03:35:23 -07:00
|
|
|
|
2022-09-29 14:28:02 -07:00
|
|
|
// Get the parameters with the now new defaults according to the
|
|
|
|
// from the user actually defined parameters
|
|
|
|
nodeParameters = NodeHelpers.getNodeParameters(
|
|
|
|
nodeType.properties,
|
|
|
|
nodeParameters as INodeParameters,
|
|
|
|
true,
|
|
|
|
false,
|
|
|
|
node,
|
|
|
|
);
|
|
|
|
|
|
|
|
for (const key of Object.keys(nodeParameters as object)) {
|
|
|
|
if (nodeParameters && nodeParameters[key] !== null && nodeParameters[key] !== undefined) {
|
|
|
|
this.setValue(`parameters.${key}`, nodeParameters[key] as string);
|
2019-07-14 05:10:16 -07:00
|
|
|
}
|
2022-09-29 14:28:02 -07:00
|
|
|
}
|
2019-07-14 05:10:16 -07:00
|
|
|
|
2022-11-04 06:04:31 -07:00
|
|
|
if (nodeParameters) {
|
|
|
|
const updateInformation: IUpdateInformation = {
|
|
|
|
name: node.name,
|
|
|
|
value: nodeParameters,
|
|
|
|
};
|
2021-05-15 15:51:14 -07:00
|
|
|
|
2022-11-04 06:04:31 -07:00
|
|
|
this.workflowsStore.setNodeParameters(updateInformation);
|
2021-05-15 15:51:14 -07:00
|
|
|
|
2022-11-04 06:04:31 -07:00
|
|
|
this.updateNodeParameterIssues(node, nodeType);
|
|
|
|
this.updateNodeCredentialIssues(node);
|
|
|
|
}
|
2022-09-29 14:28:02 -07:00
|
|
|
} else if (parameterData.name.startsWith('parameters.')) {
|
|
|
|
// A node parameter changed
|
|
|
|
|
2022-11-04 06:04:31 -07:00
|
|
|
const nodeType = this.nodeTypesStore.getNodeType(node.type, node.typeVersion);
|
2022-09-29 14:28:02 -07:00
|
|
|
if (!nodeType) {
|
|
|
|
return;
|
|
|
|
}
|
2019-06-23 03:35:23 -07:00
|
|
|
|
2022-09-29 14:28:02 -07:00
|
|
|
// Get only the parameters which are different to the defaults
|
|
|
|
let nodeParameters = NodeHelpers.getNodeParameters(
|
|
|
|
nodeType.properties,
|
|
|
|
node.parameters,
|
|
|
|
false,
|
|
|
|
false,
|
|
|
|
node,
|
|
|
|
);
|
|
|
|
const oldNodeParameters = Object.assign({}, nodeParameters);
|
|
|
|
|
|
|
|
// Copy the data because it is the data of vuex so make sure that
|
|
|
|
// we do not edit it directly
|
2022-10-18 04:33:31 -07:00
|
|
|
nodeParameters = deepCopy(nodeParameters);
|
2022-09-29 14:28:02 -07:00
|
|
|
|
|
|
|
// Remove the 'parameters.' from the beginning to just have the
|
|
|
|
// actual parameter name
|
|
|
|
const parameterPath = parameterData.name.split('.').slice(1).join('.');
|
|
|
|
|
|
|
|
// Check if the path is supposed to change an array and if so get
|
|
|
|
// the needed data like path and index
|
|
|
|
const parameterPathArray = parameterPath.match(/(.*)\[(\d+)\]$/);
|
|
|
|
|
|
|
|
// Apply the new value
|
|
|
|
if (parameterData.value === undefined && parameterPathArray !== null) {
|
|
|
|
// Delete array item
|
|
|
|
const path = parameterPathArray[1];
|
|
|
|
const index = parameterPathArray[2];
|
|
|
|
const data = get(nodeParameters, path);
|
|
|
|
|
|
|
|
if (Array.isArray(data)) {
|
|
|
|
data.splice(parseInt(index, 10), 1);
|
|
|
|
Vue.set(nodeParameters as object, path, data);
|
|
|
|
}
|
2019-07-18 08:41:53 -07:00
|
|
|
} else {
|
2022-09-29 14:28:02 -07:00
|
|
|
if (newValue === undefined) {
|
|
|
|
unset(nodeParameters as object, parameterPath);
|
|
|
|
} else {
|
|
|
|
set(nodeParameters as object, parameterPath, newValue);
|
|
|
|
}
|
2019-06-23 03:35:23 -07:00
|
|
|
}
|
2022-09-29 14:28:02 -07:00
|
|
|
|
|
|
|
// Get the parameters with the now new defaults according to the
|
|
|
|
// from the user actually defined parameters
|
|
|
|
nodeParameters = NodeHelpers.getNodeParameters(
|
|
|
|
nodeType.properties,
|
|
|
|
nodeParameters as INodeParameters,
|
|
|
|
true,
|
|
|
|
false,
|
|
|
|
node,
|
|
|
|
);
|
|
|
|
|
|
|
|
for (const key of Object.keys(nodeParameters as object)) {
|
|
|
|
if (nodeParameters && nodeParameters[key] !== null && nodeParameters[key] !== undefined) {
|
|
|
|
this.setValue(`parameters.${key}`, nodeParameters[key] as string);
|
|
|
|
}
|
2019-06-23 03:35:23 -07:00
|
|
|
}
|
|
|
|
|
2022-09-29 14:28:02 -07:00
|
|
|
// Update the data in vuex
|
2022-11-09 01:01:50 -08:00
|
|
|
const updateInformation: IUpdateInformation = {
|
2022-09-29 14:28:02 -07:00
|
|
|
name: node.name,
|
|
|
|
value: nodeParameters,
|
|
|
|
};
|
2019-06-23 03:35:23 -07:00
|
|
|
|
2022-11-04 06:04:31 -07:00
|
|
|
this.workflowsStore.setNodeParameters(updateInformation);
|
2019-06-23 03:35:23 -07:00
|
|
|
|
2022-09-29 14:28:02 -07:00
|
|
|
this.$externalHooks().run('nodeSettings.valueChanged', {
|
|
|
|
parameterPath,
|
|
|
|
newValue,
|
|
|
|
parameters: this.parameters,
|
|
|
|
oldNodeParameters,
|
|
|
|
});
|
2019-06-23 03:35:23 -07:00
|
|
|
|
2022-09-29 14:28:02 -07:00
|
|
|
this.updateNodeParameterIssues(node, nodeType);
|
|
|
|
this.updateNodeCredentialIssues(node);
|
|
|
|
} else {
|
|
|
|
// A property on the node itself changed
|
2020-04-12 10:58:30 -07:00
|
|
|
|
2022-09-29 14:28:02 -07:00
|
|
|
// Update data in settings
|
|
|
|
Vue.set(this.nodeValues, parameterData.name, newValue);
|
2020-08-08 11:31:04 -07:00
|
|
|
|
2022-09-29 14:28:02 -07:00
|
|
|
// Update data in vuex
|
|
|
|
const updateInformation = {
|
|
|
|
name: node.name,
|
|
|
|
key: parameterData.name,
|
|
|
|
value: newValue,
|
|
|
|
};
|
2022-11-04 06:04:31 -07:00
|
|
|
|
|
|
|
this.workflowsStore.setNodeValue(updateInformation);
|
2022-09-29 14:28:02 -07:00
|
|
|
}
|
|
|
|
},
|
|
|
|
/**
|
|
|
|
* Sets the values of the active node in the internal settings variables
|
|
|
|
*/
|
|
|
|
setNodeValues() {
|
|
|
|
if (!this.node) {
|
|
|
|
// No node selected
|
|
|
|
return;
|
|
|
|
}
|
2019-06-23 03:35:23 -07:00
|
|
|
|
2022-09-29 14:28:02 -07:00
|
|
|
if (this.nodeType !== null) {
|
|
|
|
this.nodeValid = true;
|
2020-05-05 08:34:12 -07:00
|
|
|
|
2022-09-29 14:28:02 -07:00
|
|
|
const foundNodeSettings = [];
|
|
|
|
if (this.node.color) {
|
|
|
|
foundNodeSettings.push('color');
|
|
|
|
Vue.set(this.nodeValues, 'color', this.node.color);
|
|
|
|
}
|
2019-07-18 10:26:16 -07:00
|
|
|
|
2022-09-29 14:28:02 -07:00
|
|
|
if (this.node.notes) {
|
|
|
|
foundNodeSettings.push('notes');
|
|
|
|
Vue.set(this.nodeValues, 'notes', this.node.notes);
|
|
|
|
}
|
2019-07-18 10:26:16 -07:00
|
|
|
|
2022-09-29 14:28:02 -07:00
|
|
|
if (this.node.alwaysOutputData) {
|
|
|
|
foundNodeSettings.push('alwaysOutputData');
|
|
|
|
Vue.set(this.nodeValues, 'alwaysOutputData', this.node.alwaysOutputData);
|
|
|
|
}
|
2019-07-18 10:26:16 -07:00
|
|
|
|
2022-09-29 14:28:02 -07:00
|
|
|
if (this.node.executeOnce) {
|
|
|
|
foundNodeSettings.push('executeOnce');
|
|
|
|
Vue.set(this.nodeValues, 'executeOnce', this.node.executeOnce);
|
|
|
|
}
|
2019-07-18 10:26:16 -07:00
|
|
|
|
2022-09-29 14:28:02 -07:00
|
|
|
if (this.node.continueOnFail) {
|
|
|
|
foundNodeSettings.push('continueOnFail');
|
|
|
|
Vue.set(this.nodeValues, 'continueOnFail', this.node.continueOnFail);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this.node.notesInFlow) {
|
|
|
|
foundNodeSettings.push('notesInFlow');
|
|
|
|
Vue.set(this.nodeValues, 'notesInFlow', this.node.notesInFlow);
|
2019-06-23 03:35:23 -07:00
|
|
|
}
|
2022-09-29 14:28:02 -07:00
|
|
|
|
|
|
|
if (this.node.retryOnFail) {
|
|
|
|
foundNodeSettings.push('retryOnFail');
|
|
|
|
Vue.set(this.nodeValues, 'retryOnFail', this.node.retryOnFail);
|
2022-07-20 07:24:03 -07:00
|
|
|
}
|
2022-09-29 14:28:02 -07:00
|
|
|
|
|
|
|
if (this.node.maxTries) {
|
|
|
|
foundNodeSettings.push('maxTries');
|
|
|
|
Vue.set(this.nodeValues, 'maxTries', this.node.maxTries);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this.node.waitBetweenTries) {
|
|
|
|
foundNodeSettings.push('waitBetweenTries');
|
|
|
|
Vue.set(this.nodeValues, 'waitBetweenTries', this.node.waitBetweenTries);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Set default node settings
|
|
|
|
for (const nodeSetting of this.nodeSettings) {
|
|
|
|
if (!foundNodeSettings.includes(nodeSetting.name)) {
|
|
|
|
// Set default value
|
|
|
|
Vue.set(this.nodeValues, nodeSetting.name, nodeSetting.default);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-18 04:33:31 -07:00
|
|
|
Vue.set(this.nodeValues, 'parameters', deepCopy(this.node.parameters));
|
2022-09-29 14:28:02 -07:00
|
|
|
} else {
|
|
|
|
this.nodeValid = false;
|
|
|
|
}
|
2019-06-23 03:35:23 -07:00
|
|
|
},
|
2022-09-29 14:28:02 -07:00
|
|
|
onMissingNodeTextClick(event: MouseEvent) {
|
|
|
|
if ((event.target as Element).localName === 'a') {
|
|
|
|
this.$telemetry.track('user clicked cnr browse button', {
|
|
|
|
source: 'cnr missing node modal',
|
2022-04-11 06:12:13 -07:00
|
|
|
});
|
|
|
|
}
|
2019-06-23 03:35:23 -07:00
|
|
|
},
|
2022-09-29 14:28:02 -07:00
|
|
|
onMissingNodeLearnMoreLinkClick() {
|
|
|
|
this.$telemetry.track('user clicked cnr docs link', {
|
|
|
|
source: 'missing node modal source',
|
|
|
|
package_name: this.node.type.split('.')[0],
|
|
|
|
node_type: this.node.type,
|
|
|
|
});
|
|
|
|
},
|
2022-12-14 01:04:10 -08:00
|
|
|
onStopExecution() {
|
2022-10-31 10:59:53 -07:00
|
|
|
this.$emit('stopExecution');
|
|
|
|
},
|
2022-09-29 14:28:02 -07:00
|
|
|
},
|
|
|
|
mounted() {
|
2023-01-16 05:55:58 -08:00
|
|
|
this.populateHiddenIssuesSet();
|
2022-09-29 14:28:02 -07:00
|
|
|
this.setNodeValues();
|
|
|
|
if (this.eventBus) {
|
|
|
|
(this.eventBus as Vue).$on('openSettings', () => {
|
|
|
|
this.openPanel = 'settings';
|
|
|
|
});
|
|
|
|
}
|
feat(editor): Node creator actions (#4696)
* WIP: Node Actions List UI
* WIP: Recommended Actions and preseting of fields
* WIP: Resource category
* :art: Moved actions categorisation to the server
* :label: Add missing INodeAction type
* :sparkles: Improve SSR categorisation, fix adding of mixed actions
* :recycle: Refactor CategorizedItems to composition api, style fixes
* WIP: Adding multiple nodes
* :recycle: Refactor rest of the NodeCreator component to composition API, conver globalLinkActions to composable
* :sparkles: Allow actions dragging, fix search and refactor passing of actions to categorized items
* :lipstick: Fix node actions title
* Migrate to the pinia store, add posthog feature and various fixes
* :bug: Fix filtering of trigger actions when not merged
* fix: N8N-5439 — Do not use simple node item when at NodeHelperPanel root
* :bug: Design review fixes
* :bug: Fix disabling of merged actions
* Fix trigger root filtering
* :sparkles: Allow for custom node actions parser, introduce hubspot parser
* :bug: Fix initial node params validation, fix position of second added node
* :bug: Introduce operations category, removed canvas node names overrride, fix API actions display and prevent dragging of action nodes
* :sparkles: Prevent NDV auto-open feature flag
* :bug: Inject recommened action for trigger nodes without actions
* Refactored NodeCreatorNode to Storybook, change filtering of merged nodes for the trigger helper panel, minor fixes
* Improve rendering of app nodes and animation
* Cleanup, any only enable accordion transition on triggerhelperpanel
* Hide node creator scrollbars in Firefox
* Minor styles fixes
* Do not copy the array in rendering method
* Removed unused props
* Fix memory leak
* Fix categorisation of regular nodes with a single resource
* Implement telemetry calls for node actions
* Move categorization to FE
* Fix client side actions categorisation
* Skip custom action show
* Only load tooltip for NodeIcon if necessary
* Fix lodash startCase import
* Remove lodash.startcase
* Cleanup
* Fix node creator autofocus on "tab"
* Prevent posthog getFeatureFlag from crashing
* Debugging preview env search issues
* Remove logs
* Make sure the pre-filled params are update not overwritten
* Get rid of transition in itemiterator
* WIP: Rough version of NodeActions keyboard navigation, replace nodeCreator composable with Pinia store module
* Rewrite to add support for ActionItem to ItemIterator and make CategorizedItems accept items props
* Fix category item counter & cleanup
* Add APIHint to actions search no-result, clean up NodeCreatorNode
* Improve node actions no results message
* Remove logging, fix filtering of recommended placeholder category
* Remove unused NodeActions component and node merging feature falg
* Do not show regular nodes without actions
* Make sure to add manual trigger when adding http node via actions hint
* Fixed api hint footer line height
* Prevent pointer-events od NodeIcon img and remove "this" from template
* Address PR points
* Fix e2e specs
* Make sure canvas ia loaded
* Make sure canvas ia loaded before opening nodeCreator in e2e spec
* Fix flaky workflows tags e2e getter
* Imrpove node creator click outside UX, add manual node to regular nodes added from trigger panel
* Add manual trigger node if dragging regular from trigger panel
2022-12-09 01:56:36 -08:00
|
|
|
|
|
|
|
this.updateNodeParameterIssues(this.node as INodeUi, this.nodeType);
|
2022-09-29 14:28:02 -07:00
|
|
|
},
|
|
|
|
});
|
2019-06-23 03:35:23 -07:00
|
|
|
</script>
|
|
|
|
|
2022-04-11 06:12:13 -07:00
|
|
|
<style lang="scss" module>
|
|
|
|
.header {
|
|
|
|
background-color: var(--color-background-base);
|
|
|
|
}
|
2022-07-20 07:24:03 -07:00
|
|
|
|
|
|
|
.warningIcon {
|
|
|
|
color: var(--color-text-lighter);
|
|
|
|
font-size: var(--font-size-2xl);
|
|
|
|
}
|
|
|
|
|
|
|
|
.descriptionContainer {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
}
|
2022-04-11 06:12:13 -07:00
|
|
|
</style>
|
2019-06-23 03:35:23 -07:00
|
|
|
|
2022-04-11 06:12:13 -07:00
|
|
|
<style lang="scss">
|
2019-06-23 03:35:23 -07:00
|
|
|
.node-settings {
|
2021-09-11 01:15:36 -07:00
|
|
|
overflow: hidden;
|
2022-05-23 08:56:15 -07:00
|
|
|
background-color: var(--color-background-xlight);
|
|
|
|
height: 100%;
|
2022-09-22 08:41:15 -07:00
|
|
|
width: 100%;
|
2021-10-27 12:55:37 -07:00
|
|
|
|
|
|
|
.no-parameters {
|
|
|
|
margin-top: var(--spacing-xs);
|
|
|
|
}
|
2019-06-23 03:35:23 -07:00
|
|
|
|
|
|
|
.header-side-menu {
|
2022-04-11 06:12:13 -07:00
|
|
|
padding: var(--spacing-s) var(--spacing-s) var(--spacing-s) var(--spacing-s);
|
2021-09-11 01:15:36 -07:00
|
|
|
font-size: var(--font-size-l);
|
2022-04-11 06:12:13 -07:00
|
|
|
display: flex;
|
2019-07-11 06:05:12 -07:00
|
|
|
|
2022-04-11 06:12:13 -07:00
|
|
|
.node-name {
|
|
|
|
padding-top: var(--spacing-5xs);
|
|
|
|
flex-grow: 1;
|
2019-07-11 06:05:12 -07:00
|
|
|
}
|
2019-06-23 03:35:23 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
.node-is-not-valid {
|
2022-07-20 07:24:03 -07:00
|
|
|
height: 75%;
|
2019-06-23 03:35:23 -07:00
|
|
|
padding: 10px;
|
2022-07-20 07:24:03 -07:00
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
text-align: center;
|
|
|
|
line-height: var(--font-line-height-regular);
|
2019-06-23 03:35:23 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
.node-parameters-wrapper {
|
2021-09-11 01:15:36 -07:00
|
|
|
height: 100%;
|
2022-04-11 06:12:13 -07:00
|
|
|
overflow-y: auto;
|
2022-10-14 05:58:07 -07:00
|
|
|
padding: 0 20px 200px 20px;
|
2019-06-23 03:35:23 -07:00
|
|
|
}
|
2022-05-23 08:56:15 -07:00
|
|
|
|
|
|
|
&.dragging {
|
|
|
|
border-color: var(--color-primary);
|
|
|
|
box-shadow: 0px 6px 16px rgba(255, 74, 51, 0.15);
|
|
|
|
}
|
2019-06-23 03:35:23 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
.parameter-content {
|
|
|
|
font-size: 0.9em;
|
|
|
|
margin-right: -15px;
|
|
|
|
margin-left: -15px;
|
|
|
|
input {
|
|
|
|
width: calc(100% - 35px);
|
|
|
|
padding: 5px;
|
|
|
|
}
|
|
|
|
select {
|
|
|
|
width: calc(100% - 20px);
|
|
|
|
padding: 5px;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:before {
|
|
|
|
display: table;
|
2022-09-29 14:28:02 -07:00
|
|
|
content: ' ';
|
2019-06-23 03:35:23 -07:00
|
|
|
position: relative;
|
|
|
|
box-sizing: border-box;
|
|
|
|
clear: both;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.parameter-wrapper {
|
|
|
|
padding: 0 1em;
|
|
|
|
}
|
2021-08-29 04:36:17 -07:00
|
|
|
|
2019-06-23 03:35:23 -07:00
|
|
|
.color-reset-button-wrapper {
|
|
|
|
position: relative;
|
|
|
|
}
|
|
|
|
.color-reset-button {
|
|
|
|
position: absolute;
|
|
|
|
right: 7px;
|
|
|
|
top: -25px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.parameter-value {
|
|
|
|
input.expression {
|
|
|
|
border-style: dashed;
|
|
|
|
border-color: #ff9600;
|
|
|
|
display: inline-block;
|
|
|
|
position: relative;
|
|
|
|
width: 100%;
|
2022-09-29 14:28:02 -07:00
|
|
|
box-sizing: border-box;
|
2019-06-23 03:35:23 -07:00
|
|
|
background-color: #793300;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|