Skip to content
This repository has been archived by the owner on Aug 15, 2019. It is now read-only.

Commit

Permalink
feat: extensions revamp
Browse files Browse the repository at this point in the history
This Pull Request is an overhaul of the existing extension system. None of the other packages will work with these changes until updated. Unfortunately, while breaking, we will likely need to continue to refine/break as we identify better patterns and hammer out clearer interfaces.

Most notably, we'll likely see changes for `Viewports` and the interface they should expose to properly hook into the Viewer. As well as with commands to better leverage the "store" and selectors. We're still playing with where everything should live, but as we continue to iterate, the lines should refine and make themselves clearer.

Next steps following this merge:

- Update and release extensions
- Update and release `Viewers`
- Unit tests for:
    - ExtensionManager additions
    - `createDisplaySets` and sopClassHandler functionality
- Update docs for extensions/modules
- Fix: VTK window and activeViewer issue when switching between 2D MPR and cornerstone
- Sidepanels
- `react-viewerbase` changes to so multi-viewport logic can live in `Viewers` 

* Remove default config for tools
* test(ExtensionManager): registerExtensions method
* Change ExtensionManager setup to mirror commandsManager and hotkeysManager
* Don't track extensions/plugins in redux
* Switch to a class and local module registration tracking
* Remove plugins export
* ExtensionManager unit tests
* Drop unused plugins export
* Shake up top level exports
* Stop build breaking
* Depend on commands manager; special init logic depending on module type
* Tests for new commandsModule init logic and warnings
* Typos and formatting
* nuke sortingManager
* createStacks --> studyMetadata.createDisplaySets(sopClassHandlerModules) (replaces `loadStudy`, `createDisplaySets` and `createStacks`)
* sopClassHandler --> sopClassHandlerModule
* Remove dead code: ConnectedToolbarSection and setToolActive
* Missed tool export
* reorder imports
* Provide a way to specify a defaultContext, and/or per command contexts; default to VIEWER
* Assume THUNK support; see if we can dispatch multiple changes from ours, and access state across different nodes
* Remove unused commandContext
* Remove explicit context changes in favor of a redux selector
* Make sure we're filtering down to the correct module
* Remove debug logging
* Set plugin prop on layout if it's set in specificData
* Remove unused code
* No longer dispatching multiple actions in this call; so let's revert
  • Loading branch information
dannyrb authored Jun 21, 2019
1 parent 4a36e58 commit 9d7a997
Show file tree
Hide file tree
Showing 32 changed files with 797 additions and 856 deletions.
1 change: 1 addition & 0 deletions src/__mocks__/log.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export default {
warn: jest.fn(),
error: jest.fn(),
};
104 changes: 0 additions & 104 deletions src/classes/HotkeysUtil.js

This file was deleted.

11 changes: 5 additions & 6 deletions src/classes/OHIFStudyMetadataSource.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { studyMetadataManager, updateMetaDataManager } from '../utils';

import OHIFError from './OHIFError';
import { retrieveStudyMetadata } from '../studies/retrieveStudyMetadata.js';
import { StudyMetadata } from './metadata/StudyMetadata';
import { StudySummary } from './metadata/StudySummary';
import { StudyMetadataSource } from './StudyMetadataSource.js';
import { sortingManager } from '../utils/sortingManager.js';
import { updateMetaDataManager } from '../utils/updateMetaDataManager';
import studyMetadataManager from '../utils/studyMetadataManager';
import { StudySummary } from './metadata/StudySummary';
import { retrieveStudyMetadata } from '../studies/retrieveStudyMetadata.js';

export class OHIFStudyMetadataSource extends StudyMetadataSource {
/**
Expand Down Expand Up @@ -54,7 +53,7 @@ export class OHIFStudyMetadataSource extends StudyMetadataSource {
);

// Get Study display sets
const displaySets = sortingManager.getDisplaySets(studyMetadata);
const displaySets = studyMetadata.createDisplaySets();

// Set studyMetadata display sets
studyMetadata.setDisplaySets(displaySets);
Expand Down
45 changes: 0 additions & 45 deletions src/classes/extensions/ExtensionManager.js

This file was deleted.

78 changes: 0 additions & 78 deletions src/classes/extensions/OHIFPlugin.js

This file was deleted.

13 changes: 0 additions & 13 deletions src/classes/extensions/index.js

This file was deleted.

11 changes: 7 additions & 4 deletions src/classes/index.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
import {
InstanceMetadata,
SeriesMetadata,
StudyMetadata,
StudySummary,
} from './metadata';

import CommandsManager from './CommandsManager.js';
import { DICOMFileLoadingListener } from './StudyLoadingListener';
import HotkeysManager from './HotkeysManager.js';
import ImageSet from './ImageSet';
import { InstanceMetadata } from './metadata/InstanceMetadata';
import MetadataProvider from './MetadataProvider.js';
import OHIFError from './OHIFError.js';
import { OHIFStudyMetadataSource } from './OHIFStudyMetadataSource';
import { SeriesMetadata } from './metadata/SeriesMetadata';
import { StackLoadingListener } from './StudyLoadingListener';
import { StudyLoadingListener } from './StudyLoadingListener';
import { StudyMetadata } from './metadata/StudyMetadata';
import { StudyMetadataSource } from './StudyMetadataSource';
import { StudyPrefetcher } from './StudyPrefetcher';
import { StudySummary } from './metadata/StudySummary';
import { TypeSafeCollection } from './TypeSafeCollection';

//import { StudySummary } from './metadata/StudySummary';
Expand Down
Loading

0 comments on commit 9d7a997

Please sign in to comment.