diff --git a/Common/Utils/Dashboard/Components/DashboardChartComponent.ts b/Common/Utils/Dashboard/Components/DashboardChartComponent.ts index 5a6bd37e38..9b90ab7bda 100644 --- a/Common/Utils/Dashboard/Components/DashboardChartComponent.ts +++ b/Common/Utils/Dashboard/Components/DashboardChartComponent.ts @@ -38,8 +38,6 @@ export default class DashboardChartComponentUtil extends DashboardBaseComponentU ComponentArgument > = []; - - componentArguments.push({ name: "Chart Configuration", description: "Please select the metrics to display on the chart", diff --git a/Common/Utils/Monitor/MonitorMetricType.ts b/Common/Utils/Monitor/MonitorMetricType.ts index 6f2c88a46b..c6efe41b68 100644 --- a/Common/Utils/Monitor/MonitorMetricType.ts +++ b/Common/Utils/Monitor/MonitorMetricType.ts @@ -161,7 +161,6 @@ class MonitorMetricTypeUtil { } } - public static getDescriptionByMonitorMetricType( monitorMetricType: MonitorMetricType, ): string { diff --git a/Dashboard/src/Components/Dashboard/Components/DashboardChartComponent.tsx b/Dashboard/src/Components/Dashboard/Components/DashboardChartComponent.tsx index d494135856..2d5ae98591 100644 --- a/Dashboard/src/Components/Dashboard/Components/DashboardChartComponent.tsx +++ b/Dashboard/src/Components/Dashboard/Components/DashboardChartComponent.tsx @@ -115,20 +115,23 @@ const DashboardChartComponentElement: FunctionComponent = ( heightOfChart = undefined; } - // add title and description. + // add title and description. const chartMetricViewData: MetricViewData = { queryConfigs: props.component.arguments.metricQueryConfig - ? [{ - ...(props.component.arguments.metricQueryConfig)!, - metricAliasData: { - title: props.component.arguments.chartTitle || undefined, - description: props.component.arguments.chartDescription || undefined, - metricVariable: undefined, - legend: props.component.arguments.legendText || undefined, - legendUnit: props.component.arguments.legendUnit || undefined, - } - }] + ? [ + { + ...props.component.arguments.metricQueryConfig!, + metricAliasData: { + title: props.component.arguments.chartTitle || undefined, + description: + props.component.arguments.chartDescription || undefined, + metricVariable: undefined, + legend: props.component.arguments.legendText || undefined, + legendUnit: props.component.arguments.legendUnit || undefined, + }, + }, + ] : [], startAndEndDate: DashboardStartAndEndDateUtil.getStartAndEndDate( props.dashboardStartAndEndDate, diff --git a/Dashboard/src/Components/Dashboard/Components/DashboardTextComponent.tsx b/Dashboard/src/Components/Dashboard/Components/DashboardTextComponent.tsx index 5716d4c8d7..2199f46be7 100644 --- a/Dashboard/src/Components/Dashboard/Components/DashboardTextComponent.tsx +++ b/Dashboard/src/Components/Dashboard/Components/DashboardTextComponent.tsx @@ -10,13 +10,18 @@ const DashboardTextComponentElement: FunctionComponent = ( props: ComponentProps, ): ReactElement => { const textClassName: string = `truncate ${props.component.arguments.isBold ? "font-medium" : ""} ${props.component.arguments.isItalic ? "italic" : ""} ${props.component.arguments.isUnderline ? "underline" : ""}`; - const textHeightInxPx: number =props.dashboardComponentHeightInPx - 20; + const textHeightInxPx: number = props.dashboardComponentHeightInPx - 20; return (
-
0 ? `${textHeightInxPx}px` : "auto", - }}>{props.component.arguments.text}
+
0 ? `${textHeightInxPx}px` : "auto", + }} + > + {props.component.arguments.text} +
); }; diff --git a/Dashboard/src/Components/Dashboard/Components/DashboardValueComponent.tsx b/Dashboard/src/Components/Dashboard/Components/DashboardValueComponent.tsx index 94e8795daa..94d3c1c9bc 100644 --- a/Dashboard/src/Components/Dashboard/Components/DashboardValueComponent.tsx +++ b/Dashboard/src/Components/Dashboard/Components/DashboardValueComponent.tsx @@ -75,12 +75,11 @@ const DashboardValueComponent: FunctionComponent = ( "Please select an Aggregation Type. Click here to add a Aggregation Type.", ); return; - } else { - setAggregationType( - (metricViewData.queryConfigs[0].metricQueryData.filterData - ?.aggegationType as AggregationType) || AggregationType.Avg, - ); } + setAggregationType( + (metricViewData.queryConfigs[0].metricQueryData.filterData + ?.aggegationType as AggregationType) || AggregationType.Avg, + ); try { const results: Array = await MetricUtil.fetchResults({ diff --git a/Dashboard/src/Components/Monitor/MonitorMetrics.tsx b/Dashboard/src/Components/Monitor/MonitorMetrics.tsx index 8e34d8cbda..3191a766d7 100644 --- a/Dashboard/src/Components/Monitor/MonitorMetrics.tsx +++ b/Dashboard/src/Components/Monitor/MonitorMetrics.tsx @@ -125,11 +125,11 @@ const MonitorMetricsElement: FunctionComponent = ( MonitorMetricTypeUtil.getDescriptionByMonitorMetricType( monitorMetricType, ), - legend: + legend: MonitorMetricTypeUtil.getLegendByMonitorMetricType( monitorMetricType, ), - legendUnit: + legendUnit: MonitorMetricTypeUtil.getLegendUnitByMonitorMetricType( monitorMetricType, ),