Skip to content

Commit

Permalink
fix(core): Show webhook urls for all webhook nodes (no-changelog) (#7783
Browse files Browse the repository at this point in the history
)

This reverts parts of #7113
  • Loading branch information
netroy committed Nov 29, 2023
1 parent e01617a commit 37e769a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 18 deletions.
16 changes: 0 additions & 16 deletions packages/core/bin/generate-ui-types
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,6 @@ function findReferencedMethods(obj, refs = {}, latestName = '') {
return refs;
}

function addWebhookLifecycle(nodeType) {
if (nodeType.description.webhooks) {
nodeType.description.webhooks = nodeType.description.webhooks.map((webhook) => {
const webhookMethods =
nodeType?.webhookMethods?.[webhook.name] ?? nodeType?.webhookMethods?.default;
webhook.hasLifecycleMethods = Boolean(
webhookMethods?.checkExists && webhookMethods?.create && webhookMethods?.delete,
);
return webhook;
});
}

return nodeType;
}

(async () => {
const loader = new PackageDirectoryLoader(packageDir);
await loader.loadAll();
Expand Down Expand Up @@ -79,7 +64,6 @@ function addWebhookLifecycle(nodeType) {
.map((data) => {
const nodeType = NodeHelpers.getVersionedNodeType(data.type);
NodeHelpers.applySpecialNodeParameters(nodeType);
addWebhookLifecycle(nodeType);
return data.type;
})
.flatMap((nodeType) =>
Expand Down
2 changes: 1 addition & 1 deletion packages/editor-ui/src/components/NodeWebhooks.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export default defineComponent({
}
return (this.nodeType as INodeTypeDescription).webhooks!.filter(
(webhookData) => webhookData.restartWebhook !== true && !webhookData.hasLifecycleMethods,
(webhookData) => webhookData.restartWebhook !== true,
);
},
baseText() {
Expand Down
1 change: 0 additions & 1 deletion packages/workflow/src/Interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1650,7 +1650,6 @@ export interface IWebhookDescription {
responseMode?: WebhookResponseMode | string;
responseData?: WebhookResponseData | string;
restartWebhook?: boolean;
hasLifecycleMethods?: boolean; // set automatically by generate-ui-types
ndvHideUrl?: boolean; // If true the webhook will not be displayed in the editor
ndvHideMethod?: boolean; // If true the method will not be displayed in the editor
}
Expand Down

0 comments on commit 37e769a

Please sign in to comment.