-
Type: Task
-
Resolution: Gone away
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Tech debt
-
None
-
Not Needed
The standard reflux pattern is the unidirectional cycle from component to action to store to component.
Currently the collection store (internal-packages/app/stores/collection.js) is not using this reflux pattern properly.
Primary reason to do this ticket are two folds:
- It is being used less as a store and more of a setter/getter in multiple different places, which breaks the reflux pattern
- It currently sets the namespace, when it should listen to the namespace store instead (This was a challenge in completing COMPASS-548).
There are two issues here:
- collection index component sets active tab onto the store, which is accessed in a few different places via getActiveTab, which really isn't a clean pattern. The solution is to add an isActive property to the the tabs to flag whether it is visible/active/displayed or not
- a collection dump from the instance store is being cached onto this collection store every time a new collection is viewed, only to access the 'readonly' property. The solution is to store instance state in the home store. The collection store gets a list of instance collections every time the home store changes, and sets a readonly status when namespace is a collection.
Here are where the calls are being made:
- getActiveTab
- chart-builder
- chart store
- schema component
- setCollection
- databases-table
- collections-table
- sidebar-collection
- sidebar-database
- isReadonly
- collectionStats store
- document-list
- compass-explain
- explain store
- indexes index-header component
- indexes component
- load-indexes store
After this we can either get rid of the collection store or convert it to a proper store that lives in /internal-packages/collections/lib/store
- depends on
-
COMPASS-1347 Consistently call namespaces throughout compass
- Closed