gchq / gchq/stroom-visualisations-dev
GenericGrid incorrectly handling the lack of values
- Dominant language
- JavaScript
- Stars
- 14
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
In GenericGrid line 362 it is assigning an empty array to d.visibleValues if d.values is not present. It should probably not assign .visibleValues at all if .values is not present. I think most of the viz scripts do a test on .visibleValues so this should be ok, but needs to be checked.
```
if (!d.hasOwnProperty("visibleValues")) {
if (d.values) {
//create a function to expose only the visible values
d.visibleValues = function() {
return d.values.filter(function(d) {
//assume true if prop not present
return (
(!d.hasOwnProperty("isVisible") || d.isVisible) &&
(!d.hasOwnProperty("isZoomVisible") || d.isZoomVisible)
);
});
};
} else {
d.visibleValues = [];
}
}
```
Contributor guide
Assessment
This issue has not been assessed yet.