plausible / analytics

Simple, open source, lightweight (< 1 KB) and privacy-friendly web analytics alternative to Google Analytics.
https://plausible.io
GNU Affero General Public License v3.0
19.93k stars 1.06k forks source link

Make React frontend capable of reading API results under a results key #4159

Closed RobertJoonas closed 4 months ago

RobertJoonas commented 4 months ago

Changes

With the new imported data filtering feature, we'll start returning warnings in the dashboard API results, which means we'll need to move the actual list of results under a separate results key.

This PR is a preparation in order to not break the frontend when suddenly receiving API results under a results key. For some time, we'll need to be able to handle both a straight-up list response, or a map, containing the results key.

Tests

Changelog

Documentation

Dark mode

RobertJoonas commented 4 months ago

Is there a plan to clean up the fallbacks once backend changes are done as well? I'm asking because IMO it doesn't make sense to keep accepting multiple different response formats when we know for sure what is being returned from internal APIs.

Yes, @ukutaht. The PR that implements filtering will remove it so we'll start relying only on the results key.