fix(client): fix some warnings (#1934)
* fix(client): fix some warnings * fix(client): fix warning
This commit is contained in:
parent
f2619b0325
commit
17ccdee9ab
@ -46,31 +46,22 @@ export const SettingsCenterDropdown = () => {
|
|||||||
<ActionContext.Provider value={{ visible, setVisible }}>
|
<ActionContext.Provider value={{ visible, setVisible }}>
|
||||||
<Dropdown
|
<Dropdown
|
||||||
placement="bottom"
|
placement="bottom"
|
||||||
overlay={
|
menu={{
|
||||||
<Menu>
|
items: [
|
||||||
{bookmarkTabs.map((tab) => {
|
...bookmarkTabs.map((tab) => ({
|
||||||
return (
|
key: `/admin/settings/${tab.path}`,
|
||||||
<Menu.Item
|
label: compile(tab.title),
|
||||||
onClick={() => {
|
})),
|
||||||
history.push('/admin/settings/' + tab.path);
|
{ type: 'divider' },
|
||||||
}}
|
{
|
||||||
key={tab.path}
|
key: '/admin/settings',
|
||||||
>
|
label: t('All plugin settings'),
|
||||||
{compile(tab.title)}
|
},
|
||||||
</Menu.Item>
|
],
|
||||||
);
|
onClick({ key }) {
|
||||||
})}
|
history.push(key);
|
||||||
<Menu.Divider></Menu.Divider>
|
},
|
||||||
<Menu.Item
|
}}
|
||||||
onClick={() => {
|
|
||||||
history.push('/admin/settings');
|
|
||||||
}}
|
|
||||||
key="/admin/settings"
|
|
||||||
>
|
|
||||||
{t('All plugin settings')}
|
|
||||||
</Menu.Item>
|
|
||||||
</Menu>
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
icon={<SettingOutlined />}
|
icon={<SettingOutlined />}
|
||||||
|
@ -332,18 +332,20 @@ export const ActionDesigner = (props) => {
|
|||||||
|
|
||||||
{isChildCollectionAction && <SchemaSettings.EnableChildCollections collectionName={name} />}
|
{isChildCollectionAction && <SchemaSettings.EnableChildCollections collectionName={name} />}
|
||||||
|
|
||||||
{!isDelete && [
|
{!isDelete && (
|
||||||
<SchemaSettings.Divider />,
|
<>
|
||||||
<SchemaSettings.Remove
|
<SchemaSettings.Divider />
|
||||||
removeParentsIfNoChildren
|
<SchemaSettings.Remove
|
||||||
breakRemoveOn={(s) => {
|
removeParentsIfNoChildren
|
||||||
return s['x-component'] === 'Space' || s['x-component'].endsWith('ActionBar');
|
breakRemoveOn={(s) => {
|
||||||
}}
|
return s['x-component'] === 'Space' || s['x-component'].endsWith('ActionBar');
|
||||||
confirm={{
|
}}
|
||||||
title: t('Delete action'),
|
confirm={{
|
||||||
}}
|
title: t('Delete action'),
|
||||||
/>,
|
}}
|
||||||
]}
|
/>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</MenuGroup>
|
</MenuGroup>
|
||||||
</GeneralSchemaDesigner>
|
</GeneralSchemaDesigner>
|
||||||
);
|
);
|
||||||
|
@ -41,7 +41,7 @@ export const ActionDrawer: ComposedActionDrawer = observer((props) => {
|
|||||||
title={field.title}
|
title={field.title}
|
||||||
{...others}
|
{...others}
|
||||||
destroyOnClose
|
destroyOnClose
|
||||||
visible={visible}
|
open={visible}
|
||||||
onClose={() => setVisible(false, true)}
|
onClose={() => setVisible(false, true)}
|
||||||
className={classNames(
|
className={classNames(
|
||||||
others.className,
|
others.className,
|
||||||
|
@ -173,8 +173,8 @@ Action.Popover = observer((props) => {
|
|||||||
<Popover
|
<Popover
|
||||||
{...props}
|
{...props}
|
||||||
destroyTooltipOnHide
|
destroyTooltipOnHide
|
||||||
visible={visible}
|
open={visible}
|
||||||
onVisibleChange={(visible) => {
|
onOpenChange={(visible) => {
|
||||||
setVisible(visible);
|
setVisible(visible);
|
||||||
}}
|
}}
|
||||||
content={props.children}
|
content={props.children}
|
||||||
|
@ -24,8 +24,8 @@ export const FilterAction = observer((props: any) => {
|
|||||||
<Popover
|
<Popover
|
||||||
destroyTooltipOnHide
|
destroyTooltipOnHide
|
||||||
placement={'bottomLeft'}
|
placement={'bottomLeft'}
|
||||||
visible={visible}
|
open={visible}
|
||||||
onVisibleChange={(visible) => {
|
onOpenChange={(visible) => {
|
||||||
setVisible(visible);
|
setVisible(visible);
|
||||||
}}
|
}}
|
||||||
trigger={'click'}
|
trigger={'click'}
|
||||||
|
@ -17,8 +17,8 @@ function IconField(props: any) {
|
|||||||
<Input.Group compact>
|
<Input.Group compact>
|
||||||
<Popover
|
<Popover
|
||||||
placement={'bottom'}
|
placement={'bottom'}
|
||||||
visible={visible}
|
open={visible}
|
||||||
onVisibleChange={(val) => {
|
onOpenChange={(val) => {
|
||||||
if (disabled) {
|
if (disabled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -45,8 +45,8 @@ export const EllipsisWithTooltip = forwardRef((props: Partial<IEllipsisWithToolt
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Popover
|
<Popover
|
||||||
visible={ellipsis && visible}
|
open={ellipsis && visible}
|
||||||
onVisibleChange={(visible) => {
|
onOpenChange={(visible) => {
|
||||||
setVisible(ellipsis && visible);
|
setVisible(ellipsis && visible);
|
||||||
}}
|
}}
|
||||||
content={
|
content={
|
||||||
|
@ -56,10 +56,16 @@ const useSortableItemId = (props) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const SortableItem: React.FC<any> = observer((props) => {
|
export const SortableItem: React.FC<any> = observer((props) => {
|
||||||
const { schema, id, ...others } = useSortableItemProps(props);
|
const { schema, id, removeParentsIfNoChildren, ...others } = useSortableItemProps(props);
|
||||||
const removeParentsIfNoChildren = others.removeParentsIfNoChildren ?? true;
|
|
||||||
return (
|
return (
|
||||||
<SortableProvider id={id} data={{ insertAdjacent: 'afterEnd', schema: schema, removeParentsIfNoChildren }}>
|
<SortableProvider
|
||||||
|
id={id}
|
||||||
|
data={{
|
||||||
|
insertAdjacent: 'afterEnd',
|
||||||
|
schema: schema,
|
||||||
|
removeParentsIfNoChildren: removeParentsIfNoChildren ?? true,
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Sortable {...others}>{props.children}</Sortable>
|
<Sortable {...others}>{props.children}</Sortable>
|
||||||
</SortableProvider>
|
</SortableProvider>
|
||||||
);
|
);
|
||||||
|
@ -3,7 +3,7 @@ import { Switch } from 'antd';
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
export const AsDefaultTemplate = React.forwardRef((props: any) => {
|
export const AsDefaultTemplate = React.forwardRef((props: any, ref) => {
|
||||||
const array = ArrayBase.useArray();
|
const array = ArrayBase.useArray();
|
||||||
const index = ArrayBase.useIndex(props.index);
|
const index = ArrayBase.useIndex(props.index);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
@ -118,8 +118,8 @@ export const SchemaSettings: React.FC<SchemaSettingsProps> & SchemaSettingsNeste
|
|||||||
const [visible, setVisible] = useState(false);
|
const [visible, setVisible] = useState(false);
|
||||||
const DropdownMenu = (
|
const DropdownMenu = (
|
||||||
<Dropdown
|
<Dropdown
|
||||||
visible={visible}
|
open={visible}
|
||||||
onVisibleChange={(visible) => {
|
onOpenChange={(visible) => {
|
||||||
setVisible(visible);
|
setVisible(visible);
|
||||||
}}
|
}}
|
||||||
overlay={<Menu>{props.children}</Menu>}
|
overlay={<Menu>{props.children}</Menu>}
|
||||||
|
@ -56,8 +56,8 @@ export const SettingsForm: any = observer((props: any) => {
|
|||||||
<FormContext.Provider value={form}>
|
<FormContext.Provider value={form}>
|
||||||
<FieldContext.Provider value={f}>
|
<FieldContext.Provider value={f}>
|
||||||
<Dropdown
|
<Dropdown
|
||||||
visible={dropdownVisible}
|
open={dropdownVisible}
|
||||||
onVisibleChange={(visible) => setDropdownVisible(visible)}
|
onOpenChange={(visible) => setDropdownVisible(visible)}
|
||||||
overlayStyle={{ width: 200 }}
|
overlayStyle={{ width: 200 }}
|
||||||
overlay={
|
overlay={
|
||||||
<Menu>
|
<Menu>
|
||||||
|
@ -56,8 +56,8 @@ export const CurrentUser = () => {
|
|||||||
<div style={{ display: 'inline-flex', verticalAlign: 'top' }}>
|
<div style={{ display: 'inline-flex', verticalAlign: 'top' }}>
|
||||||
<DropdownVisibleContext.Provider value={{ visible, setVisible }}>
|
<DropdownVisibleContext.Provider value={{ visible, setVisible }}>
|
||||||
<Dropdown
|
<Dropdown
|
||||||
visible={visible}
|
open={visible}
|
||||||
onVisibleChange={(visible) => {
|
onOpenChange={(visible) => {
|
||||||
setVisible(visible);
|
setVisible(visible);
|
||||||
}}
|
}}
|
||||||
overlay={
|
overlay={
|
||||||
|
@ -29,7 +29,7 @@ export const ImportModal = (props: any) => {
|
|||||||
title={t('Import Data')}
|
title={t('Import Data')}
|
||||||
width="50%"
|
width="50%"
|
||||||
bodyStyle={{ height: 'calc(80vh - 200px)' }}
|
bodyStyle={{ height: 'calc(80vh - 200px)' }}
|
||||||
visible={importModalVisible}
|
open={importModalVisible}
|
||||||
footer={null}
|
footer={null}
|
||||||
closable={importStatus === ImportStatus.IMPORTED}
|
closable={importStatus === ImportStatus.IMPORTED}
|
||||||
onCancel={doneHandler}
|
onCancel={doneHandler}
|
||||||
|
@ -7,7 +7,7 @@ import {
|
|||||||
} from '@nocobase/client';
|
} from '@nocobase/client';
|
||||||
import { Button, Dropdown, Menu } from 'antd';
|
import { Button, Dropdown, Menu } from 'antd';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useHistory, Link } from 'react-router-dom';
|
||||||
import { AppManager } from './AppManager';
|
import { AppManager } from './AppManager';
|
||||||
import { AppNameInput } from './AppNameInput';
|
import { AppNameInput } from './AppNameInput';
|
||||||
import { usePluginUtils } from './utils';
|
import { usePluginUtils } from './utils';
|
||||||
@ -24,40 +24,32 @@ const MultiAppManager = () => {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
const { t } = usePluginUtils();
|
const { t } = usePluginUtils();
|
||||||
const menu = (
|
const items = [
|
||||||
<Menu>
|
...(data?.data || []).map((app) => {
|
||||||
{(data?.data || []).map((app) => {
|
let link = `/apps/${app.name}/admin/`;
|
||||||
let link = `/apps/${app.name}/admin/`;
|
if (app.options?.standaloneDeployment && app.cname) {
|
||||||
if (app.options?.standaloneDeployment && app.cname) {
|
link = `//${app.cname}`;
|
||||||
link = `//${app.cname}`;
|
}
|
||||||
}
|
return {
|
||||||
return (
|
key: app.name,
|
||||||
<Menu.Item
|
label: (
|
||||||
key={app.name}
|
<a href={link} target="_blank" rel="noopener noreferrer">
|
||||||
onClick={() => {
|
|
||||||
window.open(link, '_blank');
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{app.displayName || app.name}
|
{app.displayName || app.name}
|
||||||
</Menu.Item>
|
</a>
|
||||||
);
|
),
|
||||||
})}
|
};
|
||||||
{(data?.data || []).length > 0 && <Menu.Divider />}
|
}),
|
||||||
<Menu.Item
|
{
|
||||||
onClick={() => {
|
key: '.manager',
|
||||||
history.push('/admin/settings/multi-app-manager/applications');
|
label: <Link to="/admin/settings/multi-app-manager/applications">{t('Manage applications')}</Link>,
|
||||||
}}
|
},
|
||||||
>
|
];
|
||||||
{t('Manage applications')}
|
|
||||||
</Menu.Item>
|
|
||||||
</Menu>
|
|
||||||
);
|
|
||||||
return (
|
return (
|
||||||
<Dropdown
|
<Dropdown
|
||||||
onVisibleChange={(visible) => {
|
onOpenChange={(visible) => {
|
||||||
run();
|
run();
|
||||||
}}
|
}}
|
||||||
overlay={menu}
|
menu={{ items }}
|
||||||
>
|
>
|
||||||
<Button title={'Apps'} icon={<Icon type={'AppstoreOutlined'} />} />
|
<Button title={'Apps'} icon={<Icon type={'AppstoreOutlined'} />} />
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
|
Loading…
Reference in New Issue
Block a user