Skip to content

Commit

Permalink
Merge branch '4.10.0' into 7069-create-agents-management-menu
Browse files Browse the repository at this point in the history
  • Loading branch information
yenienserrano authored Oct 22, 2024
2 parents 4c7b306 + 576a403 commit 3b24f03
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 28 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,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

0 comments on commit 3b24f03

Please sign in to comment.