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 all 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)
- Changed feature container margins to ensure consistent separation and uniform design. [#7034](https://github.com/wazuh/wazuh-dashboard-plugins/pull/7034)
- Changed the initial width to the default columns on each selected field [#7059](https://github.com/wazuh/wazuh-dashboard-plugins/issues/7059)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ const DiscoverDataGridAdditionalControls = (
tooltip={
totalHits && totalHits > maxEntriesPerQuery
? {
ariaLabel: 'Warning',
ariaLabel: 'Info',
content: `The query results exceeded the limit of ${formatNumWithCommas(
maxEntriesPerQuery,
)} hits. Please refine your search.`,
iconType: 'alert',
iconType: 'iInCircle',
position: 'top',
}
: undefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,7 @@ const WazuhFlyoutDiscoverComponent = (props: WazuhDiscoverProps) => {
render: item => (
<EuiButtonIcon
onClick={() => onExpandRow(item)}
aria-label={
itemIdToExpandedRowMap.hasOwnProperty(item[INDEX_FIELD_NAME])
? 'Collapse'
: 'Expand'
}
aria-label='Info'
iconType={
itemIdToExpandedRowMap.hasOwnProperty(item[INDEX_FIELD_NAME])
? 'arrowDown'
Expand Down Expand Up @@ -318,11 +314,11 @@ const WazuhFlyoutDiscoverComponent = (props: WazuhDiscoverProps) => {
results?.hits?.total &&
results?.hits?.total > MAX_ENTRIES_PER_QUERY
? {
ariaLabel: 'Warning',
ariaLabel: 'Info',
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
Original file line number Diff line number Diff line change
Expand Up @@ -262,13 +262,13 @@ const InventoryVulsComponent = () => {
results?.hits?.total &&
results?.hits?.total > MAX_ENTRIES_PER_QUERY
? {
ariaLabel: 'Warning',
ariaLabel: 'Info',
content: `The query results has exceeded the limit of ${formatNumWithCommas(
MAX_ENTRIES_PER_QUERY,
)} 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,62 @@ 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}
style={{ width: '19px', height: '19px', marginBottom: '2px' }}
type={tooltip.iconType || 'iInCircle'}
aria-label={tooltip.ariaLabel || 'Info'}
/>
</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