Skip to content

Commit

Permalink
fix: fall back to old types for visualizations (#524)
Browse files Browse the repository at this point in the history
  • Loading branch information
janhenrikoverland authored Jan 8, 2020
1 parent 86d7d3e commit fbe93f4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/modules/itemTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
16 changes: 15 additions & 1 deletion src/reducers/dashboards.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import {
isSpacerType,
isTextType,
emptyTextItemContent,
REPORT_TABLE,
CHART,
VISUALIZATION,
} from '../modules/itemTypes';

export const SET_DASHBOARDS = 'SET_DASHBOARDS';
Expand Down Expand Up @@ -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
? ''
Expand Down

0 comments on commit fbe93f4

Please sign in to comment.