-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Fix pod logs dock tab #4738
Fix pod logs dock tab #4738
Conversation
- Move all dependencies into a transient LogsViewModel - Remove dependencies on dockStore.selectedTab - Make all bindings as late as possible, as per mobx rules Signed-off-by: Sebastian Malton <[email protected]>
} | ||
|
||
/** | ||
* @deprecated This now only returns the empty array |
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.
either the comment is wrong or you forgot to change the method implementation?
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.
Nope, it is correct because this.logs
is a getter above on line 159 which all it does is return [];
import logTabStoreInjectable from "./tab-store.injectable"; | ||
|
||
const getLogTabDataInjectable = getInjectable({ | ||
instantiate: (di) => di.inject(logTabStoreInjectable).getData, |
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.
So the logTabStore is not directly a dependency but its methods are? (just seeing if I understand)
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.
Yes that is correct. This is one of the benefits of DI since it makes testing much easier as each of these dependencies can not be overridden individually.
You can observe this in the modified tests for log-resource-selector
Move all dependencies into a transient LogsViewModel
Remove dependencies on dockStore, and logTabStore
Make all bindings as late as possible, as per mobx rules
Signed-off-by: Sebastian Malton [email protected]
This fixes an integration test regression that is pressent on #4720