fix: drop the three admin settings groups that render nothing - #779
Merged
Conversation
Commands, Maps & Assets and Debug each declared settings: [], so the page drew a header and a chevron over an empty panel three times. Maps & Assets is residue from #452, which deleted the two toggles it held -- disable_geomap and disable_geomap_select, legacy PoracleJS keys for a map picker this app does not have -- and left the shell. Commands and Debug have declared nothing since #162. visibleGroups now also drops a group with no declared settings. That is NOT the filter #629 reverted: that one dropped groups whose keys had no DB row yet, which a fresh install always has, since only custom_title is seeded and this page is the only writer. Nothing-declared-in-code is a different condition. The test asserts the data rather than the rendering, because the recurrence is a data edit: someone removes a group's last setting and does not notice. Closes #778
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #778. Reported with a screenshot of Commands and Maps & Assets sitting open and empty.
Three groups declared
settings: [], so the page drew a header and a chevron over an empty panel three times.Maps & Assets is residue from #452, which deleted the two toggles it held —
disable_geomapanddisable_geomap_select, legacy PoracleJS keys describing a map picker this app does not have — and left the shell behind. Commands and Debug have declared nothing since #162.Changes
visibleGroupsnow also drops a group with no declared settings, so a future removal cannot leave another shell.Why this is not the filter #629 reverted
#629 removed a filter that dropped a group whose keys had no DB row yet. That broke fresh installs: only
custom_titleis seeded, so Alarm Types, Features, Administration and Analytics vanished from the DOM, and since this page is the only writer the rows could never appear. The comment left behind at that site says so.The condition here is different: nothing declared in code. Such a group cannot render a row under any database state, so dropping it changes nothing except the empty panel. The existing row-level guard still renders an absent key correctly.
Test
Asserts the data rather than the rendering, because that is how this recurs — someone deletes a group's last setting and does not notice the shell. Watched red by re-adding the Maps & Assets shell: exactly the one test fails and names the group. Two neighbouring invariants came free: distinct label keys, and no setting key declared twice (a duplicate would bind two rows to one value and silently shadow).
Frontend 1144 passed across 100 suites; build, lint and prettier clean.