GEOLYTIX / xyz

An open source javascript framework for spatial data and application interfaces.
MIT License
87 stars 25 forks source link

Ensure that each entry has a key. #1325

Closed dbauszus-glx closed 3 months ago

dbauszus-glx commented 3 months ago

Each entry should be assigned a key in the infoj iteration if not already assigned.

The key can be an entry.field which is unique. Otherwise a running index can be assigned within the iteration.

The key should be used primarily as a data_id to ensure that similar elements such as checkboxes have a unique data-id within their location.view context.

sonarcloud[bot] commented 3 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

cityremade commented 3 months ago

could entry index within infoj[] be used as fallback key?

dbauszus-glx commented 3 months ago

The problem with the index is that it may not be known. The key is known and may be used in a plugin to access a data_id element.