Repository navigation
Support contains/matches for custom properties - #3687
Merged
Merged
Conversation
macobo
force-pushed
the
custom-props-matches-support
branch
from
January 15, 2024 13:21
5c3d1d9 to
e086e6d
Compare
Member
|
There's something wrong with re-applying the filter when modifying the custom props breakdown query: record-2024-01-15-16-45-30-acre.putt.blot.mp4 |
Member
|
On a freshly seeded db (you can repro via record-2024-01-15-16-49-48-hull.roth.john.mp4I thought it was due to seed data being nonsense, but modifying the test you've added, also returns extra rows that shouldn't be included? diff --git a/test/plausible_web/controllers/api/stats_controller/pages_test.exs b/test/plausible_web/controllers/api/stats_controller/pages_test.exs
index 339a4bab3..ba9aa0fed 100644
--- a/test/plausible_web/controllers/api/stats_controller/pages_test.exs
+++ b/test/plausible_web/controllers/api/stats_controller/pages_test.exs
@@ -103,7 +103,7 @@ defmodule PlausibleWeb.Api.StatsController.PagesTest do
build(:pageview, pathname: "/5")
])
- filters = Jason.encode!(%{props: %{"prop" => "~bar"}})
+ filters = Jason.encode!(%{props: %{"prop" => "~bar|pppp"}})
conn = get(conn, "/api/stats/#{site.domain}/pages?period=day&filters=#{filters}")
assert json_response(conn, 200) == [ |
Note: No FE support yet, needs further testing
When matching we should always exclude (none)
macobo
force-pushed
the
custom-props-matches-support
branch
from
January 18, 2024 19:44
e086e6d to
43772bc
Compare
Contributor
Author
|
@aerosol thank you for the great feedback. I've updated the branch. (1) Regarding breakdowns, this was a legit bug in the code, see fix in 43772bc (2) seems to be about how regex is internally escaped. I hoped that merging #3634 would fix this, but it did not. Given that this behavior already exists on master, I'll fix this in a separate PR, filed it in my worklog. |
Merged
aerosol
approved these changes
Jan 22, 2024
2 of 6 tasks
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.
Changes
This PR a filtering with
contains/matchesfor custom properties, e.g. "Filter where (custom property) url contains foo"First PR 🙌
Tests
Changelog
Documentation
Dark mode