Merge pull request #6474 from thornbill/dashboard-controllers

Move dashboard controllers to app directory
This commit is contained in:
Bill Thornton
2025-02-13 16:22:36 -05:00
committed by GitHub
45 changed files with 246 additions and 222 deletions
+21 -5
View File
@@ -33,17 +33,33 @@ interface ViewOptions {
}
}
const importController = (
appType: AppType,
controller: string,
view: string
) => {
if (appType === AppType.Dashboard) {
return Promise.all([
import(/* webpackChunkName: "[request]" */ `../../apps/dashboard/controllers/${controller}`),
import(/* webpackChunkName: "[request]" */ `../../apps/dashboard/controllers/${view}`)
.then(html => globalize.translateHtml(html))
]);
}
return Promise.all([
import(/* webpackChunkName: "[request]" */ `../../controllers/${controller}`),
import(/* webpackChunkName: "[request]" */ `../../controllers/${view}`)
.then(html => globalize.translateHtml(html))
]);
};
const loadView = async (
appType: AppType,
controller: string,
view: string,
viewOptions: ViewOptions
) => {
const [ controllerFactory, viewHtml ] = await Promise.all([
import(/* webpackChunkName: "[request]" */ `../../controllers/${controller}`),
import(/* webpackChunkName: "[request]" */ `../../controllers/${view}`)
.then(html => globalize.translateHtml(html))
]);
const [ controllerFactory, viewHtml ] = await importController(appType, controller, view);
viewManager.loadView({
...viewOptions,