fix(client): fix some warnings (#4143)

This commit is contained in:
Junyi 2024-04-23 21:12:37 +08:00 committed by GitHub
parent 90144e32ce
commit b0ba197915
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 4 deletions

View File

@ -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,
);
}), }),
}); });
} }

View File

@ -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}