Description
I tried to customize initial state with the default state of featuregrid reducer and ended up with an error that was raised on opening of the feature grid.
array of string are not handled correctly here
it ended to transform the array ["ADMIN"] into {0: "ADMIN"}
there was also a problem with toChangesMap function in FeatureGridUtils because changes was an empty object instead of an array.
In case of Bug (otherwise remove this paragraph)
Browser Affected
(use this site: https://www.whatsmybrowser.org/ for non expert users)
Browser Version Affected
- Indicate the browser version in which the issue has been found
Steps to reproduce (on a local environment)
- Copy default state of feature grid reducer in localconfig
- try to open a map (nothing shows)
once you have fixed the FeatureGridUtils problem
- try to open the feature grid
Expected Result
- the feature grid opened correctly with no errors
Current Result
- you have an error in the console
Other useful information (optional):
here is the fix for FeatureGridUtils
const {isArray} = require('lodash');
const toChangesMap = (changesArray) => isArray(changesArray) ? changesArray.reduce((changes, c) => ({
...changes,
[c.id]: {
...changes[c.id],
...c.updated
}
}), {}) : {};
Description
I tried to customize initial state with the default state of featuregrid reducer and ended up with an error that was raised on opening of the feature grid.
array of string are not handled correctly here
it ended to transform the array ["ADMIN"] into {0: "ADMIN"}
there was also a problem with toChangesMap function in FeatureGridUtils because changes was an empty object instead of an array.
In case of Bug (otherwise remove this paragraph)
Browser Affected
(use this site: https://www.whatsmybrowser.org/ for non expert users)
Browser Version Affected
Steps to reproduce (on a local environment)
once you have fixed the FeatureGridUtils problem
Expected Result
Current Result
Other useful information (optional):
here is the fix for FeatureGridUtils