mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
⚡ Implement discoverability flow
This commit is contained in:
parent
55280cc615
commit
c19df79e10
|
@ -31,6 +31,21 @@
|
||||||
{{ $locale.baseText('nodeSettings.thisNodeDoesNotHaveAnyParameters') }}
|
{{ $locale.baseText('nodeSettings.thisNodeDoesNotHaveAnyParameters') }}
|
||||||
</n8n-text>
|
</n8n-text>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div v-if="customActionSelected" class="parameter-item parameter-notice">
|
||||||
|
<n8n-notice
|
||||||
|
:content="$locale.baseText(
|
||||||
|
'nodeSettings.youCanUseTheHttpRequestNode',
|
||||||
|
{
|
||||||
|
interpolate: {
|
||||||
|
nodeTypeDisplayName: nodeType.displayName
|
||||||
|
},
|
||||||
|
},
|
||||||
|
)"
|
||||||
|
:truncate="false"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div v-show="openPanel === 'settings'">
|
<div v-show="openPanel === 'settings'">
|
||||||
<parameter-input-list :parameters="nodeSettings" :hideDelete="true" :nodeValues="nodeValues" path="" @valueChanged="valueChanged" />
|
<parameter-input-list :parameters="nodeSettings" :hideDelete="true" :nodeValues="nodeValues" path="" @valueChanged="valueChanged" />
|
||||||
|
@ -87,6 +102,18 @@ export default mixins(
|
||||||
NodeExecuteButton,
|
NodeExecuteButton,
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
customActionSelected (): boolean {
|
||||||
|
return (
|
||||||
|
this.nodeValues.parameters !== undefined &&
|
||||||
|
typeof this.nodeValues.parameters === 'object' &&
|
||||||
|
this.nodeValues.parameters !== null &&
|
||||||
|
!Array.isArray(this.nodeValues.parameters) &&
|
||||||
|
(
|
||||||
|
this.nodeValues.parameters.resource === 'customAction' ||
|
||||||
|
this.nodeValues.parameters.operation === 'customAction'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
},
|
||||||
nodeType (): INodeTypeDescription | null {
|
nodeType (): INodeTypeDescription | null {
|
||||||
if (this.node) {
|
if (this.node) {
|
||||||
return this.$store.getters.nodeType(this.node.type, this.node.typeVersion);
|
return this.$store.getters.nodeType(this.node.type, this.node.typeVersion);
|
||||||
|
|
|
@ -132,6 +132,18 @@
|
||||||
<div v-if="option.description" class="option-description" v-html="getOptionsOptionDescription(option)"></div>
|
<div v-if="option.description" class="option-description" v-html="getOptionsOptionDescription(option)"></div>
|
||||||
</div>
|
</div>
|
||||||
</n8n-option>
|
</n8n-option>
|
||||||
|
<n8n-option
|
||||||
|
v-if="isSupportedByHttpRequestNode && ['resource', 'operation'].includes(parameter.name)"
|
||||||
|
:key="'customAction'"
|
||||||
|
:value="'customAction'"
|
||||||
|
:label="'Custom Action'"
|
||||||
|
>
|
||||||
|
<div class="list-option">
|
||||||
|
<div class="option-headline">
|
||||||
|
{{ $locale.baseText('parameterInput.customAction') }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</n8n-option>
|
||||||
</n8n-select>
|
</n8n-select>
|
||||||
|
|
||||||
<n8n-select
|
<n8n-select
|
||||||
|
@ -219,6 +231,7 @@ import { showMessage } from '@/components/mixins/showMessage';
|
||||||
import { workflowHelpers } from '@/components/mixins/workflowHelpers';
|
import { workflowHelpers } from '@/components/mixins/workflowHelpers';
|
||||||
|
|
||||||
import mixins from 'vue-typed-mixins';
|
import mixins from 'vue-typed-mixins';
|
||||||
|
import { mapGetters } from "vuex";
|
||||||
|
|
||||||
export default mixins(
|
export default mixins(
|
||||||
externalHooks,
|
externalHooks,
|
||||||
|
@ -303,6 +316,7 @@ export default mixins(
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
...mapGetters('credentials', ['allCredentialsByType', 'getCredentialTypeByName']),
|
||||||
areExpressionsDisabled(): boolean {
|
areExpressionsDisabled(): boolean {
|
||||||
return this.$store.getters['ui/areExpressionsDisabled'];
|
return this.$store.getters['ui/areExpressionsDisabled'];
|
||||||
},
|
},
|
||||||
|
@ -486,6 +500,7 @@ export default mixins(
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const checkValue of checkValues) {
|
for (const checkValue of checkValues) {
|
||||||
|
if (checkValue === 'customAction') continue;
|
||||||
if (checkValue === null || !validOptions.includes(checkValue)) {
|
if (checkValue === null || !validOptions.includes(checkValue)) {
|
||||||
if (issues.parameters === undefined) {
|
if (issues.parameters === undefined) {
|
||||||
issues.parameters = {};
|
issues.parameters = {};
|
||||||
|
@ -581,6 +596,25 @@ export default mixins(
|
||||||
workflow (): Workflow {
|
workflow (): Workflow {
|
||||||
return this.getWorkflow();
|
return this.getWorkflow();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether the node's credential may be used to make a request with the HTTP Request node.
|
||||||
|
*/
|
||||||
|
isSupportedByHttpRequestNode(): boolean {
|
||||||
|
if (!this.node || !this.node.credentials) return false;
|
||||||
|
|
||||||
|
// @TODO Detect currently selected cred
|
||||||
|
const selectedCredentialTypeName = Object.keys(this.node.credentials);
|
||||||
|
if (!selectedCredentialTypeName.length) return false;
|
||||||
|
const name = selectedCredentialTypeName.pop()!;
|
||||||
|
|
||||||
|
const credentialType = this.getCredentialTypeByName(name);
|
||||||
|
|
||||||
|
return (
|
||||||
|
credentialType.name.slice(0, -4).endsWith('OAuth') ||
|
||||||
|
credentialType.authenticate !== undefined
|
||||||
|
);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getPlaceholder(): string {
|
getPlaceholder(): string {
|
||||||
|
|
|
@ -410,6 +410,7 @@
|
||||||
"nodeSettings.thisNodeDoesNotHaveAnyParameters": "This node does not have any parameters",
|
"nodeSettings.thisNodeDoesNotHaveAnyParameters": "This node does not have any parameters",
|
||||||
"nodeSettings.waitBetweenTries.description": "How long to wait between each attempt (in milliseconds)",
|
"nodeSettings.waitBetweenTries.description": "How long to wait between each attempt (in milliseconds)",
|
||||||
"nodeSettings.waitBetweenTries.displayName": "Wait Between Tries (ms)",
|
"nodeSettings.waitBetweenTries.displayName": "Wait Between Tries (ms)",
|
||||||
|
"nodeSettings.youCanUseTheHttpRequestNode": "You can use the <b>HTTP Request</b> node to make a custom API call with your {nodeTypeDisplayName} credential. <a href=PENDING_WAITING_ON_DEB>Learn more</a>",
|
||||||
"nodeView.addNode": "Add node",
|
"nodeView.addNode": "Add node",
|
||||||
"nodeView.addSticky": "Click to add sticky note",
|
"nodeView.addSticky": "Click to add sticky note",
|
||||||
"nodeView.confirmMessage.beforeRouteLeave.cancelButtonText": "Leave without saving",
|
"nodeView.confirmMessage.beforeRouteLeave.cancelButtonText": "Leave without saving",
|
||||||
|
@ -483,6 +484,7 @@
|
||||||
"openWorkflow.workflowImportError": "Could not import workflow",
|
"openWorkflow.workflowImportError": "Could not import workflow",
|
||||||
"openWorkflow.workflowNotFoundError": "Could not find workflow",
|
"openWorkflow.workflowNotFoundError": "Could not find workflow",
|
||||||
"parameterInput.addExpression": "Add Expression",
|
"parameterInput.addExpression": "Add Expression",
|
||||||
|
"parameterInput.customAction": "Custom Action",
|
||||||
"parameterInput.error": "ERROR",
|
"parameterInput.error": "ERROR",
|
||||||
"parameterInput.issues": "Issues",
|
"parameterInput.issues": "Issues",
|
||||||
"parameterInput.loadingOptions": "Loading options...",
|
"parameterInput.loadingOptions": "Loading options...",
|
||||||
|
|
Loading…
Reference in a new issue