mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-16 13:57:02 +08: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:
@@ -45,10 +45,10 @@ export const database: InitFn = (collection: Workspace, id: string) => {
|
||||
const datasource = new DatabaseBlockDataSource(database);
|
||||
datasource.viewManager.viewAdd('table');
|
||||
database.props.title = new Text(title);
|
||||
const richTextId = datasource.propertyAdd(
|
||||
'end',
|
||||
databaseBlockProperties.richTextColumnConfig.type
|
||||
);
|
||||
const richTextId = datasource.propertyAdd('end', {
|
||||
type: databaseBlockProperties.richTextColumnConfig.type,
|
||||
name: 'Rich Text',
|
||||
});
|
||||
Object.values([
|
||||
propertyPresets.multiSelectPropertyConfig,
|
||||
propertyPresets.datePropertyConfig,
|
||||
@@ -57,7 +57,10 @@ export const database: InitFn = (collection: Workspace, id: string) => {
|
||||
propertyPresets.checkboxPropertyConfig,
|
||||
propertyPresets.progressPropertyConfig,
|
||||
]).forEach(column => {
|
||||
datasource.propertyAdd('end', column.type);
|
||||
datasource.propertyAdd('end', {
|
||||
type: column.type,
|
||||
name: column.config.name,
|
||||
});
|
||||
});
|
||||
if (group) {
|
||||
const groupTrait =
|
||||
|
||||
Reference in New Issue
Block a user