feat(CustomizationService):Add a customization service (#2984)
* feat(customization):Add a customization service Update UICustomizationService to v3-stable. Also, adds an example customization for tab colors * moved the customization service to ui category
This commit is contained in:
1 parent
32bb7e4c1e
commit
daa56a8449
33 files changed
+1031
-67
No files matched your search
@@ -10,7 +10,6 @@ import NotFound from './NotFound';
|
||||
import buildModeRoutes from './buildModeRoutes';
|
||||
import PrivateRoute from './PrivateRoute';
|
||||
|
||||
// TODO: Make these configurable
|
||||
// TODO: Include "routes" debug route if dev build
|
||||
const bakedInRoutes = [
|
||||
// WORK LIST
|
||||
@@ -24,10 +23,11 @@ const bakedInRoutes = [
|
||||
path: '/local',
|
||||
children: Local,
|
||||
},
|
||||
// NOT FOUND (404)
|
||||
{ component: NotFound },
|
||||
];
|
||||
|
||||
// NOT FOUND (404)
|
||||
const notFoundRoute = { component: NotFound };
|
||||
|
||||
const createRoutes = ({
|
||||
modes,
|
||||
dataSources,
|
||||
@@ -47,7 +47,17 @@ const createRoutes = ({
|
||||
hotkeysManager,
|
||||
}) || [];
|
||||
|
||||
const allRoutes = [...routes, ...bakedInRoutes];
|
||||
const { customizationService } = servicesManager.services;
|
||||
|
||||
const customRoutes = customizationService.getGlobalCustomization(
|
||||
'customRoutes'
|
||||
);
|
||||
const allRoutes = [
|
||||
...routes,
|
||||
...(customRoutes?.routes || []),
|
||||
...bakedInRoutes,
|
||||
customRoutes?.notFoundRoute || notFoundRoute,
|
||||
];
|
||||
|
||||
function RouteWithErrorBoundary({ route, ...rest }) {
|
||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||
|
||||
Reference in new issue
Block a user