Feat: Display tags in config and add colors to tag
This commit is contained in:
@@ -4,7 +4,6 @@ export function appendTag (row, keywords, field = 'Libellé') {
|
||||
// if row.libellé contains one of words and not invert it gets tagged
|
||||
// if row.libellé contains no words and invert it gets tagged
|
||||
// according to keywords [{name: string, words: [], invert: bool}]
|
||||
// row['tags'] =
|
||||
row.tags = keywords.filter(k => {
|
||||
return strContains(row[field], k.words, k.invert)
|
||||
})
|
||||
@@ -17,17 +16,17 @@ function strContains (string, words, invert) {
|
||||
}
|
||||
if (invert) {
|
||||
return words.every(v => {
|
||||
return string.indexOf(v) < 0
|
||||
return string.toLowerCase().indexOf(v.toLowerCase()) < 0
|
||||
})
|
||||
} else {
|
||||
return words.some(v => {
|
||||
return string.indexOf(v) >= 0
|
||||
return string.toLowerCase().indexOf(v.toLowerCase()) >= 0
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export function formatDate (row, field = 'Date') {
|
||||
row[field] = moment(row[field], 'DD/MM/YYYY', true)
|
||||
row[field] = moment(row[field], 'DD/MM/YYYY', true)
|
||||
}
|
||||
|
||||
export function total (row, field = 'Montant') {
|
||||
|
||||
Reference in New Issue
Block a user