Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.
TypeScript analyticsanalytics-dashboardclickhouseelixirgoogle-analyticsmarketingopen-source-analyticsphoenixplausible-analyticspostgresqlprivacyprivacy-friendlyself-hostedsimple-analyticsstatisticstailwindcssweb-analyticswebsite-analyticswebsite-statswebsite-tracking
Minor crm fixes (#5863)
Adam Rutkowski49c9cabaed23
diff --git a/extra/lib/plausible_web/live/customer_support/site/components/overview.ex b/extra/lib/plausible_web/live/customer_support/site/components/overview.exindex 31ee65ff81..c67ee6cb93 100644--- a/extra/lib/plausible_web/live/customer_support/site/components/overview.ex+++ b/extra/lib/plausible_web/live/customer_support/site/components/overview.ex@@ -18,11 +18,17 @@ defmodule PlausibleWeb.CustomerSupport.Site.Components.Overview do<div class="flex justify-center items-center gap-x-8 pb-8 mb-8 border-b border-gray-200 dark:border-gray-700 w-full text-sm text-center"><span>Quick links:</span>- <.styled_link new_tab={true} href={"/#{@site.domain}"}>+ <.styled_link+ new_tab={true}+ href={Routes.stats_path(PlausibleWeb.Endpoint, :stats, @site.domain, [])}+ >Dashboard</.styled_link>- <.styled_link new_tab={true} href={"/#{@site.domain}/settings/general"}>+ <.styled_link+ new_tab={true}+ href={Routes.site_path(PlausibleWeb.Endpoint, :settings_general, @site.domain, [])}+ >Settings</.styled_link>diff --git a/lib/plausible/teams/team.ex b/lib/plausible/teams/team.exindex 5f0591624d..0c0b3862ae 100644--- a/lib/plausible/teams/team.ex+++ b/lib/plausible/teams/team.ex@@ -93,6 +93,7 @@ defmodule Plausible.Teams.Team do:allow_next_upgrade_override,:accept_traffic_until])+ |> maybe_bump_accept_traffic_until()enddef changeset(team \\ %__MODULE__{}, attrs \\ %{}, today \\ Date.utc_today()) dodiff --git a/test/plausible_web/live/customer_support/sites_test.exs b/test/plausible_web/live/customer_support/sites_test.exsindex 54a82f386e..2cff615883 100644--- a/test/plausible_web/live/customer_support/sites_test.exs+++ b/test/plausible_web/live/customer_support/sites_test.exs@@ -28,10 +28,10 @@ defmodule PlausibleWeb.Live.CustomerSupport.SitesTest doassert element_exists?(html,- ~s|a[href$="#{site.domain}/settings/general"]|+ ~s|a[href$="#{URI.encode_www_form(site.domain)}/settings/general"]|)- assert element_exists?(html, ~s|a[href="/#{site.domain}"]|)+ assert element_exists?(html, ~s|a[href="/#{URI.encode_www_form(site.domain)}/"]|)endtest "404", %{conn: conn} dodiff --git a/test/plausible_web/live/customer_support/teams_test.exs b/test/plausible_web/live/customer_support/teams_test.exsindex 57eb7952e0..7124dde6f3 100644--- a/test/plausible_web/live/customer_support/teams_test.exs+++ b/test/plausible_web/live/customer_support/teams_test.exs@@ -141,6 +141,22 @@ defmodule PlausibleWeb.Live.CustomerSupport.TeamsTest doassert team.lockedend+ test "trial expiry date update, updates accept traffic until too", %{conn: conn, user: user} do+ team = team_of(user)+ {:ok, lv, _html} = live(conn, open_team(team.id))++ lv+ |> element("form")+ |> render_submit(%{+ "team" => %{"trial_expiry_date" => "2029-01-01"}+ })++ html = render(lv)++ assert text_of_attr(html, "#team_trial_expiry_date", "value") == "2029-01-01"+ assert text_of_attr(html, "#team_accept_traffic_until", "value") == "2029-01-15"+ end+test "404", %{conn: conn} doassert_raise Ecto.NoResultsError, fn ->{:ok, _lv, _html} = live(conn, open_team(9999))@@ -157,7 +173,7 @@ defmodule PlausibleWeb.Live.CustomerSupport.TeamsTest dotest "lists sites belonging to a team", %{conn: conn, user: user} doteam = team_of(user)- new_site(owner: user, domain: "primary.example.com")+ new_site(owner: user, domain: "primary.example.com/test")new_site(owner: user, domain: "consolidated.example.com", consolidated: true)new_site(owner: user, domain: "secondary.example.com")# other@@ -167,7 +183,10 @@ defmodule PlausibleWeb.Live.CustomerSupport.TeamsTest dohtml = render(lv)text = text(html)- assert text =~ "primary.example.com"+ assert element_exists?(html, ~s|a[href="/primary.example.com%2Ftest/"]|)+ assert element_exists?(html, ~s|a[href="/primary.example.com%2Ftest/settings/general"]|)++ assert text =~ "primary.example.com/test"assert text =~ "secondary.example.com"refute text =~ "condolidated.example.com"refute text =~ "other.example.com"