-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(inputs): show input services status count #1430
base: develop
Are you sure you want to change the base?
Changes from all commits
8c94459
f8c33b3
e7fbdf7
1928fb8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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,23 @@ function TableHeader({ | |
); | ||
}; | ||
|
||
const getInputCountStatus = () => { | ||
const enabledRowCount = allFilteredData.filter((item) => !item.disabled).length; | ||
const showCountstatus = `(${enabledRowCount} of ${totalElement} enabled)`; | ||
|
||
return ( | ||
<Typography as="span"> | ||
{totalElement} | ||
{totalElement > 1 ? _(` ${itemLabel}s`) : _(` ${itemLabel}`)} | ||
{totalElement >= pageSize && showCountstatus} | ||
</Typography> | ||
); | ||
}; | ||
|
||
return ( | ||
<TableHeaderWrapper> | ||
<div> | ||
<span className="inputNumber"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I also wondered where it is used. So, it is used in smartx |
||
{totalElement} | ||
{totalElement > 1 ? _(` ${itemLabel}s`) : _(` ${itemLabel}`)} | ||
</span> | ||
{getInputCountStatus()} | ||
{page === PAGE_INPUT ? ( | ||
<TableSelectBoxWrapper> | ||
<Select | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see if this new functionality is auto-tested somehow. Can you add at least show it off in screenshot testing by adding more inputs there? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ideally, is to cover with unit tests ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.