mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 09:17:23 +00:00
fix(client): fix some warnings (#4143)
This commit is contained in:
parent
90144e32ce
commit
b0ba197915
@ -9,8 +9,12 @@ function notify(type, messages, instance) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
instance[type]({
|
instance[type]({
|
||||||
message: messages.map?.((item: any) => {
|
message: messages.map?.((item: any, index) => {
|
||||||
return React.createElement('div', {}, typeof item === 'string' ? item : item.message);
|
return React.createElement(
|
||||||
|
'div',
|
||||||
|
{ key: `${index}_${item.message}` },
|
||||||
|
typeof item === 'string' ? item : item.message,
|
||||||
|
);
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@ import { RemoteSelect, RemoteSelectProps } from '../remote-select';
|
|||||||
import useServiceOptions, { useAssociationFieldContext } from './hooks';
|
import useServiceOptions, { useAssociationFieldContext } from './hooks';
|
||||||
|
|
||||||
export type AssociationSelectProps<P = any> = RemoteSelectProps<P> & {
|
export type AssociationSelectProps<P = any> = RemoteSelectProps<P> & {
|
||||||
|
addMode?: 'quickAdd' | 'modalAdd';
|
||||||
action?: string;
|
action?: string;
|
||||||
multiple?: boolean;
|
multiple?: boolean;
|
||||||
};
|
};
|
||||||
@ -42,7 +43,7 @@ export const filterAnalyses = (filters): any[] => {
|
|||||||
|
|
||||||
const InternalAssociationSelect = observer(
|
const InternalAssociationSelect = observer(
|
||||||
(props: AssociationSelectProps) => {
|
(props: AssociationSelectProps) => {
|
||||||
const { objectValue = true } = props;
|
const { objectValue = true, addMode: propsAddMode, ...rest } = props;
|
||||||
const field: any = useField();
|
const field: any = useField();
|
||||||
const fieldSchema = useFieldSchema();
|
const fieldSchema = useFieldSchema();
|
||||||
const service = useServiceOptions(props);
|
const service = useServiceOptions(props);
|
||||||
@ -120,7 +121,7 @@ const InternalAssociationSelect = observer(
|
|||||||
<Space.Compact style={{ display: 'flex', lineHeight: '32px' }}>
|
<Space.Compact style={{ display: 'flex', lineHeight: '32px' }}>
|
||||||
<RemoteSelect
|
<RemoteSelect
|
||||||
style={{ width: '100%' }}
|
style={{ width: '100%' }}
|
||||||
{...props}
|
{...rest}
|
||||||
size={'middle'}
|
size={'middle'}
|
||||||
objectValue={objectValue}
|
objectValue={objectValue}
|
||||||
value={value || innerValue}
|
value={value || innerValue}
|
||||||
|
Loading…
Reference in New Issue
Block a user