Skip to content

Commit

Permalink
fix: clean ou dimension before app switching (#582)
Browse files Browse the repository at this point in the history
  • Loading branch information
turban authored Apr 14, 2020
1 parent 7bfc283 commit 2782cc6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/util/analyticalObject.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { config, getInstance as getD2 } from 'd2';
import { getPeriodNameFromId, getDimensionsFromFilters } from './analytics';
import { loadDataItemLegendSet } from './legend';
import { cleanDimension } from './favorites';

export const NAMESPACE = 'analytics';
export const CURRENT_AO_KEY = 'currentAnalyticalObject';
Expand Down Expand Up @@ -91,7 +92,7 @@ export const getAnalyticalObjectFromThematicLayer = (layer = {}) => {

return {
columns,
rows,
rows: rows.map(cleanDimension),
filters,
aggregationType,
};
Expand Down
2 changes: 1 addition & 1 deletion src/util/favorites.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ const models2objects = config => {
return config;
};

const cleanDimension = dim => ({
export const cleanDimension = dim => ({
...dim,
items: dim.items.map(item => pick(validModelProperties, item)),
});
Expand Down

0 comments on commit 2782cc6

Please sign in to comment.