Refactor frequent items into vuex modules
- Requirements (issue)
- Tasks (epic)
- Full Context Spike MR (permanent draft)
- All MR parts ...
What does this MR do?
Currently the "Projects" and "Groups" dropdown each create their own Vue application with their own Vuex store. This will be problematic in the top nav redesign, since we'll have just 1 Vue application.
This MR refactors the "Projects" and "Groups" frequent items dropdown to work with just 1 Vuex store by moving the existing Vuex store options to a new namespaced Vuex module. This will enable us to reuse these same components in the upcoming single top nav Vue app. But, this creates 2 problems:
- How do we tell the components in the
frequent_items
component tree which Vuex module to use? - The helpers like
mapState
only accept a hardcodednamespace
.
To address problem 1, we create a new helper component called vuex_module_provider
. This takes a vuexModule
prop and passes it along to provide
so that other components can inject: ['vuexModule']
.
To address problem 2, we create a new helper module calls vuex_module_mappers
which allows us to give a function in the first argument to select the namespace from the component.
Screenshots (strongly suggested)
Everything still works
Projects dropdown | Group dropdown with search |
---|---|
Does this MR meet the acceptance criteria?
Conformity
-
📋 Does this MR need a changelog?-
I have not included a changelog entry because No user facing changes
.
-
-
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
References
Related to #301143 (closed)