mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-08 12:45:55 +08:00
feat: record readonly properties
This commit is contained in:
+6
@@ -40,6 +40,11 @@ export const newPropertyTypes: PagePropertyType[] = [
|
|||||||
// TODO(@Peng): add more
|
// TODO(@Peng): add more
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export const readonlyPropertyTypes: PagePropertyType[] = [
|
||||||
|
PagePropertyType.CreatedBy,
|
||||||
|
PagePropertyType.UpdatedBy,
|
||||||
|
];
|
||||||
|
|
||||||
export class PagePropertiesMetaManager {
|
export class PagePropertiesMetaManager {
|
||||||
constructor(private readonly adapter: WorkspacePropertiesAdapter) {}
|
constructor(private readonly adapter: WorkspacePropertiesAdapter) {}
|
||||||
|
|
||||||
@@ -97,6 +102,7 @@ export class PagePropertiesMetaManager {
|
|||||||
type,
|
type,
|
||||||
order: newOrder,
|
order: newOrder,
|
||||||
icon: icon ?? getDefaultIconName(type),
|
icon: icon ?? getDefaultIconName(type),
|
||||||
|
readonly: readonlyPropertyTypes.includes(type) || undefined,
|
||||||
} as const;
|
} as const;
|
||||||
this.customPropertiesSchema[id] = property;
|
this.customPropertiesSchema[id] = property;
|
||||||
return property;
|
return property;
|
||||||
|
|||||||
Reference in New Issue
Block a user