Skip to content

Commit

Permalink
[8.7] [ML] Fix time range not correct in Anomaly detection field stat…
Browse files Browse the repository at this point in the history
…istics flyout (#155423) (#155736)

Co-authored-by: Kibana Machine
Co-authored-by: Quynh Nguyen (Quinn) <[email protected]>
  • Loading branch information
kibanamachine and qn895 authored Apr 27, 2023
1 parent 8537ced commit 1346e39
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type { DataView } from '@kbn/data-plugin/common';
import type { FieldStatsServices } from '@kbn/unified-field-list-plugin/public';
import type { TimeRange as TimeRangeMs } from '@kbn/ml-date-picker';
import type { FieldStatsProps } from '@kbn/unified-field-list-plugin/public';
import { MLJobWizardFieldStatsFlyoutContext } from './use_field_stats_flytout_context';
import { MLFieldStatsFlyoutContext } from './use_field_stats_flytout_context';
import { FieldStatsFlyout } from './field_stats_flyout';

export const FieldStatsFlyoutProvider = ({
Expand All @@ -36,7 +36,7 @@ export const FieldStatsFlyoutProvider = ({
);

return (
<MLJobWizardFieldStatsFlyoutContext.Provider
<MLFieldStatsFlyoutContext.Provider
value={{
isFlyoutVisible: isFieldStatsFlyoutVisible,
setIsFlyoutVisible: setFieldStatsIsFlyoutVisible,
Expand All @@ -54,6 +54,6 @@ export const FieldStatsFlyoutProvider = ({
dslQuery={dslQuery}
/>
{children}
</MLJobWizardFieldStatsFlyoutContext.Provider>
</MLFieldStatsFlyoutContext.Provider>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export { FieldStatsFlyout } from './field_stats_flyout';
export { FieldStatsContent } from './field_stats_content';
export { FieldStatsFlyoutProvider } from './field_stats_flyout_provider';
export {
MLJobWizardFieldStatsFlyoutContext,
MLFieldStatsFlyoutContext,
useFieldStatsFlyoutContext,
} from './use_field_stats_flytout_context';
export { FieldStatsInfoButton } from './field_stats_info_button';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface MLJobWizardFieldStatsFlyoutProps {
setFieldValue: (v: string) => void;
fieldValue?: string | number;
}
export const MLJobWizardFieldStatsFlyoutContext = createContext<MLJobWizardFieldStatsFlyoutProps>({
export const MLFieldStatsFlyoutContext = createContext<MLJobWizardFieldStatsFlyoutProps>({
isFlyoutVisible: false,
setIsFlyoutVisible: () => {},
toggleFlyoutVisible: () => {},
Expand All @@ -24,5 +24,5 @@ export const MLJobWizardFieldStatsFlyoutContext = createContext<MLJobWizardField
});

export function useFieldStatsFlyoutContext() {
return useContext(MLJobWizardFieldStatsFlyoutContext);
return useContext(MLFieldStatsFlyoutContext);
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const WizardSteps: FC<Props> = ({ currentStep, setCurrentStep }) => {
const timeRangeMs = useMemo(() => {
// If time range is available via jobCreator, use that
// else mimic Discover and set timeRange to be now for data view without time field
return start && end ? { from: start, to: start } : undefined;
return start && end ? { from: start, to: end } : undefined;
}, [start, end]);

// store whether the advanced and additional sections have been expanded.
Expand Down

0 comments on commit 1346e39

Please sign in to comment.