From 2c2f3d9267a59c853eb7640e913fbc944a8a245e Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Thu, 5 Oct 2023 02:02:40 -0700 Subject: [PATCH] Metrics Explorer - single-line graph only, no legends (#1068) (#1073) * Metrics Explorer - single-line graph only, no legends --------- (cherry picked from commit 408d38f8c7cb4ad0c14472b76ddb35986363f94e) Signed-off-by: Peter Fitzgibbons Signed-off-by: github-actions[bot] Co-authored-by: github-actions[bot] Co-authored-by: Peter Fitzgibbons (cherry picked from commit fe565f96ce134996040a1bcbc19ebbeefcb16545) --- auto_sync_commit_metadata.json | 4 ++-- public/components/custom_panels/helpers/utils.tsx | 14 ++++++++------ .../visualization_flyout_so.tsx | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/auto_sync_commit_metadata.json b/auto_sync_commit_metadata.json index d5abbb51f0..52ca32f29a 100644 --- a/auto_sync_commit_metadata.json +++ b/auto_sync_commit_metadata.json @@ -1,4 +1,4 @@ { - "last_github_commit": "171acde2cd2468d619cdd9bd7051144197ebd89d", - "last_gitfarm_commit": "4b5220261e4f5ecf259856ff1963e8e29dd1644b" + "last_github_commit": "fe565f96ce134996040a1bcbc19ebbeefcb16545", + "last_gitfarm_commit": "90ffcdfd909666278283a588e5770217c71865c4" } \ No newline at end of file diff --git a/public/components/custom_panels/helpers/utils.tsx b/public/components/custom_panels/helpers/utils.tsx index 3ce1b9d66f..7978caff44 100644 --- a/public/components/custom_panels/helpers/utils.tsx +++ b/public/components/custom_panels/helpers/utils.tsx @@ -5,7 +5,7 @@ import { ShortDate } from '@elastic/eui'; import { DurationRange } from '@elastic/eui/src/components/date_picker/types'; -import _, { castArray, forEach, isEmpty } from 'lodash'; +import _, { forEach, isEmpty } from 'lodash'; import { Moment } from 'moment-timezone'; import React from 'react'; import { Layout } from 'react-grid-layout'; @@ -345,10 +345,12 @@ const updateCatalogVisualizationQuery = ({ const attributesGroupString = attributesGroupBy.toString(); const startEpochTime = convertDateTime(startTime, true, false, true); const endEpochTime = convertDateTime(endTime, false, false, true); - const promQuery = - attributesGroupBy.length === 0 - ? catalogTableName - : `${aggregation} by(${attributesGroupString}) (${catalogTableName})`; + // const promQuery = + // attributesGroupBy.length === 0 + // ? `${aggregation} (${catalogTableName})` + // : `${aggregation} by(${attributesGroupString}) (${catalogTableName})`; + + const promQuery = `${aggregation} (${catalogTableName})`; return `source = ${catalogSourceName}.query_range('${promQuery}', ${startEpochTime}, ${endEpochTime}, '${spanParam}')`; }; @@ -420,7 +422,7 @@ export const renderCatalogVisualization = async ({ layoutConfig: { height: 390, margin: { t: 5 }, - legend: { orientation: 'h', yanchor: 'top', x: 0.0, y: -0.4 }, + legend: { visible: false }, }, }; diff --git a/public/components/custom_panels/panel_modules/visualization_flyout/visualization_flyout_so.tsx b/public/components/custom_panels/panel_modules/visualization_flyout/visualization_flyout_so.tsx index dc388163ac..736b9d81f1 100644 --- a/public/components/custom_panels/panel_modules/visualization_flyout/visualization_flyout_so.tsx +++ b/public/components/custom_panels/panel_modules/visualization_flyout/visualization_flyout_so.tsx @@ -50,7 +50,6 @@ import { SavedObjectsActions } from '../../../../services/saved_objects/saved_ob import { ObservabilitySavedVisualization } from '../../../../services/saved_objects/saved_object_client/types'; import { FlyoutContainers } from '../../../common/flyout_containers'; import { - convertDateTime, displayVisualization, getQueryResponse, isDateValid, @@ -59,6 +58,7 @@ import { import { replaceVizInPanel, selectPanel } from '../../redux/panel_slice'; import './visualization_flyout.scss'; import { useToast } from '../../../common/toast'; +import { convertDateTime } from '../../../common/query_utils'; /* * VisaulizationFlyoutSO - This module create a flyout to add visualization for SavedObjects custom Panels