-
Notifications
You must be signed in to change notification settings - Fork 244
chore(data-service, home): create a service provider / locator for data service COMPASS-7410 #5085
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
Conversation
… up provider in home
| describe('WorkspaceContent [Component]', function () { | ||
| let testAppRegistry: AppRegistry; | ||
| beforeEach(function () { | ||
| testAppRegistry = new AppRegistry(); |
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.
@addaleax for now swithcing it back to global app registry in the useAppRegistryComponent and tests, the usage of those will be removed anyway pretty soon as the plugins we mock here are the next in line to be refactored.
Now that we have an app registry scope for a connected part application, we can't rely on global === local in this part of the app to ease testing
| if (dataService === getState().dataService.dataService) { | ||
| dispatch( | ||
| globalAppRegistryEmit( | ||
| 'export-finished', |
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.
This event was used in tests but nowhere else and tests could just wait for the dispatched action instead, so I removed it
| ReturnType<typeof configureStore>['getState'] | ||
| >; | ||
|
|
||
| export type ExportPluginServices = { |
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.
Something for later, but I'm starting to think we should probably have some helper types to get those types easier from the returned plugin object maybe? Similar to React.ComponentProps or something like that
…tor export store to use service injection
7928456 to
b5b3c7a
Compare
5a1720b to
f42359b
Compare
This patch introduces a service provider for data service, plugins using data service provider need to be in the connected application tree to function and can access it directly through activate plugin method.
As we already have a few plugins that were updated to the new interface that would benefit from using this service locator, I'm refactoring them to use new mechanism
To avoid blocking work, I'll follow up with the following plugins in a separate PR: