Feature(map): Add top level collapse

This commit is contained in:
Berkeley Martinez
2016-06-21 16:28:13 -07:00
parent a50a56a1b6
commit b8434edd51
9 changed files with 163 additions and 47 deletions

View File

@@ -42,6 +42,29 @@ export const updateFilter = createAction(
e => e.target.value
);
function createMapKey(map, key) {
map[key] = true;
return map;
}
export const initMap = createAction(
types.initMap,
(
{ superBlock: superBlockMap },
superBlocks
) => {
if (!superBlocks || !superBlockMap) {
return {};
}
const blocks = superBlocks
.map(superBlock => superBlockMap[superBlock].blocks)
.reduce((blocks, block) => blocks.concat(block));
return superBlocks
.concat(blocks)
.reduce(createMapKey, {});
}
);
export const toggleThisPanel = createAction(types.toggleThisPanel);
export const clearFilter = createAction(types.clearFilter);
// files