mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-15 05:37:32 +00:00
fix(editor): remove the fixation of created-by and created-time (#12260)
close: BS-3474, BS-3153 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced property addition to support specifying both type and name for new properties across databases and views. - Added context menu for selecting property type when adding new columns in table headers. - Introduced `addToGroup` functions to various group-by configurations for consistent grouping behavior. - **Bug Fixes** - Improved grouping logic to treat empty arrays as ungrouped in multi-member group configurations. - Refined grouping behavior to respect explicit group addition settings. - Ensured grouping operations only occur when both group key and row ID are present. - **Tests** - Updated test expectations to align with revised default column naming conventions. - Adjusted test utilities to accommodate the updated property addition method. - Improved typing simulation in column type selection for more reliable test execution. - **Improvements** - Introduced a new root component rendering on the share page to enhance UI integration. - Refined default property naming logic for clearer and more consistent column titles. - Simplified created-time and created-by property configurations for better maintainability. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -97,6 +97,7 @@ export const groupByConfigList = [
|
||||
},
|
||||
];
|
||||
},
|
||||
addToGroup: v => v,
|
||||
view: uniReactRoot.createUniComponent(MemberGroupView),
|
||||
}),
|
||||
createGroupByConfig({
|
||||
@@ -122,7 +123,7 @@ export const groupByConfigList = [
|
||||
return [ungroups];
|
||||
},
|
||||
valuesGroup: (value, _type) => {
|
||||
if (!Array.isArray(value)) {
|
||||
if (!Array.isArray(value) || value.length === 0) {
|
||||
return [ungroups];
|
||||
}
|
||||
return value.map(id => ({
|
||||
|
||||
@@ -16,11 +16,6 @@ export const createdByPropertyModelConfig = createdByColumnType.modelConfig({
|
||||
schema: zod.object({}),
|
||||
default: () => ({}),
|
||||
},
|
||||
fixed: {
|
||||
defaultData: {},
|
||||
defaultOrder: 'end',
|
||||
defaultShow: false,
|
||||
},
|
||||
rawValue: {
|
||||
schema: zod.string().nullable(),
|
||||
default: () => null,
|
||||
@@ -29,7 +24,7 @@ export const createdByPropertyModelConfig = createdByColumnType.modelConfig({
|
||||
return { value: null };
|
||||
},
|
||||
toJson: ({ value }) => value,
|
||||
fromJson: ({ value }) => value,
|
||||
setValue: () => {},
|
||||
},
|
||||
jsonValue: {
|
||||
schema: zod.string().nullable(),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Scrollable } from '@affine/component';
|
||||
import { Scrollable, uniReactRoot } from '@affine/component';
|
||||
import type { AffineEditorContainer } from '@affine/core/blocksuite/block-suite-editor';
|
||||
import { EditorOutlineViewer } from '@affine/core/blocksuite/outline-viewer';
|
||||
import { useActiveBlocksuiteEditor } from '@affine/core/components/hooks/use-block-suite-editor';
|
||||
@@ -269,6 +269,7 @@ const SharePageInner = ({
|
||||
</div>
|
||||
</div>
|
||||
<PeekViewManagerModal />
|
||||
<uniReactRoot.Root />
|
||||
</FrameworkScope>
|
||||
</FrameworkScope>
|
||||
</FrameworkScope>
|
||||
|
||||
Reference in New Issue
Block a user