From b772a0fb5618d7843d59ab63afc007f145af563a Mon Sep 17 00:00:00 2001 From: SagarRajput-7 <162284829+SagarRajput-7@users.noreply.github.com> Date: Wed, 12 Feb 2025 11:29:07 +0530 Subject: [PATCH] feat: changed visible Panel name for Value Panel to Number (#7092) * feat: changed visible Panel name for Value Panel to Number * feat: added display values to enum --- frontend/src/constants/queryBuilder.ts | 10 ++++++++ .../ComponentsSlider/menuItems.tsx | 16 ++++++------- .../NewWidget/RightContainer/index.tsx | 5 ++-- frontend/yarn.lock | 24 ++++++++++++------- 4 files changed, 36 insertions(+), 19 deletions(-) diff --git a/frontend/src/constants/queryBuilder.ts b/frontend/src/constants/queryBuilder.ts index 5fe7112796..60b38480b4 100644 --- a/frontend/src/constants/queryBuilder.ts +++ b/frontend/src/constants/queryBuilder.ts @@ -407,3 +407,13 @@ export const HAVING_OPERATORS: string[] = [ OPERATORS['<='], OPERATORS['<'], ]; + +export enum PanelDisplay { + TIME_SERIES = 'Time Series', + VALUE = 'Number', + TABLE = 'Table', + LIST = 'List', + BAR = 'Bar', + PIE = 'Pie', + HISTOGRAM = 'Histogram', +} diff --git a/frontend/src/container/NewDashboard/ComponentsSlider/menuItems.tsx b/frontend/src/container/NewDashboard/ComponentsSlider/menuItems.tsx index 33977aa778..db46c92272 100644 --- a/frontend/src/container/NewDashboard/ComponentsSlider/menuItems.tsx +++ b/frontend/src/container/NewDashboard/ComponentsSlider/menuItems.tsx @@ -1,5 +1,5 @@ import { Color } from '@signozhq/design-tokens'; -import { PANEL_TYPES } from 'constants/queryBuilder'; +import { PANEL_TYPES, PanelDisplay } from 'constants/queryBuilder'; import { BarChart3, LineChart, @@ -13,37 +13,37 @@ const Items: ItemsProps[] = [ { name: PANEL_TYPES.TIME_SERIES, icon: , - display: 'Time Series', + display: PanelDisplay.TIME_SERIES, }, { name: PANEL_TYPES.VALUE, icon: , - display: 'Value', + display: PanelDisplay.VALUE, }, { name: PANEL_TYPES.TABLE, icon: , - display: 'Table', + display: PanelDisplay.TABLE, }, { name: PANEL_TYPES.LIST, icon: , - display: 'List', + display: PanelDisplay.LIST, }, { name: PANEL_TYPES.BAR, icon: , - display: 'Bar', + display: PanelDisplay.BAR, }, { name: PANEL_TYPES.PIE, icon: , - display: 'Pie', + display: PanelDisplay.PIE, }, { name: PANEL_TYPES.HISTOGRAM, icon: , - display: 'Histogram', + display: PanelDisplay.HISTOGRAM, }, ]; diff --git a/frontend/src/container/NewWidget/RightContainer/index.tsx b/frontend/src/container/NewWidget/RightContainer/index.tsx index 55968c5aee..d8b2677e60 100644 --- a/frontend/src/container/NewWidget/RightContainer/index.tsx +++ b/frontend/src/container/NewWidget/RightContainer/index.tsx @@ -4,7 +4,7 @@ import './RightContainer.styles.scss'; import { Input, InputNumber, Select, Space, Switch, Typography } from 'antd'; import TimePreference from 'components/TimePreferenceDropDown'; -import { PANEL_TYPES } from 'constants/queryBuilder'; +import { PANEL_TYPES, PanelDisplay } from 'constants/queryBuilder'; import GraphTypes, { ItemsProps, } from 'container/NewDashboard/ComponentsSlider/menuItems'; @@ -212,7 +212,8 @@ function RightContainer({ defaultValue={yAxisUnit} onSelect={setYAxisUnit} fieldLabel={ - selectedGraphType === 'Value' || selectedGraphType === 'Pie' + selectedGraphType === PanelDisplay.VALUE || + selectedGraphType === PanelDisplay.PIE ? 'Unit' : 'Y Axis Unit' } diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 8b2e1bd451..ee9a7a0b16 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -6706,6 +6706,11 @@ core-js@^2.4.0: resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec" integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ== +core-js@^3.38.1: + version "3.40.0" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.40.0.tgz#2773f6b06877d8eda102fc42f828176437062476" + integrity sha512-7vsMc/Lty6AGnn7uFpYT56QesI5D2Y/UkgKounk87OP9Z2H9Z8kj6jzcSGAxFmUtDOS0ntK6lbQz+Nsa0Jj6mQ== + core-util-is@~1.0.0: version "1.0.3" resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz" @@ -13118,14 +13123,15 @@ postcss@8.4.38, postcss@^8.0.0, postcss@^8.1.1, postcss@^8.3.7, postcss@^8.4.21, picocolors "^1.0.0" source-map-js "^1.2.0" -posthog-js@1.160.3: - version "1.160.3" - resolved "https://registry.yarnpkg.com/posthog-js/-/posthog-js-1.160.3.tgz#17c8af4c9ffa2d795d925ca1e7146e61cd5ccabd" - integrity sha512-mGvxOIlWPtdPx8EI0MQ81wNKlnH2K0n4RqwQOl044b34BCKiFVzZ7Hc7geMuZNaRAvCi5/5zyGeWHcAYZQxiMQ== +posthog-js@1.215.5: + version "1.215.5" + resolved "https://registry.yarnpkg.com/posthog-js/-/posthog-js-1.215.5.tgz#0512cfdb919da960b809c5f686ca147f9c2922ba" + integrity sha512-42lPur+xvkp51pHz2FQ7Y+KHdZ4eQSNIhUO03EECvc2UsmnM0FiVTrF1bcLwHZMaWfR26gOeuOAAjTUV9tinJg== dependencies: + core-js "^3.38.1" fflate "^0.4.8" preact "^10.19.3" - web-vitals "^4.0.1" + web-vitals "^4.2.0" preact@^10.19.3: version "10.22.0" @@ -16465,10 +16471,10 @@ web-vitals@^0.2.4: resolved "https://registry.npmjs.org/web-vitals/-/web-vitals-0.2.4.tgz" integrity sha512-6BjspCO9VriYy12z356nL6JBS0GYeEcA457YyRzD+dD6XYCQ75NKhcOHUMHentOE7OcVCIXXDvOm0jKFfQG2Gg== -web-vitals@^4.0.1: - version "4.2.0" - resolved "https://registry.yarnpkg.com/web-vitals/-/web-vitals-4.2.0.tgz#008949ab79717a68ccaaa3c4371cbc7bbbd78a92" - integrity sha512-ohj72kbtVWCpKYMxcbJ+xaOBV3En76hW47j52dG+tEGG36LZQgfFw5yHl9xyjmosy3XUMn8d/GBUAy4YPM839w== +web-vitals@^4.2.0: + version "4.2.4" + resolved "https://registry.yarnpkg.com/web-vitals/-/web-vitals-4.2.4.tgz#1d20bc8590a37769bd0902b289550936069184b7" + integrity sha512-r4DIlprAGwJ7YM11VZp4R884m0Vmgr6EAKe3P+kO0PPj3Unqyvv59rczf6UiGcb9Z8QxZVcqKNwv/g0WNdWwsw== web-worker@^1.2.0: version "1.2.0"