mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[ML] Fix time range not correct in Anomaly detection field statistics flyout (#155423)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
7112c286ab
commit
a018d38687
4 changed files with 7 additions and 7 deletions
|
@ -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: FC<{
|
||||
|
@ -29,7 +29,7 @@ export const FieldStatsFlyoutProvider: FC<{
|
|||
);
|
||||
|
||||
return (
|
||||
<MLJobWizardFieldStatsFlyoutContext.Provider
|
||||
<MLFieldStatsFlyoutContext.Provider
|
||||
value={{
|
||||
isFlyoutVisible: isFieldStatsFlyoutVisible,
|
||||
setIsFlyoutVisible: setFieldStatsIsFlyoutVisible,
|
||||
|
@ -47,6 +47,6 @@ export const FieldStatsFlyoutProvider: FC<{
|
|||
dslQuery={dslQuery}
|
||||
/>
|
||||
{children}
|
||||
</MLJobWizardFieldStatsFlyoutContext.Provider>
|
||||
</MLFieldStatsFlyoutContext.Provider>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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: () => {},
|
||||
|
@ -24,5 +24,5 @@ export const MLJobWizardFieldStatsFlyoutContext = createContext<MLJobWizardField
|
|||
});
|
||||
|
||||
export function useFieldStatsFlyoutContext() {
|
||||
return useContext(MLJobWizardFieldStatsFlyoutContext);
|
||||
return useContext(MLFieldStatsFlyoutContext);
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue