The main goal of this PR was to fix some behaviour with the dashboard "with-imported" switch and move its logic into the backend, making its intent more clear and easily testable. I've also included some other changes that I saw necessary. Here's a summary:
Change the tooltip message when the icon is hovered:
"Stats do not include imported data" -> "Click to include imported data"
"Stats include imported data" -> "Click to exclude imported data"
Slight refactor: instead of keeping a boolean state of whether the imported query is unsupported, keep the skipImportedReason in the state instead and let the ImportedQueryUnsupportedWarning component decide how to interpret that.
When the query does not support imported data and imported data is excluded, disable clicking the imported-switch and render a tooltip saying "Imported data cannot be included"
Before (with imported switch still clickable when filters are unsupported, when clicked, also triggers an update):
Changes
The main goal of this PR was to fix some behaviour with the dashboard "with-imported" switch and move its logic into the backend, making its intent more clear and easily testable. I've also included some other changes that I saw necessary. Here's a summary:
skipImportedReason
in the state instead and let theImportedQueryUnsupportedWarning
component decide how to interpret that.Before (with imported switch still clickable when filters are unsupported, when clicked, also triggers an update):
https://github.com/plausible/analytics/assets/56999674/1e45e336-0583-4a21-8d12-6c89e57c022e
After (the icon is disabled when filters are unsupported):
https://github.com/plausible/analytics/assets/56999674/9d21f127-8f3b-440f-b99a-2092d0806c72
ImportedQueryUnsupportedWarning
bubble whenever the query or tab changesBefore (notice how the bubble keeps hanging, and then disappears suddenly):
https://github.com/plausible/analytics/assets/56999674/9e981974-05fc-41be-a4c8-64fad13ed8d1
After: (bubble not displayed by default, fades in when the request finishes)
https://github.com/plausible/analytics/assets/56999674/7a31f3e4-624f-4540-a276-6d788ff1e009
Tests
Changelog
Documentation
Dark mode