wrolpi/app/src/components/admin
lrnselfreliance 63ddad69e8
app: api helpers report failure instead of returning an empty value (#736)
Six helpers turned a non-OK response into an empty value, so their
consumers rendered a server error as "nothing here":

* getConfigBackups -> {dates: []}: "No backups available for this
  config."  A thrown request also left "Loading backups..." forever.
* getInventoryBackups -> []: "No backups yet."
* getDownloaders -> {downloaders: []} on a throw, the error body on a
  non-OK response (which then crashed the .map): the RSS form's
  Downloader select sat empty.
* searchMap -> {results: []}: "No map locations found".
* getMapSearchStatus -> {indexed: [], missing: []}: "No maps are
  installed".
* flasherSearch -> [null, null], then `|| []`: "No .bin firmware
  found".

Invariants now enforced and tested:
* On a non-OK response each helper returns undefined; an empty value
  only ever comes from the server.
* Each consumer shows an error for a failed or thrown fetch and keeps
  its "none" message for a confirmed empty result.  The Downloader
  select is disabled and says it is loading or could not fetch.  A
  failed map status is unknown, never "no maps are installed".
* The map search tab loads from the first render, and a query shorter
  than the two characters the request needs now says so instead of
  "No map locations found".

Archive browsers and recent tags are left as they are: a failed fetch
there hides an optional picker or suggestion list without claiming
anything.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 17:47:32 -06:00
..
AdminRoute.js Creating browser extension to facilitate starting downloads. Chrome/Brave and Firefox supported. 2026-05-03 11:48:50 -06:00
browserDetect.js app: treat pure Chromium UA as supported for extension banner 2026-07-18 13:52:26 -06:00
ConfigBackups.test.js app: api helpers report failure instead of returning an empty value (#736) 2026-09-26 17:47:32 -06:00
Configs.js app: api helpers report failure instead of returning an empty value (#736) 2026-09-26 17:47:32 -06:00
ControllerPage.js Hotspot captive portal: welcome page with the WROLPi's address (#709) 2026-09-13 20:10:02 -06:00
ControllerPage.test.js Hotspot captive portal: welcome page with the WROLPi's address (#709) 2026-09-13 20:10:02 -06:00
Downloads.js review: the 375px phone this fix had not been measured on (#662) 2026-08-13 11:38:49 -06:00
Downloads.test.js Adding selection to the Downloads page, user can delete or retry multiple downloads at once. 2025-12-26 10:35:30 -07:00
ExtensionInstallSuggestion.js ui: migrate the extension pages and Configs; five components they needed 2026-08-08 18:04:00 -06:00
ExtensionInstallSuggestion.test.js app: treat pure Chromium UA as supported for extension banner 2026-07-18 13:52:26 -06:00
ExtensionPage.js review: finish the sweep the first pass claimed 2026-08-08 18:05:52 -06:00
ExtensionPage.test.js ui: the last of Semantic UI, in name and in dead CSS 2026-08-08 18:05:54 -06:00
Settings.js app: status and settings contexts say whether their first poll landed (#734) 2026-09-26 17:25:46 -06:00
Status.js ui: a downloads table wider than the phone showing it (#660) 2026-08-12 10:08:55 -06:00