feat: Add theme/config-point capability and docs. (#2641)
This is the initial addition of the config point settings to allow run time loading of GUI settings via "theme" files/parameters. The intent is to add an example PR that shows when to use config point, how to configure it, write documentation for it etc.
This commit is contained in:
1 parent
84d9ec34fc
commit
72bb074f21
10 files changed
+594
-12
No files matched your search
@@ -57,6 +57,7 @@
|
||||
"@ohif/ui": "^2.0.0",
|
||||
"@types/react": "^16.0.0",
|
||||
"classnames": "^2.2.6",
|
||||
"config-point": "^0.3.4",
|
||||
"core-js": "^3.16.1",
|
||||
"cornerstone-math": "^0.1.9",
|
||||
"cornerstone-tools": "6.0.2",
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
// Currently empty because nothing is configurable yet with themes
|
||||
}
|
||||
@@ -17,6 +17,7 @@ import {
|
||||
errorHandler
|
||||
// utils,
|
||||
} from '@ohif/core';
|
||||
import ConfigPoint from 'config-point';
|
||||
|
||||
/**
|
||||
* @param {object|func} appConfigOrFunc - application configuration, or a function that returns application configuration
|
||||
@@ -49,6 +50,10 @@ function appInit(appConfigOrFunc, defaultExtensions) {
|
||||
appConfig,
|
||||
});
|
||||
|
||||
// Load the default theme settings
|
||||
const defaultTheme = config && config.defaultTheme || 'theme';
|
||||
ConfigPoint.load(defaultTheme, '/theme', 'theme');
|
||||
|
||||
servicesManager.registerServices([
|
||||
UINotificationService,
|
||||
UIModalService,
|
||||
|
||||
Reference in new issue
Block a user