diff --git a/app/assets/javascripts/admin/addon/components/admin-config-area-sidebar-experiment.hbs b/app/assets/javascripts/admin/addon/components/admin-config-area-sidebar-experiment.hbs index 0f2831af96a..6aaddf69381 100644 --- a/app/assets/javascripts/admin/addon/components/admin-config-area-sidebar-experiment.hbs +++ b/app/assets/javascripts/admin/addon/components/admin-config-area-sidebar-experiment.hbs @@ -14,7 +14,17 @@ or a href, if you want to link to a specific page but don't know the Ember route. You can also use the Ember Inspector extension to find route - names, for example for plugin routes which are not auto-generated here.

+ names, for example for plugin routes which are not auto-generated here. +

+ routeModels + is an array of values that correspond to parts of the route; for example the + topic route may be + /t/:id, so to get a link to topic with ID 123 you would do + routeModels: [123].

+ +

All configuration options for a section and its links looks like this:

+ +
{{this.exampleJson}}
{ + section.links.forEach((link) => { + if (!link.route) { + return; + } + + if (this.validRouteNames.has(link.route)) { + return; + } + + try { + this.router._router._routerMicrolib.recognizer.handlersFor( + link.route + ); + this.validRouteNames.add(link.route); + } catch { + invalidRoutes.push(link.route); + } + }); + }); + + if (invalidRoutes.length) { + this.toasts.error({ + duration: 3000, + data: { + message: `There was an error with one or more of the routes provided: ${invalidRoutes.join( + ", " + )}`, + }, + }); + return; + } + this.#saveConfig(config); }