Mercurial > gemma
comparison client/src/store/importschedule.js @ 2974:e161e1ffb6b5 unified_import
unified_imports: AGM moved to new interface
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Mon, 08 Apr 2019 16:44:15 +0200 |
parents | 6f351e00e579 |
children | 8f266dc8b4e3 |
comparison
equal
deleted
inserted
replaced
2973:de6e5b9eae84 | 2974:e161e1ffb6b5 |
---|---|
89 depth: null, | 89 depth: null, |
90 sourceOrganization: null | 90 sourceOrganization: null |
91 }; | 91 }; |
92 }; | 92 }; |
93 | 93 |
94 const MODES = { | |
95 LIST: "list", | |
96 EDIT: "edit" | |
97 }; | |
98 | |
94 // initial state | 99 // initial state |
95 const init = () => { | 100 const init = () => { |
96 return { | 101 return { |
97 schedules: [], | 102 schedules: [], |
98 importScheduleDetailVisible: false, | 103 importScheduleDetailVisible: false, |
99 currentSchedule: initializeCurrentSchedule() | 104 currentSchedule: initializeCurrentSchedule(), |
105 mode: MODES.LIST | |
100 }; | 106 }; |
101 }; | 107 }; |
102 | 108 |
103 const importschedule = { | 109 const importschedule = { |
104 init, | 110 init, |
105 namespaced: true, | 111 namespaced: true, |
106 state: init(), | 112 state: init(), |
107 mutations: { | 113 mutations: { |
114 setEditMode: state => { | |
115 state.mode = MODES.EDIT; | |
116 }, | |
117 setListMode: state => { | |
118 state.currentSchedule = initializeCurrentSchedule(); | |
119 state.mode = MODES.LIST; | |
120 }, | |
108 setImportType: (state, type) => { | 121 setImportType: (state, type) => { |
109 Vue.set(state.currentSchedule, "importType", type); | 122 Vue.set(state.currentSchedule, "importType", type); |
110 }, | 123 }, |
111 clearCurrentSchedule: state => { | 124 clearCurrentSchedule: state => { |
112 state.currentSchedule = initializeCurrentSchedule(); | 125 state.currentSchedule = initializeCurrentSchedule(); |
324 | 337 |
325 export { | 338 export { |
326 importschedule, | 339 importschedule, |
327 initializeCurrentSchedule, | 340 initializeCurrentSchedule, |
328 IMPORTTYPES, | 341 IMPORTTYPES, |
329 IMPORTTYPEKIND | 342 IMPORTTYPEKIND, |
330 }; | 343 MODES |
344 }; |