diff --git a/docs/images/inputs/Tabs_Output.png b/docs/images/inputs/Tabs_Output.png index b67fb1911..29802f4c3 100644 Binary files a/docs/images/inputs/Tabs_Output.png and b/docs/images/inputs/Tabs_Output.png differ diff --git a/ui/src/components/CheckboxGroup/stories/__images__/CheckboxGroup-input-page-view-chromium.png b/ui/src/components/CheckboxGroup/stories/__images__/CheckboxGroup-input-page-view-chromium.png index 8c9d0ffff..5c0467b08 100644 --- a/ui/src/components/CheckboxGroup/stories/__images__/CheckboxGroup-input-page-view-chromium.png +++ b/ui/src/components/CheckboxGroup/stories/__images__/CheckboxGroup-input-page-view-chromium.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ba82abe77bd2a19627d3ca369ea967d124df0587a0c4975e471a567863a1fc11 -size 35401 +oid sha256:c45e224b046e77516c4c66a3fa283162e2dfee1ae07501cb32f4ac10814697ef +size 35327 diff --git a/ui/src/components/CheckboxGroup/stories/__images__/CheckboxGroup-required-view-chromium.png b/ui/src/components/CheckboxGroup/stories/__images__/CheckboxGroup-required-view-chromium.png index 29fc7a258..7e57bca03 100644 --- a/ui/src/components/CheckboxGroup/stories/__images__/CheckboxGroup-required-view-chromium.png +++ b/ui/src/components/CheckboxGroup/stories/__images__/CheckboxGroup-required-view-chromium.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:75dcf61492b5842f47d360c4a8e40641c9f84a4ad3a147d69c6ea4abf89f1ef8 -size 42188 +oid sha256:f6b617ade1d7e335afc51794a2e59613bf57787a888c574dc90597507bf6ad56 +size 42123 diff --git a/ui/src/components/table/TableHeader.jsx b/ui/src/components/table/TableHeader.jsx index 1e41906ee..ff3daf6c0 100644 --- a/ui/src/components/table/TableHeader.jsx +++ b/ui/src/components/table/TableHeader.jsx @@ -2,6 +2,8 @@ import React from 'react'; import PropTypes from 'prop-types'; import Select from '@splunk/react-ui/Select'; import Paginator from '@splunk/react-ui/Paginator'; +import { Typography } from '@splunk/react-ui/Typography'; + import styled from 'styled-components'; import { _ } from '@splunk/ui-utils/i18n'; @@ -71,13 +73,24 @@ function TableHeader({ ); }; + const getInputCountStatus = () => { + const enabledRowCount = allFilteredData.filter((item) => !item.disabled).length; + const showCountStatus = `(${enabledRowCount} of ${totalElement} enabled)`; + + return ( + + {totalElement} + {totalElement > 1 ? _(` ${itemLabel}s`) : _(` ${itemLabel}`)} + + {page === PAGE_INPUT && totalElement >= pageSize ? showCountStatus : null} + + ); + }; + return ( - - {totalElement} - {totalElement > 1 ? _(` ${itemLabel}s`) : _(` ${itemLabel}`)} - + {getInputCountStatus()} {page === PAGE_INPUT ? ( diff --git a/ui/src/components/table/tests/TableWrapper.test.tsx b/ui/src/components/table/tests/TableWrapper.test.tsx index df1d27445..f625a438c 100644 --- a/ui/src/components/table/tests/TableWrapper.test.tsx +++ b/ui/src/components/table/tests/TableWrapper.test.tsx @@ -3,12 +3,16 @@ import userEvent from '@testing-library/user-event'; import React from 'react'; import { http, HttpResponse } from 'msw'; import { BrowserRouter } from 'react-router-dom'; -import { MockRowData } from '../stories/rowDataMockup'; +import { MockRowData, MockRowDataForStatusCount } from '../stories/rowDataMockup'; import TableWrapper, { ITableWrapperProps } from '../TableWrapper'; import { server } from '../../../mocks/server'; import { TableContextProvider } from '../../../context/TableContext'; import { setUnifiedConfig } from '../../../util/util'; -import { getSimpleConfigWithMapping, SIMPLE_NAME_TABLE_MOCK_DATA } from '../stories/configMockups'; +import { + getSimpleConfigStylePage, + getSimpleConfigWithMapping, + SIMPLE_NAME_TABLE_MOCK_DATA, +} from '../stories/configMockups'; jest.mock('immutability-helper'); @@ -183,3 +187,29 @@ it('Correctly render status labels with mapped values', async () => { const inActiveStatusCell = within(inActiveRow).getByTestId('status'); expect(inActiveStatusCell).toHaveTextContent('Disabled Field'); }); + +it('Check inputs count is visible', async () => { + const props = { + page: 'inputs', + serviceName: 'example_input_one', + handleRequestModalOpen, + handleOpenPageStyleDialog, + displayActionBtnAllRows: false, + } satisfies ITableWrapperProps; + server.use( + http.get('/servicesNS/nobody/-/splunk_ta_uccexample_example_input_one', () => + HttpResponse.json(MockRowDataForStatusCount) + ) + ); + + setUnifiedConfig(getSimpleConfigStylePage()); + + render( + + + , + { wrapper: BrowserRouter } + ); + const statusCount = await screen.findByText('11 Inputs (7 of 11 enabled)'); + expect(statusCount).toBeInTheDocument(); +}); diff --git a/ui/src/pages/Configuration/stories/__images__/ConfigurationPage-configuration-page-view-chromium.png b/ui/src/pages/Configuration/stories/__images__/ConfigurationPage-configuration-page-view-chromium.png index 046f648b0..edc86c859 100644 --- a/ui/src/pages/Configuration/stories/__images__/ConfigurationPage-configuration-page-view-chromium.png +++ b/ui/src/pages/Configuration/stories/__images__/ConfigurationPage-configuration-page-view-chromium.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8d4895cbb18b7cbc661c4935325f344549f1949ea7c01a7d3f90be5547f984ce -size 59002 +oid sha256:03e4e711ec487ae7a72d1c275a1d8de677b97b08e9514ca1f0a51b40d6ae38ec +size 58881 diff --git a/ui/src/pages/Configuration/stories/__images__/ConfigurationPage-configuration-view-add-chromium.png b/ui/src/pages/Configuration/stories/__images__/ConfigurationPage-configuration-view-add-chromium.png index 2c26bda21..40f05296f 100644 --- a/ui/src/pages/Configuration/stories/__images__/ConfigurationPage-configuration-view-add-chromium.png +++ b/ui/src/pages/Configuration/stories/__images__/ConfigurationPage-configuration-view-add-chromium.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f5bfed616a2daff376e49f3b1863de4e060d7e184693f58bcd3bb3abd69aa5b5 -size 109484 +oid sha256:1de7642ee200080de4747d18dff55c6f0adb2199c0ccd5f19b843d943718d08e +size 109381 diff --git a/ui/src/pages/Input/stories/__images__/InputPage-input-page-expanded-row-chromium.png b/ui/src/pages/Input/stories/__images__/InputPage-input-page-expanded-row-chromium.png index dcc98f323..b741bd32e 100644 --- a/ui/src/pages/Input/stories/__images__/InputPage-input-page-expanded-row-chromium.png +++ b/ui/src/pages/Input/stories/__images__/InputPage-input-page-expanded-row-chromium.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7f0cacf018fc363c693cd7a149cd771898e2e34742cfcabd600b924c1277ae06 -size 48439 +oid sha256:c6c927a12be99bf113c5b77b6515d0106df3ec6dbf5fc4657dccaed073d3658c +size 48449 diff --git a/ui/src/pages/Input/stories/__images__/InputPage-input-page-view-add-chromium.png b/ui/src/pages/Input/stories/__images__/InputPage-input-page-view-add-chromium.png index 5fad51f3d..f7b43bc62 100644 --- a/ui/src/pages/Input/stories/__images__/InputPage-input-page-view-add-chromium.png +++ b/ui/src/pages/Input/stories/__images__/InputPage-input-page-view-add-chromium.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1d2ac3519dde33947fe59a4984f3ab0bd9715fbe6c0e876ec1c9a732ff770eb1 -size 88896 +oid sha256:889386b88a11aada93e0201f937b9be17155db91817ebecd70dd84981304b1b8 +size 88868 diff --git a/ui/src/pages/Input/stories/__images__/InputPage-input-page-view-chromium.png b/ui/src/pages/Input/stories/__images__/InputPage-input-page-view-chromium.png index 98b79d6fd..4a4c6ae74 100644 --- a/ui/src/pages/Input/stories/__images__/InputPage-input-page-view-chromium.png +++ b/ui/src/pages/Input/stories/__images__/InputPage-input-page-view-chromium.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ac995df944a3ec1fc31a8a4db2144441d89ef55a72c871912f7f27ba1fa7ca29 -size 40748 +oid sha256:0fd5382e10d3196b13dada10677ae996396f2d9156176d6273a62a9e46429706 +size 40735 diff --git a/ui/src/pages/Input/stories/__images__/InputPage-input-page-view-update-input-chromium.png b/ui/src/pages/Input/stories/__images__/InputPage-input-page-view-update-input-chromium.png index c20cd2a87..834faac7a 100644 --- a/ui/src/pages/Input/stories/__images__/InputPage-input-page-view-update-input-chromium.png +++ b/ui/src/pages/Input/stories/__images__/InputPage-input-page-view-update-input-chromium.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:05cba4e67993b6a1b152628b574b9e765428c1ec6addea5f8951bc9e47ebd1fa -size 89167 +oid sha256:94c158447ce4da53a25bd4546945d02939184b0dbae378e21d02362afb6e3c82 +size 89124 diff --git a/ui/src/pages/stories/__images__/GlobalConfigPlayground-global-config-playground-chromium.png b/ui/src/pages/stories/__images__/GlobalConfigPlayground-global-config-playground-chromium.png index 9be0aae12..86bf1cdeb 100644 --- a/ui/src/pages/stories/__images__/GlobalConfigPlayground-global-config-playground-chromium.png +++ b/ui/src/pages/stories/__images__/GlobalConfigPlayground-global-config-playground-chromium.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:68ddd13b7feccb5aac38c0215dc12645198341bed1f4793bcd8009913476284b -size 62321 +oid sha256:2294c1d592caca2fdb028950cfaed8c8ea6ae514572334ed2ba2c46062da863d +size 62175