Files
alamin-br aedbdfcfd3 fix(database): guard grid against missing and stale cell values (#6207)
* fix(database): guard grid against missing and stale cell values

Grouped rows now get newly created fields, sorts treat a missing or null cell
as empty, and rich text cells tolerate a value of the previous field type.
Rows in collapsed groups resolve their group from the section key.

* fix(database): address review findings on grid cell guards

Key an undefined group value like null so pathFromKey can parse it, remove
deleted rows from collapsed groups, and sort present-but-undefined cells and
empty multiple select or collaborator formulas as empty.

* refactor(database): drop empty value for formula types that cannot be sorted

Multiple select and collaborator formulas cannot be sorted or grouped by, so a missing cell never reaches their sort.

* fix(database): sort zero in array formulas as a value

The element check treated 0 as missing, so [0] tied with [] and with other numbers.

* fix(database): keep grouped row caches shared and sort null cells as empty

addField now reuses one copy per row, so an edit reaches both sectionRows and
absoluteRows. The sort wrapper also replaces null cells.
2026-09-30 15:16:52 +02:00

27 lines
760 B
JavaScript

import createSelectOption from '@baserow/modules/database/mixins/createSelectOption'
import selectDropdown from '@baserow/modules/database/mixins/selectDropdown'
export default {
mixins: [createSelectOption, selectDropdown],
emits: ['update'],
computed: {
valueId() {
return this.value && this.value !== null ? this.value.id : null
},
},
methods: {
/**
* Checks if the new value has changed and if so it will be updated.
*/
updateValue(newId, oldValue) {
const newValue =
this.field.select_options.find((option) => option.id === newId) || null
const oldId = oldValue ? oldValue.id : null
if (newId !== oldId) {
this.$emit('update', newValue, oldValue ?? null)
}
},
},
}