mirror of
https://github.com/ansible/awx.git
synced 2026-02-02 10:08:10 -03:30
adds test to ensure page size option dropdown is removed is no page size option is passed in.
This commit is contained in:
@@ -225,6 +225,7 @@ class Lookup extends React.Component {
|
||||
page_size={page_size}
|
||||
onSetPage={this.onSetPage}
|
||||
pageSizeOptions={null}
|
||||
showPageSizeOptions={false}
|
||||
style={paginationStyling}
|
||||
/>
|
||||
</Fragment>
|
||||
|
||||
@@ -105,6 +105,7 @@ class Pagination extends Component {
|
||||
pageCount,
|
||||
page_size,
|
||||
pageSizeOptions,
|
||||
showPageSizeOptions,
|
||||
style
|
||||
} = this.props;
|
||||
const { value, isOpen } = this.state;
|
||||
@@ -128,7 +129,7 @@ class Pagination extends Component {
|
||||
<I18n>
|
||||
{({ i18n }) => (
|
||||
<div className="awx-pagination" style={style}>
|
||||
{opts && (
|
||||
{showPageSizeOptions && (
|
||||
<div className="awx-pagination__page-size-selection">
|
||||
<Trans>Items Per Page</Trans>
|
||||
<Dropdown
|
||||
@@ -236,12 +237,14 @@ Pagination.propTypes = {
|
||||
pageCount: PropTypes.number,
|
||||
pageSizeOptions: PropTypes.arrayOf(PropTypes.number),
|
||||
page_size: PropTypes.number.isRequired,
|
||||
showPageSizeOptions: PropTypes.bool
|
||||
};
|
||||
|
||||
Pagination.defaultProps = {
|
||||
count: null,
|
||||
pageCount: null,
|
||||
pageSizeOptions: [5, 10, 25, 50],
|
||||
showPageSizeOptions: true
|
||||
};
|
||||
|
||||
export default Pagination;
|
||||
|
||||
Reference in New Issue
Block a user