Migrate the Vulnerability Report pipeline tab's Vuex store to a Vuex module
The Vulnerability Report pipeline tab Vue app leverages a Vuex store. As we are moving individual tab apps to a unified Vue app, there will eventually be only one Vuex.Store
instance. So, individual stores need to be converted to store modules that can be registered seamlessly to any store.
As part of this issue, we need to convert Vulnerability Report's store to a module which involves the following:
-
The Vuex store should be created in the app's entry point rather than its store/index.js
file.-
Move Vue.use(Vuex)
to the app's entry point. -
store/index.js
only returns the store's options. -
The store is instantiated with new Vuex.Store
in the entry point.
-
-
The stores should be converted to namespaced modules. -
In store/index.js
, place all options into a namespaced module. -
Optionally, move state, actions, mutations and getters files to a sub-directory. -
Review all map*
helper usages so that they properly map to the module rather than the root.
-
-
The app's root component should register its module(s) in the created
hook. This can be done with theregisterModule
method. More on this in https://vuex.vuejs.org/guide/modules.html#dynamic-module-registration.
Edited by Paul Gascou-Vaillancourt