mirror of
https://gitlab.com/bramw/baserow.git
synced 2025-04-15 09:34:13 +00:00
Merge branch '3484-updating-a-cell-fails-when-a-view-is-sorted-or-grouped-by-a-linked-field-that-has-a-primary' into 'develop'
Resolve "Updating a cell fails when a view is sorted or grouped by a linked field that has a primary field of the type formula" Closes #3484 See merge request baserow/baserow!3232
This commit is contained in:
commit
5cb030a7e8
2 changed files with 25 additions and 2 deletions
8
changelog/entries/unreleased/bug/3484_.json
Normal file
8
changelog/entries/unreleased/bug/3484_.json
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"type": "bug",
|
||||
"message": "Updating a cell no longer fails when a view is sorted or grouped by a linked field whose primary field is a formula.",
|
||||
"domain": "database",
|
||||
"issue_number": 3484,
|
||||
"bullet_points": [],
|
||||
"created_at": "2025-03-10"
|
||||
}
|
|
@ -261,6 +261,14 @@ export class BaserowFormulaTypeDefinition extends Registerable {
|
|||
toBaserowFormulaType(field) {
|
||||
return this.getType()
|
||||
}
|
||||
|
||||
parseFromLinkedRowItemValue(field, value) {
|
||||
const underlyingFieldType = this.app.$registry.get(
|
||||
'field',
|
||||
this._mapFormulaTypeToFieldType(field.formula_type)
|
||||
)
|
||||
return underlyingFieldType.parseFromLinkedRowItemValue(field, value)
|
||||
}
|
||||
}
|
||||
|
||||
export class BaserowFormulaTextType extends mix(
|
||||
|
@ -753,8 +761,10 @@ export class BaserowFormulaArrayType extends mix(
|
|||
const innerSortFunction = subType.getSort(name, order, field)
|
||||
|
||||
return (a, b) => {
|
||||
const valuesA = a[name].map(subType.mapToSortableArray.bind(subType))
|
||||
const valuesB = b[name].map(subType.mapToSortableArray.bind(subType))
|
||||
const valA = Array.isArray(a[name]) ? a[name] : [a[name]]
|
||||
const valB = Array.isArray(b[name]) ? b[name] : [b[name]]
|
||||
const valuesA = valA.map(subType.mapToSortableArray.bind(subType))
|
||||
const valuesB = valB.map(subType.mapToSortableArray.bind(subType))
|
||||
|
||||
for (let i = 0; i < Math.max(valuesA.length, valuesB.length); i++) {
|
||||
let compared = 0
|
||||
|
@ -825,6 +835,11 @@ export class BaserowFormulaArrayType extends mix(
|
|||
toBaserowFormulaType(field) {
|
||||
return this.getSubType(field)?.toBaserowFormulaType(field)
|
||||
}
|
||||
|
||||
parseFromLinkedRowItemValue(field, value) {
|
||||
const subType = this.getSubType(field)
|
||||
return subType.parseFromLinkedRowItemValue(field, value)
|
||||
}
|
||||
}
|
||||
|
||||
export class BaserowFormulaFileType extends BaserowFormulaTypeDefinition {
|
||||
|
|
Loading…
Add table
Reference in a new issue