Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ dependsOn:
- '@kbn/field-utils'
- '@kbn/react-query'
- '@kbn/restorable-state'
- '@kbn/esql-types'
tags:
- shared-browser
- package
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { useCallback, useEffect, useRef, useState } from 'react';
import type { EmbeddableComponentProps } from '@kbn/lens-plugin/public';
import useLatest from 'react-use/lib/useLatest';
import { useStableCallback } from '@kbn/unified-histogram';
import type { ESQLControlVariable } from '@kbn/esql-types';
import {
filter,
Observable,
Expand All @@ -38,6 +39,7 @@ export type LensProps = Pick<
| 'viewMode'
| 'timeRange'
| 'attributes'
| 'esqlVariables'
| 'noPadding'
| 'searchSessionId'
| 'executionContext'
Expand Down Expand Up @@ -87,11 +89,17 @@ export const useLensProps = ({
return getLensProps({
searchSessionId: fetchParams.searchSessionId,
timeRange: fetchParams.relativeTimeRange, // same as in the time picker
esqlVariables: fetchParams.esqlVariables,
attributes,
lastReloadRequestTime: Date.now(),
lastReloadRequestTime: fetchParams.lastReloadRequestTime,
});
},
[fetchParams.searchSessionId, fetchParams.relativeTimeRange]
[
fetchParams.searchSessionId,
fetchParams.relativeTimeRange,
fetchParams.lastReloadRequestTime,
fetchParams.esqlVariables,
]
);

const [lensPropsContext, setLensPropsContext] = useState<ReturnType<typeof buildLensProps>>();
Expand Down Expand Up @@ -186,9 +194,11 @@ const getLensProps = ({
timeRange,
attributes,
lastReloadRequestTime,
esqlVariables,
}: {
searchSessionId?: string;
attributes: LensAttributes;
esqlVariables: ESQLControlVariable[] | undefined;
timeRange: TimeRange;
lastReloadRequestTime?: number;
}): LensProps => ({
Expand All @@ -197,6 +207,7 @@ const getLensProps = ({
timeRange,
attributes,
noPadding: true,
esqlVariables,
searchSessionId,
executionContext: {
description: 'metrics experience chart data',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"@kbn/esql-utils",
"@kbn/field-utils",
"@kbn/react-query",
"@kbn/restorable-state"
"@kbn/restorable-state",
"@kbn/esql-types"
]
}