Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set ui config to route options #1748

Merged
merged 1 commit into from
Oct 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/subapp-server/lib/fastify-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ async function registerFastifyRoutesFromFile({ fastify, srcDir, routes, topOpts

const routeOptions = Object.assign({}, topOpts, route);

routeOptions.uiConfig = _.get(fastify, "settings.app.config.ui", {});

const routeRenderer = routesFromFile.setupRouteTemplate({
subAppsByPath,
srcDir,
Expand Down Expand Up @@ -137,6 +139,8 @@ async function registerFastifyRoutesFromDir({ fastify, topOpts, routes }) {
_.pick(route, ["pageTitle", "bundleChunkSelector", "templateFile", "selectTemplate"])
);

routeOptions.uiConfig = _.get(fastify, "settings.app.config.ui", {});

assert(
routeOptions.templateFile,
`subapp-server: route ${routeInfo.name} must define templateFile`
Expand Down
2 changes: 2 additions & 0 deletions packages/subapp-server/lib/register-routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ module.exports = function registerRoutes({ routes, topOpts, server }) {
_.pick(route, ["pageTitle", "bundleChunkSelector", "templateFile", "selectTemplate"])
);

routeOptions.uiConfig = _.get(server, "settings.app.config.ui", {});

assert(
routeOptions.templateFile,
`subapp-server: route ${routeInfo.name} must define templateFile`
Expand Down
2 changes: 2 additions & 0 deletions packages/subapp-server/lib/setup-hapi-routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ async function registerRoutesFromFile({ server, srcDir, routes, topOpts }) {
const route = routes[path];
const routeOptions = Object.assign({}, topOpts, route);

routeOptions.uiConfig = _.get(server, "settings.app.config.ui", {});

// setup the template for rendering the route
const routeRenderer = routesFromFile.setupRouteTemplate({
subAppsByPath,
Expand Down