Skip to content

Commit

Permalink
fixes text errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dplumlee committed Nov 9, 2021
1 parent 59adf61 commit 1656bdf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import React, { useState, useEffect, useMemo } from 'react';
import React, { useState, useEffect } from 'react';
import { Unit } from '@elastic/datemath';
import { ThreatMapping, Type } from '@kbn/securitysolution-io-ts-alerting-types';
import styled from 'styled-components';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ export const PreviewHistogram = ({
(): string =>
isLoading
? i18n.QUERY_PREVIEW_SUBTITLE_LOADING
: i18n.QUERY_PREVIEW_TITLE(isThresholdRule ? thresholdTotalCount : totalCount),
: isThresholdRule
? i18n.QUERY_PREVIEW_THRESHOLD_WITH_FIELD_TITLE(thresholdTotalCount)
: i18n.QUERY_PREVIEW_TITLE(totalCount),
[isLoading, totalCount, thresholdTotalCount, isThresholdRule]
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const usePreviewHistogram = ({
const { uiSettings } = useKibana().services;
const { query: queryString, filters } = query;

const [filterQuery] = convertToBuildEsQuery({
const [filterQuery, error] = convertToBuildEsQuery({
config: getEsQueryConfig(uiSettings),
indexPattern: {
fields: [
Expand Down Expand Up @@ -63,8 +63,9 @@ export const usePreviewHistogram = ({
stackByField: threshold != null ? threshold.field[0] : 'event.category',
startDate,
threshold,
skip: error != null,
};
}, [startDate, endDate, filterQuery, spaceId, threshold]);
}, [startDate, endDate, filterQuery, spaceId, error, threshold]);

return useMatrixHistogram(matrixHistogramRequest);
};

0 comments on commit 1656bdf

Please sign in to comment.