Skip to content

Commit

Permalink
hotfix: comment bufferize edited from addRow and deleteRow in Preview…
Browse files Browse the repository at this point in the history
…Csv (already bufferized in watchers)
  • Loading branch information
JulienParis committed Sep 6, 2023
1 parent 6f5f997 commit 916752d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 8 deletions.
24 changes: 23 additions & 1 deletion html-tests/ct-guyane.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"gitfilelocal": "http://localhost:8811/statics/csv/ct-guyane.csv",
"gitfile": "https://gitlab.com/multi-coop/datami-project/datami-clients/datami-ct-guyane/-/blob/main/csv/ct-guyane.csv",
"default-tab": true,
"onlypreview": true,
"options": {
"height": "800px",
"separator": ",",
Expand Down Expand Up @@ -82,30 +83,51 @@
"nom eple": {
"position": "title"
},
"Label": {
"clg ou lyc": {
"position": "subtitle"
},
"adresse": {
"position": "adress"
},
"commune": {
"position": "adress"
},
"UAI": {
"prefix": "UAI : ",
"position": "resume"
},
"type (privé/public)": {
"position": "tags"
},
"photos_url": {
"position": "image"
}
},
"detail": {
"nom eple": {
"position": "title"
},
"clg ou lyc": {
"position": "subtitle"
},
"photos_url": {
"position": "image"
},
"adresse": {
"position": "adress"
},
"cp": {
"position": "adress"
},
"commune": {
"position": "adress"
},
"ville": {
"position": "adress"
},
"type (privé/public)": {
"position": "tags"
},
"Téléphone": {
"position": "infos",
"block_title": "Téléphone"
Expand Down
15 changes: 8 additions & 7 deletions src/components/previews/PreviewCsv.vue
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ export default {
this.removeFileSignal(signal.signalId)
break
case 'addNewRow':
// console.log('\nC > PreviewCsv > watch > fileSignals > signal : ', signal)
this.addRowEvent(signal.event)
this.removeFileSignal(signal.signalId)
break
Expand Down Expand Up @@ -707,10 +708,10 @@ export default {
added: true
}
// console.log('C > PreviewCsv > addRowEvent > newRow : ', newRow)
// console.log('C > PreviewCsv > addRowEvent > this.edited : ', this.edited)
// console.log('C > PreviewCsv > addRowEvent > this.edited (A): ', this.edited)
this.edited.push(newRow)
// console.log('C > PreviewCsv > addRowEvent > this.edited : ', this.edited)
this.bufferizeEdited()
// console.log('C > PreviewCsv > addRowEvent > this.edited (B): ', this.edited)
// this.bufferizeEdited()
// Send signal to switch to last page
this.addFileSignal('goToLastPage', {})
Expand All @@ -726,9 +727,9 @@ export default {
deleteRowsEvent (event) {
// console.log('\nC > PreviewCsv > deleteRowEvent > event : ', event)
const toDeleteIndices = event.rows.map(rowToDelete => rowToDelete.id)
let edited = [...this.edited]
edited = edited.filter(r => !toDeleteIndices.includes(r.id))
this.edited = edited
let editedTemp = [...this.edited]
editedTemp = editedTemp.filter(r => !toDeleteIndices.includes(r.id))
this.edited = editedTemp
// console.log('C > PreviewCsv > deleteRowEvent > this.edited : ', this.edited)
// update changesData
Expand All @@ -739,7 +740,7 @@ export default {
}
this.setChanges(changeObj)
})
this.bufferizeEdited()
// this.bufferizeEdited()
},
sortEdited (event) {
// console.log('\nC > PreviewCsv > sortEdited > event : ', event)
Expand Down

0 comments on commit 916752d

Please sign in to comment.