Skip to content

Commit f736284

Browse files
committed
workspace ID on node overrides config default
1 parent 91ce3fc commit f736284

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

nodes/workflow-launch.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,13 @@
150150
seqeraConfig: seqeraConfigId,
151151
});
152152

153+
// Add workspace ID override if configured
154+
const workspaceIdOverride = $("#node-input-workspaceId").typedInput("value");
155+
const workspaceIdType = $("#node-input-workspaceId").typedInput("type");
156+
if (workspaceIdType === "str" && workspaceIdOverride && workspaceIdOverride.trim()) {
157+
params.append("workspaceId", workspaceIdOverride);
158+
}
159+
153160
$.ajax({
154161
url: `admin/seqera/pipelines/${nodeId}?${params.toString()}`,
155162
method: "GET",

nodes/workflow-launch.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ module.exports = function (RED) {
1616
seqeraConfigId = node.seqeraConfig.id;
1717
baseUrl = node.seqeraConfig.baseUrl || baseUrl;
1818
workspaceId = node.seqeraConfig.workspaceId;
19+
20+
// Check for workspace ID override in the node configuration
21+
if (node.workspaceIdProp && node.workspaceIdPropType === "str" && node.workspaceIdProp.trim()) {
22+
workspaceId = node.workspaceIdProp;
23+
}
1924
} else {
2025
// Try to get config ID from request body or query params
2126
seqeraConfigId = req.query.seqeraConfig || req.body?.seqeraConfig;
@@ -28,6 +33,11 @@ module.exports = function (RED) {
2833
}
2934
}
3035

36+
// Also check for workspace ID override in query parameters (from frontend)
37+
if (req.query.workspaceId && req.query.workspaceId.trim()) {
38+
workspaceId = req.query.workspaceId;
39+
}
40+
3141
if (!workspaceId) {
3242
return res.json([]); // Return empty array instead of error for better UX
3343
}

0 commit comments

Comments
 (0)