chore(core): edit property meta events (#9253)

fix AF-1986
This commit is contained in:
pengx17
2024-12-23 11:36:24 +00:00
parent b246a2d45f
commit 8b076cb2a7
8 changed files with 131 additions and 14 deletions

View File

@@ -89,6 +89,20 @@ export const InfoTable = ({
[]
);
const onPropertyInfoChange = useCallback(
(
property: DocCustomPropertyInfo,
field: keyof DocCustomPropertyInfo,
_value: string
) => {
track.$.docInfoPanel.property.editPropertyMeta({
type: property.type,
field,
});
},
[]
);
return (
<>
<PropertyCollapsibleSection
@@ -120,6 +134,9 @@ export const InfoTable = ({
propertyInfo={property}
defaultOpenEditMenu={newPropertyId === property.id}
onChange={value => onPropertyChange(property, value)}
onPropertyInfoChange={(...args) =>
onPropertyInfoChange(property, ...args)
}
/>
))}
<Menu

View File

@@ -23,6 +23,16 @@ const WorkspaceSettingPropertiesMain = () => {
});
}, []);
const onPropertyInfoChange = useCallback(
(property: DocCustomPropertyInfo, field: string) => {
track.$.settingsPanel.workspace.editPropertyMeta({
type: property.type,
field,
});
},
[]
);
return (
<div className={styles.main}>
<div className={styles.listHeader}>
@@ -32,7 +42,7 @@ const WorkspaceSettingPropertiesMain = () => {
</Button>
</Menu>
</div>
<DocPropertyManager />
<DocPropertyManager onPropertyInfoChange={onPropertyInfoChange} />
</div>
);
};