Skip to content

fix Vuex module structre for diffs and notes

Simon Knox requested to merge vuex_note_modules into changes_tab_vue_refactoring

What does this MR do?

Fixes a bunch of failing karma specs, and structures stores/modules as described in https://vuex.vuejs.org/en/structure.html

makes it easier to import/use the Stores in Components.

Rules:

  • ./stores/index.js should export a Vuex store
  • components should not instantiate stores
  • modules like in modules subfolder

Are there points in the code the reviewer needs to double check?

Not sure if actions/getters/mutations should be part of mutations or store, but being on module means they don't have to be imported whenever that module is used.

i.e. it makes sense that the diffs module contains both diffViewType in state and a setDiffViewType action, since you will always want to use them together.

Why was this MR needed?

ease of use, and consistency with docs

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Merge request reports