diff --git a/cypress/e2e/with_mock_data/catalogueItems.cy.ts b/cypress/e2e/with_mock_data/catalogueItems.cy.ts index aceca4a8d..4fcd6e3f5 100644 --- a/cypress/e2e/with_mock_data/catalogueItems.cy.ts +++ b/cypress/e2e/with_mock_data/catalogueItems.cy.ts @@ -661,6 +661,7 @@ describe('Catalogue Items', () => { cy.startSnoopingBrowserMockedRequest(); cy.findByText('Finish').click(); + cy.findByRole('dialog').should('not.exist'); cy.findBrowserMockedRequests({ method: 'PATCH', @@ -692,6 +693,7 @@ describe('Catalogue Items', () => { cy.startSnoopingBrowserMockedRequest(); cy.findByText('Finish').click(); + cy.findByRole('dialog').should('not.exist'); cy.findBrowserMockedRequests({ method: 'PATCH', diff --git a/src/catalogue/category/catalogueCardView.component.tsx b/src/catalogue/category/catalogueCardView.component.tsx index 94f322fd2..3dfa6a020 100644 --- a/src/catalogue/category/catalogueCardView.component.tsx +++ b/src/catalogue/category/catalogueCardView.component.tsx @@ -5,6 +5,8 @@ import { Pagination, Select, Typography, + useMediaQuery, + useTheme, } from '@mui/material'; import { CatalogueCategory } from '../../app.types'; import { usePreservedTableState } from '../../common/preservedTableState.component'; @@ -51,25 +53,24 @@ function CatalogueCardView(props: CatalogueCardViewProps) { endIndex ); + // Display total and pagination on separate lines if on a small screen + const theme = useTheme(); + const smallScreen = useMediaQuery(theme.breakpoints.down('sm')); + const cardViewHeight = getPageHeightCalc('100px'); + const cardViewCardsHeight = getPageHeightCalc( + `100px + ${smallScreen ? '128px' : '72px'}` + ); + return ( - - + + {displayedCatalogueCategories?.map((item, index) => ( - + ))} - - + + + + + {`Total Categories: ${catalogueCategoryData.length}`} + + + + {'Categories per page'} @@ -135,9 +144,6 @@ function CatalogueCardView(props: CatalogueCardViewProps) { 60 - - - .MuiPagination-ul': { + flexWrap: 'nowrap', + }, + }} /> diff --git a/src/catalogue/items/__snapshots__/catalogueItemsTable.component.test.tsx.snap b/src/catalogue/items/__snapshots__/catalogueItemsTable.component.test.tsx.snap index bfe1ad4be..c1973fce6 100644 --- a/src/catalogue/items/__snapshots__/catalogueItemsTable.component.test.tsx.snap +++ b/src/catalogue/items/__snapshots__/catalogueItemsTable.component.test.tsx.snap @@ -840,7 +840,7 @@ exports[`Catalogue Items Table > renders the dense table correctly 1`] = ` class="MuiCollapse-wrapperInner MuiCollapse-vertical css-9l5vo-MuiCollapse-wrapperInner" >