Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Show number of setup teams in CRM dashboard (#5268)

Adrian Gruntkowskiba08ea9d9d56
diff --git a/lib/plausible/teams/team_admin.ex b/lib/plausible/teams/team_admin.ex
index 820468dbb1..16db6553d3 100644
--- a/lib/plausible/teams/team_admin.ex
+++ b/lib/plausible/teams/team_admin.ex
@@ -6,11 +6,29 @@ defmodule Plausible.Teams.TeamAdmin do
use Plausible
use Plausible.Repo
+ import Ecto.Query
+
alias Plausible.Billing.Subscription
alias Plausible.Teams
require Plausible.Billing.Subscription.Status
+ def widgets(_schema, _conn) do
+ setup_teams_count =
+ Repo.aggregate(from(t in Teams.Team, where: t.setup_complete == true), :count)
+
+ [
+ %{
+ type: "tidbit",
+ title: "Setup Teams",
+ content: to_string(setup_teams_count),
+ icon: nil,
+ order: 1,
+ width: 6
+ }
+ ]
+ end
+
def custom_index_query(conn, _schema, query) do
search =
(conn.params["custom_search"] || "")