From 5b8f9f6053ada243951bc1cad3f6328123d95e56 Mon Sep 17 00:00:00 2001 From: Ben Hardill Date: Fri, 16 Oct 2026 14:00:51 +0100 Subject: [PATCH 01/15] Allow Extra NR catalogues to be included from the TeamType fixes FlowFuse/engineering#534 Allow catalogue URLS to be added to team types and only added to devices and instance is they are not already present --- forge/routes/api/deviceLive.js | 7 ++ forge/routes/api/project.js | 7 ++ .../TeamTypes/dialogs/TeamTypeEditDialog.vue | 33 ++++++- test/unit/forge/routes/api/device_spec.js | 18 ++++ test/unit/forge/routes/api/project_spec.js | 90 +++++++++++++++++++ 5 files changed, 153 insertions(+), 2 deletions(-) diff --git a/forge/routes/api/deviceLive.js b/forge/routes/api/deviceLive.js index 5859b8131a..81aa32e9a2 100644 --- a/forge/routes/api/deviceLive.js +++ b/forge/routes/api/deviceLive.js @@ -409,6 +409,13 @@ module.exports = async function (app) { updateSettingsForCatalogue('@flowfuse-certified-nodes', cat) } } + if (team.TeamType?.properties?.extraCatalogues) { + for (const cat of team.TeamType.properties.extraCatalogues) { + if (response.palette.catalogues.indexOf(cat) == -1) { + response.palette.catalogues.push(cat) + } + } + } } catch (err) { app.log.error(`Failed to configure platform npm registry for device ${err.toString()}`) } diff --git a/forge/routes/api/project.js b/forge/routes/api/project.js index deee511e1f..0fb632dffe 100644 --- a/forge/routes/api/project.js +++ b/forge/routes/api/project.js @@ -1000,6 +1000,13 @@ module.exports = async function (app) { updateSettingsForCatalogue('@flowfuse-certified-nodes', cat) } } + if (team.TeamType?.properties?.extraCatalogues) { + for (const cat of team.TeamType.properties.extraCatalogues) { + if (settings.settings.palette.catalogue.indexOf(cat) == -1) { + settings.settings.palette.catalogue.push(cat) + } + } + } } catch (err) { app.log.error('Failed to configure platform npm registry for project', err) } diff --git a/frontend/src/pages/admin/TeamTypes/dialogs/TeamTypeEditDialog.vue b/frontend/src/pages/admin/TeamTypes/dialogs/TeamTypeEditDialog.vue index c7fe961a2a..2dcd26b343 100644 --- a/frontend/src/pages/admin/TeamTypes/dialogs/TeamTypeEditDialog.vue +++ b/frontend/src/pages/admin/TeamTypes/dialogs/TeamTypeEditDialog.vue @@ -179,6 +179,10 @@ Persistent File storage limit (Mb) Persistent Context storage limit (Mb) + + Extra Node Catalogue URLs +