Skip to content

Commit

Permalink
Merge pull request #1596 from EvanBldy/main
Browse files Browse the repository at this point in the history
[csv] fix csv exports with boolean values (force boolean values)
  • Loading branch information
NicoPennec authored Dec 5, 2024
2 parents 6a0464d + aa07845 commit 1400a17
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
10 changes: 8 additions & 2 deletions src/store/modules/assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -726,11 +726,17 @@ const actions = {
asset.description,
asset.ready_for !== 'None' ? taskTypeMap.get(asset.ready_for).name : ''
])
asset.data = asset.data || {}
sortByName([...production.descriptors])
.filter(d => d.entity_type === 'Asset')
.forEach(descriptor => {
asset.data = asset.data || {}
assetLine.push(asset.data[descriptor.field_name])
if (descriptor.data_type === 'boolean') {
assetLine.push(
asset.data[descriptor.field_name]?.toLowerCase() === 'true'
)
} else {
assetLine.push(asset.data[descriptor.field_name])
}
})
if (state.isAssetTime) {
assetLine.push(minutesToDays(organisation, asset.timeSpent).toFixed(2))
Expand Down
8 changes: 7 additions & 1 deletion src/store/modules/edits.js
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,13 @@ const actions = {
sortByName([...production.descriptors])
.filter(d => d.entity_type === 'Edit')
.forEach(descriptor => {
editLine.push(edit.data[descriptor.field_name])
if (descriptor.data_type === 'boolean') {
editLine.push(
edit.data[descriptor.field_name]?.toLowerCase() === 'true'
)
} else {
editLine.push(edit.data[descriptor.field_name])
}
})
if (state.isEditTime) {
editLine.push(minutesToDays(organisation, edit.timeSpent).toFixed(2))
Expand Down
8 changes: 7 additions & 1 deletion src/store/modules/shots.js
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,13 @@ const actions = {
sortByName([...production.descriptors])
.filter(d => d.entity_type === 'Shot')
.forEach(descriptor => {
shotLine.push(shot.data[descriptor.field_name])
if (descriptor.data_type === 'boolean') {
shotLine.push(
shot.data[descriptor.field_name]?.toLowerCase() === 'true'
)
} else {
shotLine.push(shot.data[descriptor.field_name])
}
})
if (state.isShotTime) {
shotLine.push(minutesToDays(organisation, shot.timeSpent).toFixed(2))
Expand Down

0 comments on commit 1400a17

Please sign in to comment.