1
0
Fork 0
mirror of https://gitlab.com/bramw/baserow.git synced 2025-04-04 13:15:24 +00:00

Fix sort direction reactivity for chart config

This commit is contained in:
Petr Stribny 2025-03-05 07:08:42 +01:00
parent 3f8354d946
commit 1d782c86ae
2 changed files with 8 additions and 0 deletions
enterprise/web-frontend/modules/baserow_enterprise/dashboard/components/data_source
web-frontend/modules/core/components

View file

@ -25,6 +25,8 @@
</DropdownItem>
</Dropdown>
<SegmentControl
v-if="aggregationSorts.length > 0"
ref="sortDirectionSegment"
:active-index="orderDirectionIndex"
:segments="orderDirectionOptions"
:initial-active-index="orderDirectionIndex"
@ -80,6 +82,9 @@ export default {
this.orderDirectionIndex = this.orderDirectionOptions.findIndex(
(item) => item.value === aggregationSorts[0].direction
)
if (this.$refs.sortDirectionSegment) {
this.$refs.sortDirectionSegment.reset()
}
} else {
this.sortReference = null
this.orderDirectionIndex = 0

View file

@ -92,6 +92,9 @@ export default {
this.activeIndex = index
this.$emit('update:activeIndex', index)
},
reset() {
this.activeIndex = this.initialActiveIndex
},
},
}
</script>