Skip to content

Commit

Permalink
Transform any operator on respective goal filters
Browse files Browse the repository at this point in the history
  • Loading branch information
zoldar committed May 29, 2024
1 parent 42a6f46 commit 2564be1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/plausible/stats/imported/base.ex
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,18 @@ defmodule Plausible.Stats.Imported.Base do
end)
|> Enum.map(fn filter ->
case filter do
[:is, "event:goal", {:event, name}] ->
[[:is, "event:name", name]]
[op, "event:goal", {:event, name}] ->
[[op, "event:name", name]]

[:is, "event:goal", {:page, page}] ->
[[:is, "event:page", page]]
[op, "event:goal", {:page, page}] ->
[[op, "event:page", page]]

[:member, "event:goal", events] ->
[op, "event:goal", events] ->
events
|> Enum.group_by(&elem(&1, 0), &elem(&1, 1))
|> Enum.map(fn
{:event, names} -> [:member, "event:name", names]
{:page, pages} -> [:member, "event:page", pages]
{:event, names} -> [op, "event:name", names]
{:page, pages} -> [op, "event:page", pages]
end)

filter ->
Expand Down

0 comments on commit 2564be1

Please sign in to comment.