mirror of
https://github.com/plausible/analytics.git
synced 2024-12-22 17:11:36 +03:00
Disable searching by member/owner emails in sites and enterprise plan CRMs (temporary) (#4905)
* Disable searching by member/owner emails in sites and enterprise plan CRMs (temporary) * Make format happy * Address credo complaint
This commit is contained in:
parent
fb2e7cda36
commit
1f0b9e9cf3
@ -12,8 +12,7 @@ defmodule Plausible.Billing.EnterprisePlanAdmin do
|
||||
|
||||
def search_fields(_schema) do
|
||||
[
|
||||
:paddle_plan_id,
|
||||
team: [owner: [:name, :email]]
|
||||
:paddle_plan_id
|
||||
]
|
||||
end
|
||||
|
||||
|
@ -9,15 +9,13 @@ defmodule Plausible.SiteAdmin do
|
||||
|
||||
def search_fields(_schema) do
|
||||
[
|
||||
:domain,
|
||||
members: [:name, :email]
|
||||
:domain
|
||||
]
|
||||
end
|
||||
|
||||
def custom_index_query(_conn, _schema, query) do
|
||||
from(r in query,
|
||||
inner_join: o in assoc(r, :owner),
|
||||
as: :owner,
|
||||
preload: [owner: o, team: [team_memberships: :user]]
|
||||
)
|
||||
end
|
||||
|
@ -69,6 +69,20 @@ defmodule PlausibleWeb.AdminController do
|
||||
end
|
||||
|
||||
defp usage_and_limits_html(team, usage, limits, embed?) do
|
||||
sites =
|
||||
if team do
|
||||
Plausible.Repo.preload(team, :sites).sites
|
||||
else
|
||||
[]
|
||||
end
|
||||
|
||||
sites_list =
|
||||
Enum.map_join(sites, "\n", fn site ->
|
||||
"""
|
||||
<li><a href="/crm/sites/site/#{site.id}">#{site.domain}</a></li>
|
||||
"""
|
||||
end)
|
||||
|
||||
content = """
|
||||
<ul>
|
||||
<li>Team: <b>#{team && team.name}</b></li>
|
||||
@ -76,6 +90,13 @@ defmodule PlausibleWeb.AdminController do
|
||||
<li>Team members: <b>#{usage.team_members}</b> / #{limits.team_members}</li>
|
||||
<li>Features: #{features_usage(usage.features)}</li>
|
||||
<li>Monthly pageviews: #{monthly_pageviews_usage(usage.monthly_pageviews, limits.monthly_pageviews)}</li>
|
||||
<li>
|
||||
Owned sites:
|
||||
|
||||
<ul>
|
||||
#{sites_list}
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
"""
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user