fix(core): Revert custom API option injecting (#5345)

Revert "feat(core): Fix populating of node custom api call options (#5303)"

This reverts commit e58bc41d24.
This commit is contained in:
OlegIvaniv
2023-02-02 20:03:45 +01:00
committed by GitHub
parent b5154d9be5
commit 616074158c
8 changed files with 85 additions and 78 deletions

View File

@@ -233,7 +233,7 @@ const telemetry = instance?.proxy.$telemetry;
const { categorizedItems: allNodes, isTriggerNode } = useNodeTypesStore();
const containsAPIAction = computed(
() =>
activeNodeActions.value?.properties.some((p) =>
state.latestNodeData?.properties.some((p) =>
p.options?.find((o) => o.name === CUSTOM_API_CALL_NAME),
) === true,
);
@@ -338,10 +338,27 @@ function getCustomAPICallHintLocale(key: string) {
interpolate: { nodeNameTitle },
});
}
// The nodes.json doesn't contain API CALL option so we need to fetch the node detail
// to determine if need to render the API CALL hint
async function fetchNodeDetails() {
if (!state.activeNodeActions) return;
const { getNodesInformation } = useNodeTypesStore();
const { version, name } = state.activeNodeActions;
const payload = {
name,
version: Array.isArray(version) ? version?.slice(-1)[0] : version,
} as INodeTypeNameVersion;
const nodesInfo = await getNodesInformation([payload], false);
state.latestNodeData = nodesInfo[0];
}
function setActiveActionsNodeType(nodeType: INodeTypeDescription | null) {
state.activeNodeActions = nodeType;
setShowTabs(false);
fetchNodeDetails();
if (nodeType) trackActionsView();
}