feat: record readonly properties

This commit is contained in:
DarkSky committed 2024-08-26 17:54:49 +08:00
1 parent f61a902bac
commit ad99587fe2
1 file changed
+6
@@ -40,6 +40,11 @@ export const newPropertyTypes: PagePropertyType[] = [
// TODO(@Peng): add more
];
export const readonlyPropertyTypes: PagePropertyType[] = [
PagePropertyType.CreatedBy,
PagePropertyType.UpdatedBy,
];
export class PagePropertiesMetaManager {
constructor(private readonly adapter: WorkspacePropertiesAdapter) {}
@@ -97,6 +102,7 @@ export class PagePropertiesMetaManager {
type,
order: newOrder,
icon: icon ?? getDefaultIconName(type),
readonly: readonlyPropertyTypes.includes(type) || undefined,
} as const;
this.customPropertiesSchema[id] = property;
return property;