fix(instance-model, compass-collection): Fetch collection info when active namepsace changes and don't show collStats when editing a view #2610
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The root cause was that we didn't emit a fetch on the model when the namespace was changed, the fix
is adding listeners for all the important events that signal that the collection is shown on the screen now
(unfortunately there is no one consistent event communicating that at the moment)
Hiding stats is a workaround for the issue with events not being emitted when we switch to the source
collection that can be used to trigger the data fetch, this is a bigger issue to resolve so for now
I'm just hiding the stats for these cases completely as they are not that important anyway when editing
and we don't consider them too important in general (new designs don't have as many shown there) so
this feels to me like an alright compromise (also allows to keep the scope of the fix to the minimum)