File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,10 +49,11 @@ const actions = {
4949 async load ( { commit } ) {
5050 commit ( 'loadViews' ) ;
5151 } ,
52- // TODO
53- //async save({ state, commit }) {
54- // ...
55- //},
52+ async save ( { state, commit } ) {
53+ localStorage . views = JSON . stringify ( state . views ) ;
54+ // After save, reload views
55+ commit ( 'loadViews' ) ;
56+ } ,
5657} ;
5758
5859// mutations
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ div(v-if="view")
1717 b-button( variant ="success" @click ="save(); editing = !editing;" )
1818 icon( name ="save" )
1919 span Save
20- b-button.ml-2 ( variant ="outline-dark" @click ="cancel (); editing = !editing;" )
20+ b-button.ml-2 ( variant ="outline-dark" @click ="discard (); editing = !editing;" )
2121 icon( name ="times" )
2222 span Cancel
2323 b-button( v-else variant ="outline-dark" size ="sm" @click ="editing = !editing" )
@@ -52,10 +52,10 @@ export default {
5252 },
5353 methods: {
5454 save () {
55- alert ( ' Not implemented ' );
55+ this . $store . dispatch ( ' views/save ' );
5656 },
57- cancel () {
58- alert ( ' Not implemented ' );
57+ discard () {
58+ this . $store . dispatch ( ' views/load ' );
5959 },
6060 addVisualization : function () {
6161 const view_id =
You can’t perform that action at this time.
0 commit comments