diff --git a/src/assets/css/app.css b/src/assets/css/app.css index c507b04f38..ae21cf9cb0 100644 --- a/src/assets/css/app.css +++ b/src/assets/css/app.css @@ -5560,7 +5560,7 @@ fieldset:disabled .btn { box-shadow: var(--bs-toast-box-shadow); border-radius: var(--bs-toast-border-radius); } -.toast.showing { +.showing { opacity: 0; } .toast:not(.show) { diff --git a/src/screens/OrganizationDashboard/OrganizationDashboard.test.tsx b/src/screens/OrganizationDashboard/OrganizationDashboard.test.tsx index f1560ee4f0..257877e85d 100644 --- a/src/screens/OrganizationDashboard/OrganizationDashboard.test.tsx +++ b/src/screens/OrganizationDashboard/OrganizationDashboard.test.tsx @@ -89,6 +89,21 @@ describe('Organisation Dashboard Page', () => { // Checking if membership requests are rendered expect(screen.getByText('Jane Doe')).toBeInTheDocument(); + + const peopleBtn = screen.getByText('Members'); + const adminBtn = screen.getByText('Admins'); + const postBtn = screen.getAllByText('Posts'); + const eventBtn = screen.getAllByText('Events'); + const blockUserBtn = screen.getByText('Blocked Users'); + const requestBtn = screen.getByText('Requests'); + userEvent.click(peopleBtn); + userEvent.click(adminBtn); + userEvent.click(postBtn[0]); + userEvent.click(eventBtn[0]); + userEvent.click(postBtn[1]); + userEvent.click(eventBtn[1]); + userEvent.click(blockUserBtn); + userEvent.click(requestBtn); }); test('Testing buttons and checking empty events, posts and membership requests', async () => { diff --git a/src/screens/OrganizationDashboard/OrganizationDashboard.tsx b/src/screens/OrganizationDashboard/OrganizationDashboard.tsx index 27ab4a4e98..46a9dfa2ab 100644 --- a/src/screens/OrganizationDashboard/OrganizationDashboard.tsx +++ b/src/screens/OrganizationDashboard/OrganizationDashboard.tsx @@ -34,6 +34,12 @@ function organizationDashboard(): JSX.Element { const { t } = useTranslation('translation', { keyPrefix: 'dashboard' }); document.title = t('title'); const currentUrl = window.location.href.split('=')[1]; + const peopleLink = `/orgpeople/id=${currentUrl}`; + const postsLink = `/orgpost/id=${currentUrl}`; + const eventsLink = `/orgevents/id=${currentUrl}`; + const blockUserLink = `/blockuser/id=${currentUrl}`; + const requestLink = '/requests'; + const history = useHistory(); const [upcomingEvents, setUpcomingEvents] = useState< InterfaceQueryOrganizationEventListItem[] @@ -120,42 +126,90 @@ function organizationDashboard(): JSX.Element { ) : ( - + { + history.push(peopleLink); + }} + > } /> - + { + history.push(peopleLink); + }} + > } /> - + { + history.push(postsLink); + }} + > } /> - + { + history.push(eventsLink); + }} + > } /> - + { + history.push(blockUserLink); + }} + > } /> - + { + history.push(requestLink); + }} + > - history.push(`/orgevents/id=${currentUrl}`) - } + onClick={(): void => history.push(eventsLink)} > {t('viewAll')} @@ -214,9 +266,7 @@ function organizationDashboard(): JSX.Element { size="sm" variant="light" data-testid="viewAllPosts" - onClick={(): void => - history.push(`/orgpost/id=${currentUrl}`) - } + onClick={(): void => history.push(postsLink)} > {t('viewAll')}