diff --git a/src/components/PeopleManagement/GroupCardGrid.jsx b/src/components/PeopleManagement/GroupCardGrid.jsx index 8c1cde76e..c875938da 100644 --- a/src/components/PeopleManagement/GroupCardGrid.jsx +++ b/src/components/PeopleManagement/GroupCardGrid.jsx @@ -1,6 +1,7 @@ import React, { useEffect, useState } from 'react'; import PropTypes from 'prop-types'; -import { CardGrid, Collapsible } from '@openedx/paragon'; +import { CardGrid, Collapsible, Icon } from '@openedx/paragon'; +import { ExpandLess, ExpandMore } from '@openedx/paragon/icons'; import GroupDetailCard from './GroupDetailCard'; @@ -30,24 +31,30 @@ const GroupCardGrid = ({ groups }) => { ))} {overflowGroups && ( - - - {overflowGroups.map((group) => ( - - ))} - - + + + + {overflowGroups.map((group) => ( + + ))} + + + + + Show all {groups.length} groups + + + Show less + + + )} ); diff --git a/src/components/PeopleManagement/_PeopleManagement.scss b/src/components/PeopleManagement/_PeopleManagement.scss index 3f943606b..ffd831088 100644 --- a/src/components/PeopleManagement/_PeopleManagement.scss +++ b/src/components/PeopleManagement/_PeopleManagement.scss @@ -7,9 +7,3 @@ padding: .25rem 1.25rem 1.25rem 1.25rem; } } - -.group-collapsible { - .collapsible-basic .collapsible-trigger { - justify-content: right; - } -} diff --git a/src/components/PeopleManagement/tests/PeopleManagementPage.test.jsx b/src/components/PeopleManagement/tests/PeopleManagementPage.test.jsx index fb69b2f23..65ce49816 100644 --- a/src/components/PeopleManagement/tests/PeopleManagementPage.test.jsx +++ b/src/components/PeopleManagement/tests/PeopleManagementPage.test.jsx @@ -146,10 +146,14 @@ describe('', () => { expect(screen.getByText('Show all 4 groups')).toBeInTheDocument(); expect(screen.queryByText('fruity pebbles')).not.toBeInTheDocument(); - const collapsible = screen.getByText('Show all 4 groups'); - collapsible.click(); + const closedCollapsible = screen.getByText('Show all 4 groups'); + closedCollapsible.click(); await waitFor(() => { expect(screen.getByText('fruity pebbles')).toBeInTheDocument(); }); + + expect(screen.queryByText('Show all 4 groups')).toBeNull(); + const openCollapsible = screen.getByText('Show less'); + expect(openCollapsible).toBeInTheDocument(); }); });