Skip to content

Commit 831a342

Browse files
alvarezmelissa87kibanamachineelasticmachine
authored
[ML] Move duplicate Single Metric Viewer code to single location (#263155)
## Summary Fixes #201020 This PR implements a Single Metric Viewer (SMV) / time series chart refactor: logic that used to live in two places (`timeseriesexplorer.js` and `timeseriesexplorer_embeddable_chart.js`) is centralized under a new `timeseriesexplorer_chart_controller` area so the full-page Time Series Explorer and the embeddable chart share one implementation. ## Details Under the new shared module, `timeseriesexplorer_chart_controller/ `: - Data loading — `load_single_metric_context_data.ts` - Host (full-page Time Series Explorer and the embeddable SMV chart) wiring — `smv_host_wiring.ts` - Zoom / context chart pipeline — `context_chart_zoom_pipeline.ts` - Focus range resolution — `resolve_context_finish_focus_range.ts` - Table / anomaly helpers — e.g. `anomalies_table_data.ts`, `normalize_table_severity.ts`, `entity_partition_helpers.ts` - React surface / hooks — `single_metric_viewer_chart_surface.tsx`, `use_single_metric_viewer_chart_model.ts`, `partition_fields_required_callout.tsx` - Barrel — index.ts https://github.com/user-attachments/assets/198c0d78-8c07-4e43-97de-59243c3f4f49 https://github.com/user-attachments/assets/10ee5f2e-ddaf-4dd9-9a98-f87379ca8a37 https://github.com/user-attachments/assets/8f3b55ae-b1d8-40e9-9482-9e798d1282bd ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [ ] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ... --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
1 parent 0b96dd8 commit 831a342

26 files changed

Lines changed: 3114 additions & 1199 deletions

x-pack/platform/plugins/shared/ml/public/application/timeseriesexplorer/components/timeseries_chart/timeseries_chart.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2033,6 +2033,12 @@ class TimeseriesChartIntl extends Component {
20332033
closePopover={() => this.closePopover()}
20342034
panelPaddingSize="none"
20352035
anchorPosition="upLeft"
2036+
aria-label={i18n.translate(
2037+
'xpack.ml.timeSeriesExplorer.timeSeriesChart.anomalyActionsPopoverAriaLabel',
2038+
{
2039+
defaultMessage: 'Anomaly actions',
2040+
}
2041+
)}
20362042
>
20372043
<LinksMenuUI
20382044
anomaly={this.state.popoverData}

0 commit comments

Comments
 (0)