-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Lens] Dynamic thresholds #107205
[Lens] Dynamic thresholds #107205
Conversation
@elasticmachine merge upstream |
…o lens/dynamic-threshold
@elasticmachine merge upstream |
options={[ | ||
{ | ||
id: `${idPrefix}solid`, | ||
label: 'Solid', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be i18n-ed?
@@ -22,7 +23,7 @@ export function getSuggestions({ | |||
// We only render metric charts for single-row queries. We require a single, numeric column. | |||
if ( | |||
table.isMultiRow || | |||
keptLayerIds.length > 1 || | |||
keptLayerIds.length !== 1 || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curious - why is this change here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point.
I made this change as a fix before introducing the better fix upstream here and forgot to restore it back
const usedSeriesTypes = uniq(state.layers.map((layer) => layer.seriesType)); | ||
return { | ||
...state, | ||
layers: [ | ||
...state.layers, | ||
newLayerState( | ||
usedSeriesTypes.length === 1 ? usedSeriesTypes[0] : state.preferredSeriesType, | ||
layerId | ||
layerId, | ||
layerType as LayerType |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is layerType
typed as string and then here asserted here to LayerType
? Cannot you just define type in types.ts
file?
return state?.layers.find(({ layerId: id }) => id === layerId)?.layerType; | ||
}, | ||
|
||
getLayerTypes(state, frame) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not a fan of this name given that we have getLayerType
that returns only type... I am thinking getLayerTypesParams
or getLayerTypesGroups
? Not ideal either :(
💔 Build Failed
Failed CI StepsTest FailuresJest Tests.x-pack/plugins/lens/public/editor_frame_service/editor_frame.editor_frame initialization should not render something before all datasources are initializedStandard Out
Stack Trace
Jest Tests.x-pack/plugins/lens/public/editor_frame_service/editor_frame.editor_frame initialization should initialize visualization state and render config panelStandard Out
Stack Trace
Jest Tests.x-pack/plugins/lens/public/editor_frame_service/editor_frame.editor_frame initialization should render the resulting expression using the expression rendererStandard Out
Stack Trace
and 81 more failures, only showing the first 3. Metrics [docs]
History
To update your PR or re-run it, just comment with: |
Summary
Fixes #87551
New Layer UI
Threshold as new layer type
Thresholds can be line or area
Tasks:
Threshold
layerType
prop to visualization layerDuplicate
dimension on threshold layer does not work properlylayerType
migrationsChecklist
Delete any items that are not applicable to this PR.
Risk Matrix
Delete this section if it is not applicable to this PR.
Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.
When forming the risk matrix, consider some of the following examples and how they may potentially impact the change: