chore(prettier): full repo linting and code reformatting once and for all (#3627)
This commit is contained in:
1 parent
01500a2d4c
commit
9045ddaedc
656 files changed
+21737
-20628
No files matched your search
@@ -145,12 +145,8 @@ export default class ExtensionManager extends PubSubService {
|
||||
}
|
||||
|
||||
public onModeExit(): void {
|
||||
const {
|
||||
registeredExtensionIds,
|
||||
_servicesManager,
|
||||
_commandsManager,
|
||||
_extensionLifeCycleHooks,
|
||||
} = this;
|
||||
const { registeredExtensionIds, _servicesManager, _commandsManager, _extensionLifeCycleHooks } =
|
||||
this;
|
||||
|
||||
registeredExtensionIds.forEach(extensionId => {
|
||||
const onModeExit = _extensionLifeCycleHooks.onModeExit[extensionId];
|
||||
@@ -181,10 +177,7 @@ export default class ExtensionManager extends PubSubService {
|
||||
* @param {Object[]} extensions - Array of extensions
|
||||
*/
|
||||
public registerExtensions = async (
|
||||
extensions: (
|
||||
| ExtensionRegister
|
||||
| [ExtensionRegister, ExtensionConfiguration]
|
||||
)[],
|
||||
extensions: (ExtensionRegister | [ExtensionRegister, ExtensionConfiguration])[],
|
||||
dataSources: unknown[] = []
|
||||
): Promise<void> => {
|
||||
// Todo: we ideally should be able to run registrations in parallel
|
||||
@@ -203,11 +196,7 @@ export default class ExtensionManager extends PubSubService {
|
||||
// for (const extension of extensions)
|
||||
const ohifExtension = extension[0];
|
||||
const configuration = extension[1];
|
||||
await this.registerExtension(
|
||||
ohifExtension,
|
||||
configuration,
|
||||
dataSources
|
||||
);
|
||||
await this.registerExtension(ohifExtension, configuration, dataSources);
|
||||
} else {
|
||||
await this.registerExtension(extension, {}, dataSources);
|
||||
}
|
||||
@@ -260,13 +249,11 @@ export default class ExtensionManager extends PubSubService {
|
||||
}
|
||||
|
||||
if (extension.onModeEnter) {
|
||||
this._extensionLifeCycleHooks.onModeEnter[extensionId] =
|
||||
extension.onModeEnter;
|
||||
this._extensionLifeCycleHooks.onModeEnter[extensionId] = extension.onModeEnter;
|
||||
}
|
||||
|
||||
if (extension.onModeExit) {
|
||||
this._extensionLifeCycleHooks.onModeExit[extensionId] =
|
||||
extension.onModeExit;
|
||||
this._extensionLifeCycleHooks.onModeExit[extensionId] = extension.onModeExit;
|
||||
}
|
||||
|
||||
// Register Modules
|
||||
@@ -284,11 +271,7 @@ export default class ExtensionManager extends PubSubService {
|
||||
this._initCommandsModule(extensionModule);
|
||||
break;
|
||||
case MODULE_TYPES.DATA_SOURCE:
|
||||
this._initDataSourcesModule(
|
||||
extensionModule,
|
||||
extensionId,
|
||||
dataSources
|
||||
);
|
||||
this._initDataSourcesModule(extensionModule, extensionId, dataSources);
|
||||
break;
|
||||
case MODULE_TYPES.HANGING_PROTOCOL:
|
||||
this._initHangingProtocolsModule(extensionModule, extensionId);
|
||||
@@ -425,10 +408,7 @@ export default class ExtensionManager extends PubSubService {
|
||||
* @param dataSourceDef the data source definition to be added
|
||||
* @param activate flag to indicate if the added data source should be set to the active data source
|
||||
*/
|
||||
addDataSource(
|
||||
dataSourceDef: DataSourceDefinition,
|
||||
options = { activate: false }
|
||||
) {
|
||||
addDataSource(dataSourceDef: DataSourceDefinition, options = { activate: false }) {
|
||||
const existingDataSource = this.getDataSources(dataSourceDef.sourceName);
|
||||
if (existingDataSource?.[0]) {
|
||||
// The data source already exists and cannot be added.
|
||||
@@ -448,10 +428,7 @@ export default class ExtensionManager extends PubSubService {
|
||||
* @param dataSourceName the name of the data source to update
|
||||
* @param dataSourceConfiguration the new configuration to update the data source with
|
||||
*/
|
||||
updateDataSourceConfiguration(
|
||||
dataSourceName: string,
|
||||
dataSourceConfiguration: any
|
||||
) {
|
||||
updateDataSourceConfiguration(dataSourceName: string, dataSourceConfiguration: any) {
|
||||
const existingDataSource = this.getDataSources(dataSourceName);
|
||||
if (!existingDataSource?.[0]) {
|
||||
// Cannot update a non existent data source.
|
||||
@@ -465,10 +442,7 @@ export default class ExtensionManager extends PubSubService {
|
||||
|
||||
if (this.activeDataSource === dataSourceName) {
|
||||
// When the active data source is changed/set, fire an event to indicate that its configuration has changed.
|
||||
this._broadcastEvent(
|
||||
ExtensionManager.EVENTS.ACTIVE_DATA_SOURCE_CHANGED,
|
||||
dataSourceDef
|
||||
);
|
||||
this._broadcastEvent(ExtensionManager.EVENTS.ACTIVE_DATA_SOURCE_CHANGED, dataSourceDef);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -502,9 +476,7 @@ export default class ExtensionManager extends PubSubService {
|
||||
dataSources: Array<DataSourceDefinition> = []
|
||||
): void {
|
||||
extensionModule.forEach(element => {
|
||||
this.modulesMap[
|
||||
`${extensionId}.${MODULE_TYPES.DATA_SOURCE}.${element.name}`
|
||||
] = element;
|
||||
this.modulesMap[`${extensionId}.${MODULE_TYPES.DATA_SOURCE}.${element.name}`] = element;
|
||||
});
|
||||
|
||||
extensionModule.forEach(element => {
|
||||
@@ -539,8 +511,7 @@ export default class ExtensionManager extends PubSubService {
|
||||
Object.keys(definitions).forEach(commandName => {
|
||||
const commandDefinition = definitions[commandName];
|
||||
const commandHasContextThatDoesNotExist =
|
||||
commandDefinition.context &&
|
||||
!this._commandsManager.getContext(commandDefinition.context);
|
||||
commandDefinition.context && !this._commandsManager.getContext(commandDefinition.context);
|
||||
|
||||
if (commandHasContextThatDoesNotExist) {
|
||||
this._commandsManager.createContext(commandDefinition.context);
|
||||
|
||||
Reference in new issue
Block a user