From b6d96e5bc903cef2e7da44b40a84c1afa87ec0d9 Mon Sep 17 00:00:00 2001 From: katrinan029 Date: Mon, 16 Sep 2024 19:11:48 +0000 Subject: [PATCH] feat: update expand all text on enterprise customer datatable --- .../Customers/CustomerDataTable/CustomersPage.jsx | 13 ++++++++++++- .../CustomerDataTable/tests/CustomersPage.test.jsx | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/Configuration/Customers/CustomerDataTable/CustomersPage.jsx b/src/Configuration/Customers/CustomerDataTable/CustomersPage.jsx index 824208622..ec7089637 100644 --- a/src/Configuration/Customers/CustomerDataTable/CustomersPage.jsx +++ b/src/Configuration/Customers/CustomerDataTable/CustomersPage.jsx @@ -4,6 +4,7 @@ import React, { useCallback, useEffect, } from 'react'; +import PropTypes from 'prop-types'; import debounce from 'lodash.debounce'; import { Container, DataTable, TextFilter, @@ -20,6 +21,12 @@ import { import LmsApiService from '../../../data/services/EnterpriseApiService'; import CustomerDetailRowSubComponent from './CustomerDetailSubComponent'; +const expandAllRowsHandler = ({ getToggleAllRowsExpandedProps }) => ( + +); + const CustomersPage = () => { const [enterpriseList, setEnterpriseList] = useState([]); const [isLoading, setIsLoading] = useState(true); @@ -67,7 +74,7 @@ const CustomersPage = () => { columns={[ { id: 'expander', - Header: DataTable.ExpandAll, + Header: expandAllRowsHandler, Cell: DataTable.ExpandRow, }, { @@ -104,4 +111,8 @@ const CustomersPage = () => { ); }; +expandAllRowsHandler.propTypes = { + getToggleAllRowsExpandedProps: PropTypes.func.isRequired, +}; + export default CustomersPage; diff --git a/src/Configuration/Customers/CustomerDataTable/tests/CustomersPage.test.jsx b/src/Configuration/Customers/CustomerDataTable/tests/CustomersPage.test.jsx index 6c5fc3859..81c094059 100644 --- a/src/Configuration/Customers/CustomerDataTable/tests/CustomersPage.test.jsx +++ b/src/Configuration/Customers/CustomerDataTable/tests/CustomersPage.test.jsx @@ -47,7 +47,7 @@ describe('CustomersPage', () => { expect(screen.getByText('SSO Check')).toBeInTheDocument(); expect(screen.getByText('API Check')).toBeInTheDocument(); }); - + expect(screen.getByText('View subsidies')).toBeInTheDocument(); expect(screen.getByText('Customers')).toBeInTheDocument(); expect(screen.getByText('Customer details')).toBeInTheDocument(); expect(screen.getByText('SSO')).toBeInTheDocument();