mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-29 00:06:09 +08:00
feat: improve kanban grouping & data materialization (#14393)
fix #13512 fix #13255 fix #9743 #### PR Dependency Tree * **PR #14393** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Enhanced Kanban view grouping support for additional property types: checkboxes, select fields, multi-select fields, members, and created-by information. * Improved drag-and-drop visual feedback with more precise drop indicators in Kanban views. * **Bug Fixes** * Refined grouping logic to ensure only compatible properties appear in group-by options. * Enhanced column visibility and ordering consistency when managing Kanban views. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -247,12 +247,13 @@ export const groupByMatchers: GroupByConfig[] = [
|
||||
matchType: t.boolean.instance(),
|
||||
groupName: (_t, v) => `${v?.toString() ?? ''}`,
|
||||
defaultKeys: _t => [
|
||||
ungroups,
|
||||
{ key: 'true', value: true },
|
||||
{ key: 'false', value: false },
|
||||
],
|
||||
valuesGroup: (v, _t) =>
|
||||
typeof v !== 'boolean' ? [ungroups] : [{ key: v.toString(), value: v }],
|
||||
typeof v !== 'boolean'
|
||||
? [{ key: 'false', value: false }]
|
||||
: [{ key: v.toString(), value: v }],
|
||||
addToGroup: (v: boolean | null, _old: boolean | null) => v,
|
||||
view: createUniComponentFromWebComponent(BooleanGroupView),
|
||||
}),
|
||||
|
||||
@@ -17,6 +17,7 @@ import { css, html, unsafeCSS } from 'lit';
|
||||
import { property, query } from 'lit/decorators.js';
|
||||
import { repeat } from 'lit/directives/repeat.js';
|
||||
|
||||
import { canGroupable } from '../../view-presets/kanban/group-by-utils.js';
|
||||
import { KanbanSingleView } from '../../view-presets/kanban/kanban-view-manager.js';
|
||||
import { TableSingleView } from '../../view-presets/table/table-view-manager.js';
|
||||
import { dataViewCssVariable } from '../common/css-variable.js';
|
||||
@@ -278,6 +279,9 @@ export const selectGroupByProperty = (
|
||||
if (property.type$.value === 'title') {
|
||||
return false;
|
||||
}
|
||||
if (view instanceof KanbanSingleView) {
|
||||
return canGroupable(view.manager.dataSource, property.id);
|
||||
}
|
||||
const dataType = property.dataType$.value;
|
||||
if (!dataType) {
|
||||
return false;
|
||||
|
||||
@@ -16,6 +16,10 @@ export type GetJsonValueFromConfig<T> =
|
||||
export type PropertyConfig<Data, RawValue = unknown, JsonValue = unknown> = {
|
||||
name: string;
|
||||
hide?: boolean;
|
||||
kanbanGroup?: {
|
||||
enabled: boolean;
|
||||
mutable?: boolean;
|
||||
};
|
||||
propertyData: {
|
||||
schema: ZodType<Data>;
|
||||
default: () => Data;
|
||||
|
||||
Reference in New Issue
Block a user