From fa96afeef66d9f3e4dbcccc4634e75245448c4b0 Mon Sep 17 00:00:00 2001 From: Vladimir Erokhov Date: Thu, 25 Jul 2024 17:09:28 +0500 Subject: [PATCH] feature(#5531): Added some fixes for statistics widget --- .../statistics/partials/statistics-widget.vue | 2 +- .../src/helpers/entities/metric/query.js | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/community/sources/webcore/src/canopsis-next/src/components/widgets/statistics/partials/statistics-widget.vue b/community/sources/webcore/src/canopsis-next/src/components/widgets/statistics/partials/statistics-widget.vue index 416e68cc00..d1b9264e64 100644 --- a/community/sources/webcore/src/canopsis-next/src/components/widgets/statistics/partials/statistics-widget.vue +++ b/community/sources/webcore/src/canopsis-next/src/components/widgets/statistics/partials/statistics-widget.vue @@ -7,7 +7,7 @@ :widget-id="widget._id" :user-filters="userPreference.filters" :widget-filters="widget.filters" - :locked-filter="query.lockedFilter" + :locked-filters="query.lockedFilter" :filters="query.filter" :interval="query.interval" :sampling="query.sampling" diff --git a/community/sources/webcore/src/canopsis-next/src/helpers/entities/metric/query.js b/community/sources/webcore/src/canopsis-next/src/helpers/entities/metric/query.js index e2bbe5d9c0..a58a0c972b 100644 --- a/community/sources/webcore/src/canopsis-next/src/helpers/entities/metric/query.js +++ b/community/sources/webcore/src/canopsis-next/src/helpers/entities/metric/query.js @@ -90,7 +90,7 @@ export function convertChartWidgetDefaultParametersToQuery(widget) { * @returns {Object} */ export function convertChartWidgetToQuery(widget) { - const { parameters: { comparison = false, metrics = [] } } = widget; + const { comparison = false, metrics = [] } = widget.parameters; return { ...convertChartWidgetDefaultParametersToQuery(widget), @@ -129,7 +129,7 @@ export function convertPieChartWidgetToQuery(widget) { * @returns {Object} */ export function convertNumbersWidgetToQuery(widget) { - const { parameters: { metrics = [], show_trend: showTrend = false } } = widget; + const { metrics = [], show_trend: showTrend = false } = widget.parameters; return { ...convertChartWidgetDefaultParametersToQuery(widget), @@ -150,13 +150,11 @@ export function convertNumbersWidgetToQuery(widget) { */ export function convertStatisticsWidgetParametersToQuery(widget) { const { - parameters: { - mainFilter, - mainParameter = {}, - widgetColumns = [], - default_time_range: defaultTimeRange, - }, - } = widget; + mainFilter, + mainParameter = {}, + widgetColumns = [], + default_time_range: defaultTimeRange, + } = widget.parameters; const query = { interval: {