Skip to content
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

Substitute warning icon in events view #7057

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ All notable changes to the Wazuh app project will be documented in this file.
- Changed the agents summary in overview with no results to an agent deployment help message. [#7041](https://github.com/wazuh/wazuh-dashboard-plugins/pull/7041)
- Changed malware feature description [#7036](https://github.com/wazuh/wazuh-dashboard-plugins/pull/7036)
- Changed the font size of the kpi subtitles and the features descriptions [#7033](https://github.com/wazuh/wazuh-dashboard-plugins/pull/7033)
- Changed the warning icon in events view to a info icon [#7057](https://github.com/wazuh/wazuh-dashboard-plugins/pull/7057)

### Fixed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const DiscoverDataGridAdditionalControls = (
content: `The query results exceeded the limit of ${formatNumWithCommas(
maxEntriesPerQuery,
)} hits. Please refine your search.`,
iconType: 'alert',
iconType: 'iInCircle',
position: 'top',
}
: undefined
Expand Down
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: change the aria-label to something such as Info.

Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ const WazuhFlyoutDiscoverComponent = (props: WazuhDiscoverProps) => {
content: `The query results exceeded the limit of ${formatNumWithCommas(
MAX_ENTRIES_PER_QUERY,
)} hits. Please refine your search.`,
iconType: 'alert',
iconType: 'iInCircle',
position: 'top',
}
: undefined
Expand Down
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: change the aria-label to something such as Info.

Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ const InventoryVulsComponent = () => {
)} hits. To provide a better experience the table only shows the first ${formatNumWithCommas(
MAX_ENTRIES_PER_QUERY,
)} hits.`,
iconType: 'alert',
iconType: 'iInCircle',
position: 'top',
}
: undefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@
* under the License.
*/
import React from 'react';
import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiText, EuiToolTip, EuiIcon } from '@elastic/eui';
import {
EuiButtonEmpty,
EuiFlexGroup,
EuiFlexItem,
EuiText,
EuiToolTip,
EuiIcon,
} from '@elastic/eui';
import { FormattedMessage, I18nProvider } from '@osd/i18n/react';
import { i18n } from '@osd/i18n';
import { formatNumWithCommas } from '../../helpers';
Expand All @@ -43,45 +50,61 @@ export interface HitsCounterProps {
};
}

export function HitsCounter({ hits, showResetButton, onResetQuery, tooltip }: HitsCounterProps) {
export function HitsCounter({
hits,
showResetButton,
onResetQuery,
tooltip,
}: HitsCounterProps) {
return (
<I18nProvider>
<EuiFlexGroup
gutterSize="s"
className="dscResultCount"
gutterSize='s'
className='dscResultCount'
responsive={false}
justifyContent="center"
alignItems="center"
justifyContent='center'
alignItems='center'
>
<EuiFlexItem grow={false}>
<EuiText>
<strong data-test-subj="discoverQueryHits">{formatNumWithCommas(hits)}</strong>{' '}
<strong data-test-subj='discoverQueryHits'>
{formatNumWithCommas(hits)}
</strong>{' '}
<FormattedMessage
id="discover.hitsPluralTitle"
defaultMessage="{hits, plural, one {hit} other {hits}}"
id='discover.hitsPluralTitle'
defaultMessage='{hits, plural, one {hit} other {hits}}'
values={{
hits,
}}
/>{' '}
{tooltip && tooltip.content && (<EuiToolTip position={tooltip.position || 'top'} content={tooltip.content}>
<EuiIcon tabIndex={0} type={tooltip.iconType || 'info'} aria-label={tooltip.ariaLabel || 'Info'} />
</EuiToolTip>)}
{tooltip && tooltip.content && (
<EuiToolTip
position={tooltip.position || 'top'}
content={tooltip.content}
>
<EuiIcon
tabIndex={0}
type={tooltip.iconType || 'iInCircle'}
aria-label={tooltip.ariaLabel || 'iInCircle'}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: restore the default value for the aria-label.

/>
</EuiToolTip>
)}
</EuiText>
</EuiFlexItem>
{showResetButton && (
<EuiFlexItem grow={false}>
<EuiButtonEmpty
iconType="refresh"
data-test-subj="resetSavedSearch"
iconType='refresh'
data-test-subj='resetSavedSearch'
onClick={onResetQuery}
size="s"
size='s'
aria-label={i18n.translate('discover.reloadSavedSearchButton', {
defaultMessage: 'Reset search',
})}
>
<FormattedMessage
id="discover.reloadSavedSearchButton"
defaultMessage="Reset search"
id='discover.reloadSavedSearchButton'
defaultMessage='Reset search'
/>
</EuiButtonEmpty>
</EuiFlexItem>
Expand Down
Loading