Merge pull request #10323 from allenve/master

feat: 补充crud2 外层testid
This commit is contained in:
Allen 2024-05-28 20:00:51 +08:00 committed by GitHub
commit 5090c8a737
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1335,6 +1335,7 @@ export default class CRUD2 extends React.Component<CRUD2Props, any> {
headerToolbarClassName, headerToolbarClassName,
footerToolbarClassName, footerToolbarClassName,
id, id,
testIdBuilder,
...rest ...rest
} = this.props; } = this.props;
@ -1345,8 +1346,12 @@ export default class CRUD2 extends React.Component<CRUD2Props, any> {
})} })}
style={style} style={style}
data-id={id} data-id={id}
{...testIdBuilder?.getTestId()}
> >
<div className={cx('Crud2-filter')}> <div
className={cx('Crud2-filter')}
{...testIdBuilder?.getChild('filter').getTestId()}
>
{this.renderFilter(filterSchema)} {this.renderFilter(filterSchema)}
</div> </div>
@ -1393,6 +1398,7 @@ export default class CRUD2 extends React.Component<CRUD2Props, any> {
maxKeepItemSelectionLength, maxKeepItemSelectionLength,
// valueField: valueField || primaryField, // valueField: valueField || primaryField,
primaryField: primaryField, primaryField: primaryField,
testIdBuilder,
items: store.data.items, items: store.data.items,
query: store.query, query: store.query,
orderBy: store.query.orderBy, orderBy: store.query.orderBy,