gchq / gchq/stroom-visualisations-dev

GenericGrid incorrectly handling the lack of values

Open
#22 0 comments 0 reactions 0 assignees View on GitHub
bug
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.