Refact: rename poste to tag
This commit is contained in:
@@ -8,7 +8,7 @@ export default {
|
||||
data_dir: '/home/lafrite/scripts/comptes/data/',
|
||||
config_dir: '/home/lafrite/scripts/comptes/config/',
|
||||
config_filename: 'config.yml',
|
||||
postes: {}
|
||||
tags: {}
|
||||
},
|
||||
getters: {
|
||||
data_dir: (state) => {
|
||||
@@ -20,13 +20,13 @@ export default {
|
||||
config_filename: (state) => {
|
||||
return state.config_filename
|
||||
},
|
||||
postes: (state) => {
|
||||
return state.postes
|
||||
tags: (state) => {
|
||||
return state.tags
|
||||
}
|
||||
},
|
||||
mutations: {
|
||||
SET_POSTES: (state, { postes }) => {
|
||||
state.postes = postes
|
||||
SET_TAGS: (state, { tags }) => {
|
||||
state.tags = tags
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
@@ -39,7 +39,7 @@ export default {
|
||||
header: true
|
||||
}
|
||||
var parsed = yaml.safeLoad(content, parseConfig)
|
||||
context.commit('SET_POSTES', { postes: parsed.postes })
|
||||
context.commit('SET_TAGS', { tags: parsed.tags })
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -136,10 +136,10 @@ export default {
|
||||
})
|
||||
},
|
||||
clean_store_data (context, parsed) {
|
||||
var postes = Object.values(context.rootGetters['config/postes'])
|
||||
var tags = Object.values(context.rootGetters['config/tags'])
|
||||
parsed.data = parsed.data.filter(x => x.Libellé !== undefined)
|
||||
parsed.data.forEach(row => {
|
||||
appendTag(row, postes, 'Libellé')
|
||||
appendTag(row, tags, 'Libellé')
|
||||
})
|
||||
|
||||
context.commit('SET_DATA', { data: parsed })
|
||||
|
||||
Reference in New Issue
Block a user