mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 05:57:53 +00:00
fix: menu modifications do not take effect in real-time (#5207)
* fix: menu modifications do not take effect in real-time * fix: bug
This commit is contained in:
parent
db57b21e1a
commit
4399856eae
@ -272,7 +272,7 @@ export const MenuDesigner = () => {
|
|||||||
title: field.title,
|
title: field.title,
|
||||||
icon: field.componentProps.icon,
|
icon: field.componentProps.icon,
|
||||||
};
|
};
|
||||||
}, [field]);
|
}, [field.title, field.componentProps.icon]);
|
||||||
if (fieldSchema['x-component'] === 'Menu.URL') {
|
if (fieldSchema['x-component'] === 'Menu.URL') {
|
||||||
schema.properties['href'] = urlSchema;
|
schema.properties['href'] = urlSchema;
|
||||||
schema.properties['params'] = paramsSchema;
|
schema.properties['params'] = paramsSchema;
|
||||||
@ -364,7 +364,6 @@ export const MenuDesigner = () => {
|
|||||||
title: t('Delete menu item'),
|
title: t('Delete menu item'),
|
||||||
};
|
};
|
||||||
}, [t]);
|
}, [t]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<GeneralSchemaDesigner>
|
<GeneralSchemaDesigner>
|
||||||
<SchemaSettingsModalItem
|
<SchemaSettingsModalItem
|
||||||
|
@ -267,7 +267,6 @@ const HeaderMenu = ({
|
|||||||
},
|
},
|
||||||
[schema, mode, onSelect, setLoading, setDefaultSelectedKeys],
|
[schema, mode, onSelect, setLoading, setDefaultSelectedKeys],
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Component />
|
<Component />
|
||||||
@ -530,14 +529,14 @@ Menu.Item = observer(
|
|||||||
removeParentsIfNoChildren={false}
|
removeParentsIfNoChildren={false}
|
||||||
>
|
>
|
||||||
<Icon type={icon} />
|
<Icon type={icon} />
|
||||||
<span style={menuItemTitleStyle}>{t(field.title)}</span>
|
<span style={menuItemTitleStyle}>{t(schema.title)}</span>
|
||||||
<Designer />
|
<Designer />
|
||||||
</SortableItem>
|
</SortableItem>
|
||||||
</FieldContext.Provider>
|
</FieldContext.Provider>
|
||||||
</SchemaContext.Provider>
|
</SchemaContext.Provider>
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
}, [field.title, icon, schema, Designer]);
|
}, [schema.title, icon, schema, Designer]);
|
||||||
|
|
||||||
if (!pushMenuItem) {
|
if (!pushMenuItem) {
|
||||||
error('Menu.Item must be wrapped by GetMenuItemsContext.Provider');
|
error('Menu.Item must be wrapped by GetMenuItemsContext.Provider');
|
||||||
|
@ -35,12 +35,12 @@ export const CustomRequestInitializer: React.FC<any> = (props) => {
|
|||||||
const customRequestsResource = useCustomRequestsResource();
|
const customRequestsResource = useCustomRequestsResource();
|
||||||
const itemConfig = useSchemaInitializerItem();
|
const itemConfig = useSchemaInitializerItem();
|
||||||
const { insert } = useSchemaInitializer();
|
const { insert } = useSchemaInitializer();
|
||||||
|
const schema = getNewSchema();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SchemaInitializerItem
|
<SchemaInitializerItem
|
||||||
{...itemConfig}
|
{...itemConfig}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
const schema = getNewSchema();
|
|
||||||
const s = merge(schema || {}, itemConfig.schema || {});
|
const s = merge(schema || {}, itemConfig.schema || {});
|
||||||
itemConfig?.schemaInitialize?.(s);
|
itemConfig?.schemaInitialize?.(s);
|
||||||
insert(s);
|
insert(s);
|
||||||
|
Loading…
Reference in New Issue
Block a user