Skip to content

Modular logistics and supply chain operating system (LSOS)

feat: update onboarding-registry service to allow set `default` onboard flow on registration

Ronald A. Richardsona29ca0ecb9c3
diff --git a/console/app/services/onboarding-registry.js b/console/app/services/onboarding-registry.js
index 8b8d6313..300306b5 100644
--- a/console/app/services/onboarding-registry.js
+++ b/console/app/services/onboarding-registry.js
@@ -9,7 +9,7 @@ export default class OnboardingRegistryService extends Service {
this.defaultFlow = flowId;
}
- registerFlow(flow) {
+ registerFlow(flow, options = {}) {
if (!flow || !flow.id || !flow.entry || !Array.isArray(flow.steps)) {
throw new Error('Invalid FlowDef: id, entry, steps are required');
}
@@ -23,6 +23,11 @@ export default class OnboardingRegistryService extends Service {
}
}
this.flows.set(flow.id, flow);
+
+ // If specified, set as default flow
+ if (options.default) {
+ this.defaultFlow = flow.id;
+ }
}
getFlow(id) {