handle group structrue when export view to excel in dtable-events instead of via-dtable-server - #904
Merged
Merged
Conversation
…tead of via-dtable-server
seafile-dev
requested changes
Aug 18, 2026
| if effective_type in TEXT_SORTER_COLUMN_TYPES or effective_type == FormulaResultType.STRING: | ||
| return _sort_text(left, right, sort_type) | ||
| if effective_type in NUMBER_SORTER_COLUMN_TYPES: | ||
| return _sort_number(left, right, sort_type) |
There was a problem hiding this comment.
【严重】部门分组排序方向相反
影响:
当部门单选列按 sort_type="up" 分组时,left > right 返回 -1,结果会把较大的部门 ID 排在前;down 同样得到升序。这与设计文档要求的按 group_by.sort_type 保持组间顺序相反,会导致该类型的导出分组顺序与视图不一致。
建议修复:将这两个比较分支改为与 _sort_number 一致:升序时较大值返回 1,降序时返回 -1;并补充 up、down 及空值置后的回归测试。
Contributor
Author
There was a problem hiding this comment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.