From dbc7c4afebd1c6dc1030197ad4fca2e00e87f500 Mon Sep 17 00:00:00 2001 From: Jan Henrik Overland Date: Wed, 8 Jan 2020 14:01:25 +0100 Subject: [PATCH] fix: fall back to old types for visualizations --- src/modules/itemTypes.js | 1 + src/reducers/dashboards.js | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/modules/itemTypes.js b/src/modules/itemTypes.js index 4d33b6084..f30707372 100644 --- a/src/modules/itemTypes.js +++ b/src/modules/itemTypes.js @@ -13,6 +13,7 @@ import NotInterestedIcon from '@material-ui/icons/NotInterested'; import { getBaseUrl } from './util'; // Item types +export const VISUALIZATION = 'VISUALIZATION'; export const REPORT_TABLE = 'REPORT_TABLE'; export const CHART = 'CHART'; export const MAP = 'MAP'; diff --git a/src/reducers/dashboards.js b/src/reducers/dashboards.js index f224c22b4..d38a1b5cd 100644 --- a/src/reducers/dashboards.js +++ b/src/reducers/dashboards.js @@ -9,6 +9,9 @@ import { isSpacerType, isTextType, emptyTextItemContent, + REPORT_TABLE, + CHART, + VISUALIZATION, } from '../modules/itemTypes'; export const SET_DASHBOARDS = 'SET_DASHBOARDS'; @@ -168,7 +171,18 @@ export const sGetDashboardsSortedByStarred = state => [ export const getCustomDashboards = data => { const uiItems = items => items.map(item => { - const type = isSpacerType(item) ? SPACER : item.type; + let type = isSpacerType(item) ? SPACER : item.type; + + // TODO: temporary fix before 2.34 epic branch is merged + // if "VISUALIZATION", reset to "REPORT_TABLE" or "CHART" + if (type === VISUALIZATION) { + type = item.reportTable + ? REPORT_TABLE + : item.chart + ? CHART + : type; + } + const text = isTextType(item) ? item.text === emptyTextItemContent ? ''