/* * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 */ import React, { ChangeEvent, Component } from "react"; import { EuiSpacer, EuiTitle, EuiFlexGroup, EuiFlexItem, EuiCallOut, EuiComboBoxOptionOption } from "@elastic/eui"; import { RouteComponentProps } from "react-router-dom"; import { RollupService } from "../../../../services"; import { BREADCRUMBS, ROUTES } from "../../../../utils/constants"; import CreateRollupSteps from "../../components/CreateRollupSteps"; import TimeAggregation from "../../components/TimeAggregations"; import AdvancedAggregation from "../../components/AdvancedAggregation"; import MetricsCalculation from "../../components/MetricsCalculation"; import { DimensionItem, FieldItem, MetricItem } from "../../../../../models/interfaces"; import { CoreServicesContext } from "../../../../components/core_services"; interface CreateRollupStep2Props extends RouteComponentProps { rollupService: RollupService; currentStep: number; fields: FieldItem[]; selectedTerms: FieldItem[]; selectedDimensionField: DimensionItem[]; selectedMetrics: MetricItem[]; metricError: string; timestamp: EuiComboBoxOptionOption[]; timestampError: string; intervalValue: number; intervalType: string; timezone: string; timeunit: string; onChangeTimestamp: (selectedOptions: EuiComboBoxOptionOption[]) => void; onChangeIntervalType: (optionId: string) => void; onChangeIntervalValue: (e: ChangeEvent) => void; onChangeTimeunit: (e: ChangeEvent) => void; onChangeTimezone: (e: ChangeEvent) => void; onDimensionSelectionChange: (selectedFields: DimensionItem[]) => void; onMetricSelectionChange: (selectedFields: MetricItem[]) => void; } export default class CreateRollupStep2 extends Component { static contextType = CoreServicesContext; constructor(props: CreateRollupStep2Props) { super(props); } componentDidMount = async (): Promise => { this.context.chrome.setBreadcrumbs([BREADCRUMBS.INDEX_MANAGEMENT, BREADCRUMBS.ROLLUPS]); }; onCancel = (): void => { this.props.history.push(ROUTES.ROLLUPS); }; render() { if (this.props.currentStep !== 2) return null; const { fields, timestamp } = this.props; return (

Define aggregations and metrics

You can't change aggregations or metrics after creating a job. Double-check your choices before proceeding.

); } }