Group/project members - migrate non-reactive state to `provide/inject`
Summary
There are a number of properties that are currently stored in app/assets/javascripts/members/store/state.js but are not reactive so do not need to be stored there. As step one in migrating to GlTabs
we should slim down the number of properties that are stored in the Vuex store so when we move to Vuex modules only the reactive state will be stored in the namespaced Vuex store.
This also could provide some performance gains since getters/setters are added to Vuex state and these properties don't need to be reactive.
These are properties that should be converted to provide/inject
sourceId
currentUserId
canManageMembers
tableFields
tableAttrs
tableSortableFields
memberPath
requestFormatter
filteredSearchBar
Improvements
- Make it easier to move towards one Vuex store with multiple namespaced modules
- Performance gains
Risks
Minimal, this is a well tested section of the codebase
Involved components
- app/assets/javascripts/members/store/state.js
- app/assets/javascripts/members/index.js
- app/assets/javascripts/members/components/filter_sort/members_filtered_search_bar.vue
- app/assets/javascripts/members/components/table/members_table_cell.vue
- app/assets/javascripts/members/components/table/members_table.vue
- app/assets/javascripts/members/components/avatars/user_avatar.vue
- app/assets/javascripts/members/components/filter_sort/sort_dropdown.vue
- app/assets/javascripts/members/components/filter_sort/filter_sort_container.vue
Edited by Peter Hegman