Skip to content

Commit

Permalink
feature(#5531): Added some fixes for statistics widget
Browse files Browse the repository at this point in the history
  • Loading branch information
noveo-verokhov committed Jul 25, 2024
1 parent 949aa53 commit fa96afe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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),
Expand All @@ -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: {
Expand Down

0 comments on commit fa96afe

Please sign in to comment.