mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fix(editor): Fix credential 'supportedNodes' matching
This commit is contained in:
parent
ecabe34705
commit
4a24021363
|
@ -31,23 +31,21 @@ export function groupNodeTypesByNameAndType(
|
||||||
): NodeTypesByTypeNameAndVersion {
|
): NodeTypesByTypeNameAndVersion {
|
||||||
const groupedNodeTypes = nodeTypes.reduce<NodeTypesByTypeNameAndVersion>((groups, nodeType) => {
|
const groupedNodeTypes = nodeTypes.reduce<NodeTypesByTypeNameAndVersion>((groups, nodeType) => {
|
||||||
const newNodeVersions = getNodeVersions(nodeType);
|
const newNodeVersions = getNodeVersions(nodeType);
|
||||||
|
const nodeName = nodeType.name.split('.').pop() as string;
|
||||||
|
|
||||||
if (newNodeVersions.length === 0) {
|
if (newNodeVersions.length === 0) {
|
||||||
const singleVersion = { [DEFAULT_NODETYPE_VERSION]: nodeType };
|
const singleVersion = { [DEFAULT_NODETYPE_VERSION]: nodeType };
|
||||||
|
|
||||||
groups[nodeType.name] = singleVersion;
|
groups[nodeName] = singleVersion;
|
||||||
return groups;
|
return groups;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const version of newNodeVersions) {
|
for (const version of newNodeVersions) {
|
||||||
// Node exists with the same name
|
// Node exists with the same name
|
||||||
if (groups[nodeType.name]) {
|
if (groups[nodeName]) {
|
||||||
groups[nodeType.name][version] = Object.assign(
|
groups[nodeName][version] = Object.assign(groups[nodeName][version] ?? {}, nodeType);
|
||||||
groups[nodeType.name][version] ?? {},
|
|
||||||
nodeType,
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
groups[nodeType.name] = Object.assign(groups[nodeType.name] ?? {}, {
|
groups[nodeName] = Object.assign(groups[nodeName] ?? {}, {
|
||||||
[version]: nodeType,
|
[version]: nodeType,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue