mirror of
https://github.com/baserow/baserow.git
synced 2026-12-04 00:08:25 +00:00
* 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.
59 lines
1.6 KiB
Vue
59 lines
1.6 KiB
Vue
<template>
|
|
<div ref="cell" class="grid-view__cell grid-field-single-select__cell active">
|
|
<div
|
|
ref="dropdownLink"
|
|
class="grid-field-single-select grid-field-single-select--selected"
|
|
:class="{ 'grid-field-single-select--read-only': readOnly }"
|
|
@click="toggleDropdown()"
|
|
>
|
|
<div
|
|
v-if="value"
|
|
class="grid-field-single-select__option"
|
|
:class="'background-color--' + value.color"
|
|
>
|
|
{{ value.value }}
|
|
</div>
|
|
<i
|
|
v-if="!readOnly"
|
|
class="iconoir-nav-arrow-down grid-field-single-select__icon"
|
|
></i>
|
|
</div>
|
|
<slot name="default" :slot-props="{ editing, opened: true }"></slot>
|
|
<FieldSelectOptionsDropdown
|
|
v-if="!readOnly"
|
|
ref="dropdown"
|
|
:value="valueId"
|
|
:options="field.select_options"
|
|
:show-input="false"
|
|
:allow-create-option="true"
|
|
class="dropdown--floating"
|
|
@show="editing = true"
|
|
@hide="editing = false"
|
|
@input="updateValue($event, value)"
|
|
@create-option="createOption($event)"
|
|
></FieldSelectOptionsDropdown>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import gridField from '@baserow/modules/database/mixins/gridField'
|
|
import singleSelectField from '@baserow/modules/database/mixins/singleSelectField'
|
|
import FieldSelectOptionsDropdown from '@baserow/modules/database/components/field/FieldSelectOptionsDropdown'
|
|
|
|
export default {
|
|
components: { FieldSelectOptionsDropdown },
|
|
mixins: [gridField, singleSelectField],
|
|
emits: ['editing-changed'],
|
|
data() {
|
|
return {
|
|
editing: false,
|
|
}
|
|
},
|
|
watch: {
|
|
editing(newValue) {
|
|
this.$emit('editing-changed', newValue)
|
|
},
|
|
},
|
|
}
|
|
</script>
|