feat: Add White Labelling, Hanging Protocols, and tons of Extensions / Mode fixes
* modified * new files in existing extensions/libraries/modes * fixed bugs and tests * Clean up * fix: viewport display fixed * Fixed configs for deployment * Removed unnecessary files and functions * Fixed default HP module * Added white labelling * Fixed hash routing * Removed unnecessary routers Co-authored-by: Alireza Sedghi <ar.sedghi@gmail.com>
This commit is contained in:
1 parent
0db81b30f3
commit
99b8dc4759
93 files changed
+3825
-1293
No files matched your search
@@ -2,7 +2,12 @@ import MODULE_TYPES from './MODULE_TYPES.js';
|
||||
import log from './../log.js';
|
||||
|
||||
export default class ExtensionManager {
|
||||
constructor({ commandsManager, servicesManager, hotkeysManager, appConfig = {} }) {
|
||||
constructor({
|
||||
commandsManager,
|
||||
servicesManager,
|
||||
hotkeysManager,
|
||||
appConfig = {},
|
||||
}) {
|
||||
this.modules = {};
|
||||
this.registeredExtensionIds = [];
|
||||
this.moduleTypeNames = Object.values(MODULE_TYPES);
|
||||
@@ -52,7 +57,7 @@ export default class ExtensionManager {
|
||||
onModeEnter({
|
||||
servicesManager: _servicesManager,
|
||||
commandsManager: _commandsManager,
|
||||
hotkeysManager: _hotkeysManager
|
||||
hotkeysManager: _hotkeysManager,
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -115,9 +120,7 @@ export default class ExtensionManager {
|
||||
*/
|
||||
registerExtension = (extension, configuration = {}, dataSources = []) => {
|
||||
if (!extension) {
|
||||
throw new Error(
|
||||
'Attempting to register a null/undefined extension.'
|
||||
);
|
||||
throw new Error('Attempting to register a null/undefined extension.');
|
||||
}
|
||||
|
||||
let extensionId = extension.id;
|
||||
@@ -191,6 +194,13 @@ export default class ExtensionManager {
|
||||
] = element;
|
||||
});
|
||||
break;
|
||||
case MODULE_TYPES.HANGING_PROTOCOL:
|
||||
extensionModule.forEach(element => {
|
||||
this.modulesMap[
|
||||
`${extensionId}.${moduleType}.${element.name}`
|
||||
] = element;
|
||||
});
|
||||
break;
|
||||
default:
|
||||
throw new Error(`Module type invalid: ${moduleType}`);
|
||||
}
|
||||
@@ -224,6 +234,10 @@ export default class ExtensionManager {
|
||||
return this.dataSourceMap[this.activeDataSource];
|
||||
};
|
||||
|
||||
getDataSource = () => {
|
||||
return this.dataSourceMap[this.activeDataSource];
|
||||
};
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {string} moduleType
|
||||
@@ -288,6 +302,32 @@ export default class ExtensionManager {
|
||||
});
|
||||
}
|
||||
|
||||
_initHangingProtocolModule(extensionModule, extensionId) {
|
||||
extensionModule.forEach(element => {
|
||||
const namespace = `${extensionId}.${MODULE_TYPES.HANGING_PROTOCOL}.${element.name}`;
|
||||
|
||||
dataSources.forEach(dataSource => {
|
||||
if (dataSource.namespace === namespace) {
|
||||
const dataSourceInstance = element.createDataSource(
|
||||
dataSource.configuration
|
||||
);
|
||||
|
||||
if (this.dataSourceMap[dataSource.sourceName]) {
|
||||
this.dataSourceMap[dataSource.sourceName].push(dataSourceInstance);
|
||||
} else {
|
||||
this.dataSourceMap[dataSource.sourceName] = [dataSourceInstance];
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
extensionModule.forEach(element => {
|
||||
this.modulesMap[
|
||||
`${extensionId}.${MODULE_TYPES.DATA_SOURCE}.${element.name}`
|
||||
] = element;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @private
|
||||
|
||||
@@ -215,6 +215,9 @@ describe('ExtensionManager.js', () => {
|
||||
getDataSourcesModule: () => {
|
||||
return [{}];
|
||||
},
|
||||
getHangingProtocolModule: () => {
|
||||
return [{}];
|
||||
},
|
||||
getContextModule: () => {
|
||||
return [{}];
|
||||
}
|
||||
|
||||
@@ -7,4 +7,5 @@ export default {
|
||||
VIEWPORT: 'viewportModule',
|
||||
CONTEXT: 'contextModule',
|
||||
LAYOUT_TEMPLATE: 'layoutTemplateModule',
|
||||
HANGING_PROTOCOL: 'hangingProtocolModule',
|
||||
};
|
||||
Reference in new issue
Block a user