Skip to content

Commit 95fd0fd

Browse files
run prettier command against all files (#444)
Signed-off-by: Jackie Han <[email protected]>
1 parent bb3f185 commit 95fd0fd

File tree

5 files changed

+66
-62
lines changed

5 files changed

+66
-62
lines changed

public/pages/AnomalyCharts/containers/AnomaliesChart.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,10 @@ export const AnomaliesChart = React.memo((props: AnomaliesChartProps) => {
110110
const handleDateRangeChange = (startDate: number, endDate: number) => {
111111
props.onDateRangeChange(startDate, endDate);
112112
props.onZoomRangeChange(startDate, endDate);
113-
if (
114-
!props.isHistorical &&
115-
endDate < get(props, 'detector.enabledTime')
116-
) {
117-
setShowOutOfRangeCallOut(true)
113+
if (!props.isHistorical && endDate < get(props, 'detector.enabledTime')) {
114+
setShowOutOfRangeCallOut(true);
118115
} else {
119-
setShowOutOfRangeCallOut(false)
116+
setShowOutOfRangeCallOut(false);
120117
}
121118
};
122119

public/pages/AnomalyCharts/containers/AnomalyDetailsChart.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -427,15 +427,19 @@ export const AnomalyDetailsChart = React.memo(
427427
return (
428428
<React.Fragment>
429429
{props.openOutOfRangeCallOut ? (
430-
<EuiCallOut data-test-subj='outOfRangeCallOut'
431-
title='Selected dates are out of the range'
432-
color='primary'>
433-
{`Your selected dates are not in the range from when the detector
430+
<EuiCallOut
431+
data-test-subj="outOfRangeCallOut"
432+
title="Selected dates are out of the range"
433+
color="primary"
434+
>
435+
{`Your selected dates are not in the range from when the detector
434436
last started streaming data
435-
(${moment(get(props, 'detector.enabledTime')).format('MM/DD/YYYY hh:mm A')}).`}
437+
(${moment(get(props, 'detector.enabledTime')).format(
438+
'MM/DD/YYYY hh:mm A'
439+
)}).`}
436440
</EuiCallOut>
437441
) : null}
438-
442+
439443
<EuiFlexGroup style={{ padding: '20px' }}>
440444
<EuiFlexItem>
441445
<EuiStat

public/pages/DefineDetector/utils/__tests__/helpers.test.tsx

Lines changed: 45 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ import {
1616
detectorDefinitionToFormik,
1717
filtersToFormik,
1818
} from '../../utils/helpers';
19-
import { Detector, OPERATORS_MAP, FILTER_TYPES } from '../../../../models/interfaces';
19+
import {
20+
Detector,
21+
OPERATORS_MAP,
22+
FILTER_TYPES,
23+
} from '../../../../models/interfaces';
2024

2125
describe('detectorDefinitionToFormik', () => {
2226
test('should return initialValues if detector is null', () => {
@@ -54,61 +58,58 @@ describe('detectorDefinitionToFormik', () => {
5458
windowDelay: randomDetector.windowDelay.period.interval,
5559
});
5660
});
57-
test('upgrade old detector\'s filters to include filter type', () => {
61+
test("upgrade old detector's filters to include filter type", () => {
5862
const randomDetector = getRandomDetector();
5963
randomDetector.uiMetadata = {
6064
features: {},
61-
filters : [
65+
filters: [
6266
{
63-
fieldInfo : [
67+
fieldInfo: [
6468
{
65-
label : 'service',
66-
type : DATA_TYPES.KEYWORD
67-
}
69+
label: 'service',
70+
type: DATA_TYPES.KEYWORD,
71+
},
6872
],
69-
fieldValue : "app_3",
70-
operator : OPERATORS_MAP.IS
73+
fieldValue: 'app_3',
74+
operator: OPERATORS_MAP.IS,
7175
},
7276
{
73-
fieldInfo : [
77+
fieldInfo: [
7478
{
75-
label : "host",
76-
type : DATA_TYPES.KEYWORD
77-
}
79+
label: 'host',
80+
type: DATA_TYPES.KEYWORD,
81+
},
7882
],
79-
fieldValue : "server_2",
80-
operator : OPERATORS_MAP.IS
81-
}
83+
fieldValue: 'server_2',
84+
operator: OPERATORS_MAP.IS,
85+
},
8286
],
83-
filterType : FILTER_TYPES.SIMPLE
87+
filterType: FILTER_TYPES.SIMPLE,
8488
};
8589
const adFormikValues = filtersToFormik(randomDetector);
86-
expect(adFormikValues).toEqual(
87-
[
88-
{
89-
fieldInfo : [
90-
{
91-
label : 'service',
92-
type : DATA_TYPES.KEYWORD
93-
}
94-
],
95-
fieldValue : "app_3",
96-
operator : OPERATORS_MAP.IS,
97-
filterType : FILTER_TYPES.SIMPLE
98-
},
99-
{
100-
fieldInfo : [
101-
{
102-
label : "host",
103-
type : DATA_TYPES.KEYWORD
104-
}
105-
],
106-
fieldValue : "server_2",
107-
operator : OPERATORS_MAP.IS,
108-
filterType : FILTER_TYPES.SIMPLE
109-
}
110-
]
111-
);
90+
expect(adFormikValues).toEqual([
91+
{
92+
fieldInfo: [
93+
{
94+
label: 'service',
95+
type: DATA_TYPES.KEYWORD,
96+
},
97+
],
98+
fieldValue: 'app_3',
99+
operator: OPERATORS_MAP.IS,
100+
filterType: FILTER_TYPES.SIMPLE,
101+
},
102+
{
103+
fieldInfo: [
104+
{
105+
label: 'host',
106+
type: DATA_TYPES.KEYWORD,
107+
},
108+
],
109+
fieldValue: 'server_2',
110+
operator: OPERATORS_MAP.IS,
111+
filterType: FILTER_TYPES.SIMPLE,
112+
},
113+
]);
112114
});
113-
114115
});

public/pages/DefineDetector/utils/helpers.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,9 @@ export function filtersToFormik(detector: Detector): UIFilter[] {
8989
},
9090
];
9191
} else {
92-
curFilters.forEach((filter: UIFilter) =>
93-
filter.filterType = curFilterType);
92+
curFilters.forEach(
93+
(filter: UIFilter) => (filter.filterType = curFilterType)
94+
);
9495
}
9596
}
9697
return curFilters;

public/pages/DetectorResults/containers/AnomalyResults.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,11 @@ export function AnomalyResults(props: AnomalyResultsProps) {
312312
/>
313313
<EuiText>
314314
<p>
315-
Attempting to initialize the detector with historical data.
316-
This initializing process takes approximately 1 minute if
317-
you have data in each of the last{' '}
318-
{32+get(detector, 'shingleSize', DEFAULT_SHINGLE_SIZE)}{' '} consecutive intervals.
315+
Attempting to initialize the detector with historical data. This
316+
initializing process takes approximately 1 minute if you have
317+
data in each of the last{' '}
318+
{32 + get(detector, 'shingleSize', DEFAULT_SHINGLE_SIZE)}{' '}
319+
consecutive intervals.
319320
</p>
320321
</EuiText>
321322
</EuiFlexGroup>

0 commit comments

Comments
 (0)