-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Ability to configure cornerstone tools via extension configuration #1229
Conversation
c915f31
to
4e33770
Compare
Codecov Report
@@ Coverage Diff @@
## master #1229 +/- ##
=========================================
+ Coverage 9.5% 9.85% +0.34%
=========================================
Files 266 261 -5
Lines 6785 6605 -180
Branches 1267 1245 -22
=========================================
+ Hits 645 651 +6
+ Misses 4986 4822 -164
+ Partials 1154 1132 -22
Continue to review full report at Codecov.
|
…om:OHIF/Viewers into feat/igor/1222-configure-cornerstone-tools
…rom labelling manager
…configure-cornerstone-tools
… extension configuration
…configure-cornerstone-tools
…om:OHIF/Viewers into feat/igor/1222-configure-cornerstone-tools
|
The configuration can also be written as a JS Function in case you need to inject dependencies like external services: | ||
|
||
```js | ||
window.config = ({ randomService } = {}) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't randomService
actually be the ServicesManager
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bad example =S, updated. Thanks.
platform/viewer/src/App.js
Outdated
UIContextMenuService, | ||
UILabellingFlowService, | ||
]); | ||
_initExtensions([...defaultExtensions, ...extensions], tools); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay. I see why you did this. We are tightly coupled to cornerstone
extension, so it's always baked in. That makes it difficult to provide it's configuration in the extensions
array.
Having a specific spot for it in the application config stinks, but it's our only option until we decouple.
My only ask is that we switch from providing something as specific as tools
, and just pass in an entire cornerstoneExtensionConfig
that has a tools
key, that way we won't have a breaking change as we add more values we'd like to set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
…ect instead of tools key
Won't fix:
User Cases: