Skip to content

Commit 1df08a2

Browse files
authored
Change header dropdown copy to sentence case (#5887)
1 parent dec382c commit 1df08a2

9 files changed

Lines changed: 44 additions & 44 deletions

File tree

lib/plausible/teams.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ defmodule Plausible.Teams do
1414
@accept_traffic_until_free ~D[2135-01-01]
1515

1616
@spec default_name() :: String.t()
17-
def default_name(), do: "My Personal Sites"
17+
def default_name(), do: "My personal sites"
1818

1919
@spec name(nil | Teams.Team.t()) :: String.t()
2020
def name(nil), do: default_name()

lib/plausible_web/live/team_setup.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ defmodule PlausibleWeb.Live.TeamSetup do
2424
%Teams.Team{} ->
2525
team_name_form =
2626
current_team
27-
|> Teams.Team.name_changeset(%{name: "#{current_user.name}'s Team"})
27+
|> Teams.Team.name_changeset(%{name: "#{current_user.name}'s team"})
2828
|> Repo.update!()
2929
|> Teams.Team.name_changeset(%{})
3030
|> to_form()
@@ -90,7 +90,7 @@ defmodule PlausibleWeb.Live.TeamSetup do
9090
>
9191
<.input
9292
type="text"
93-
placeholder={"#{@current_user.name}'s Team"}
93+
placeholder={"#{@current_user.name}'s team"}
9494
autofocus={not @locked?}
9595
field={f[:name]}
9696
label="Name"

lib/plausible_web/templates/layout/_header.html.heex

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@
8888
/>
8989
<.dropdown_divider />
9090
<.dropdown_item href={Routes.settings_path(@conn, :index)}>
91-
Account Settings
91+
Account settings
9292
</.dropdown_item>
9393

9494
<div :if={@my_team && @my_team.id == @current_team.id}>
9595
<.dropdown_item class="flex" href={Routes.team_setup_path(@conn, :setup)}>
9696
<span data-test="create-a-team-cta" class="flex-1">
97-
Create a Team
97+
Create a team
9898
</span>
9999
</.dropdown_item>
100100
<.dropdown_divider />
@@ -106,7 +106,7 @@
106106
href={Routes.settings_path(@conn, :team_general)}
107107
>
108108
<span class="flex-1">
109-
Team Settings
109+
Team settings
110110
</span>
111111
</.dropdown_item>
112112
<.dropdown_divider />
@@ -116,33 +116,33 @@
116116
new_tab
117117
href="https://plausible.io/docs"
118118
>
119-
Help Center
119+
Help center
120120
</.dropdown_item>
121121
<.dropdown_item
122122
:if={ee?()}
123123
class="!flex justify-between gap-x-12"
124124
new_tab
125125
href="https://plausible.io/contact"
126126
>
127-
Contact Support
127+
Contact support
128128
</.dropdown_item>
129129
<.dropdown_item
130130
:if={ee?()}
131131
class="!flex justify-between gap-x-12"
132132
new_tab
133133
href={feedback_link(@conn.assigns[:current_user])}
134134
>
135-
Feature Requests
135+
Feature requests
136136
</.dropdown_item>
137137
<.dropdown_item
138138
:if={ce?()}
139139
class="!flex justify-between gap-x-12"
140140
new_tab
141141
href="https://github.com/plausible/analytics"
142142
>
143-
Github Repo
143+
Github repo
144144
</.dropdown_item>
145-
<.dropdown_item href="/logout">Log Out</.dropdown_item>
145+
<.dropdown_item href="/logout">Log out</.dropdown_item>
146146
</:menu>
147147
</.dropdown>
148148
</li>

test/plausible/teams_test.exs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ defmodule Plausible.TeamsTest do
1111

1212
describe "name/1" do
1313
test "returns default name when there's no team" do
14-
assert Teams.name(nil) == "My Personal Sites"
14+
assert Teams.name(nil) == "My personal sites"
1515
end
1616

1717
test "returns default name when team setup is not completed yet" do
1818
user = new_user(team: [setup_complete: false, name: "Foo"])
1919
team = team_of(user)
2020

21-
assert Teams.name(team) == "My Personal Sites"
21+
assert Teams.name(team) == "My personal sites"
2222
end
2323

2424
test "returns team name for a setup team" do
@@ -30,14 +30,14 @@ defmodule Plausible.TeamsTest do
3030
end
3131

3232
describe "get_or_create/1" do
33-
test "creates 'My Personal Sites' if user is a member of no teams" do
33+
test "creates 'My personal sites' if user is a member of no teams" do
3434
today = Date.utc_today()
3535
user = new_user()
3636
user_id = user.id
3737

3838
assert {:ok, team} = Teams.get_or_create(user)
3939

40-
assert team.name == "My Personal Sites"
40+
assert team.name == "My personal sites"
4141
assert Date.compare(team.trial_expiry_date, today) == :gt
4242

4343
assert [
@@ -70,7 +70,7 @@ defmodule Plausible.TeamsTest do
7070

7171
assert team.id == existing_team.id
7272
assert Date.compare(team.trial_expiry_date, ~D[2020-04-01])
73-
assert team.name == "My Personal Sites"
73+
assert team.name == "My personal sites"
7474

7575
assert [
7676
%{user_id: ^user_id, role: :owner, is_autocreated: true}
@@ -98,7 +98,7 @@ defmodule Plausible.TeamsTest do
9898
|> Enum.sort_by(& &1.id)
9999
end
100100

101-
test "creates 'My Personal Sites' if user is a guest on another team" do
101+
test "creates 'My personal sites' if user is a guest on another team" do
102102
user = new_user()
103103
user_id = user.id
104104
site = new_site()
@@ -108,15 +108,15 @@ defmodule Plausible.TeamsTest do
108108
assert {:ok, team} = Teams.get_or_create(user)
109109

110110
assert team.id != existing_team.id
111-
assert team.name == "My Personal Sites"
111+
assert team.name == "My personal sites"
112112

113113
assert [%{user_id: ^user_id, role: :owner, is_autocreated: true}] =
114114
team
115115
|> Repo.preload(:team_memberships)
116116
|> Map.fetch!(:team_memberships)
117117
end
118118

119-
test "creates 'My Personal Sites' if user is a non-owner member on existing teams" do
119+
test "creates 'My personal sites' if user is a non-owner member on existing teams" do
120120
user = new_user()
121121
user_id = user.id
122122
site1 = new_site()
@@ -207,7 +207,7 @@ defmodule Plausible.TeamsTest do
207207
assert {:error, :no_team} = Teams.get_by_owner(user)
208208
end
209209

210-
test "returns existing 'My Personal Sites' if user already owns one" do
210+
test "returns existing 'My personal sites' if user already owns one" do
211211
user = new_user(trial_expiry_date: ~D[2020-04-01])
212212
user_id = user.id
213213
existing_team = team_of(user)
@@ -216,7 +216,7 @@ defmodule Plausible.TeamsTest do
216216

217217
assert team.id == existing_team.id
218218
assert Date.compare(team.trial_expiry_date, ~D[2020-04-01])
219-
assert team.name == "My Personal Sites"
219+
assert team.name == "My personal sites"
220220

221221
assert [
222222
%{user_id: ^user_id, role: :owner, is_autocreated: true}

test/plausible_web/controllers/api/external_sites_controller_test.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ defmodule PlausibleWeb.Api.ExternalSitesControllerTest do
8484
},
8585
%{
8686
"id" => personal_team.identifier,
87-
"name" => "My Personal Sites",
87+
"name" => "My personal sites",
8888
"api_available" => false
8989
}
9090
],
@@ -113,7 +113,7 @@ defmodule PlausibleWeb.Api.ExternalSitesControllerTest do
113113
"teams" => [
114114
%{
115115
"id" => personal_team.identifier,
116-
"name" => "My Personal Sites",
116+
"name" => "My personal sites",
117117
"api_available" => true
118118
}
119119
],

test/plausible_web/controllers/help_scout_controller_test.exs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ defmodule PlausibleWeb.HelpScoutControllerTest do
163163
assert html = html_response(conn, 200)
164164
assert html =~ Routes.customer_support_user_path(PlausibleWeb.Endpoint, :show, user.id)
165165
assert html =~ "Some user notes"
166-
assert html =~ "My Personal Sites"
166+
assert html =~ "My personal sites"
167167
assert html =~ "HS Integration Test Team"
168168
end
169169

@@ -193,7 +193,7 @@ defmodule PlausibleWeb.HelpScoutControllerTest do
193193

194194
assert html = html_response(conn, 200)
195195
refute html =~ "HS Integration Test Team"
196-
refute html =~ "My Personal Sites"
196+
refute html =~ "My personal sites"
197197
assert html =~ "Some user notes"
198198
end
199199

@@ -223,7 +223,7 @@ defmodule PlausibleWeb.HelpScoutControllerTest do
223223

224224
assert html = html_response(conn, 200)
225225
assert html =~ "HS Integration Test Team"
226-
refute html =~ "My Personal Sites"
226+
refute html =~ "My personal sites"
227227
assert html =~ "Some user notes"
228228
end
229229

test/plausible_web/controllers/settings_controller_test.exs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,7 +1358,7 @@ defmodule PlausibleWeb.SettingsControllerTest do
13581358
]
13591359

13601360
on_ee do
1361-
describe "Account Settings - SSO user" do
1361+
describe "Account settings - SSO user" do
13621362
setup [:create_user, :create_site, :create_team, :setup_sso, :provision_sso_user, :log_in]
13631363

13641364
test "shows only expected menu items", %{conn: conn} do
@@ -1409,7 +1409,7 @@ defmodule PlausibleWeb.SettingsControllerTest do
14091409
end
14101410
end
14111411

1412-
describe "Team Settings" do
1412+
describe "Team settings" do
14131413
setup [:create_user, :log_in]
14141414

14151415
test "when no team is assigned & the user doesn't have a subscription, limited account menu is present",
@@ -2003,14 +2003,14 @@ defmodule PlausibleWeb.SettingsControllerTest do
20032003
describe "account dropdown menu (_header.html)" do
20042004
setup [:create_user, :log_in]
20052005

2006-
test "renders the 'Create a Team' option", %{conn: conn, user: user} do
2006+
test "renders the 'Create a team' option", %{conn: conn, user: user} do
20072007
subscribe_to_growth_plan(user)
20082008
conn = get(conn, Routes.settings_path(conn, :preferences))
20092009
html = html_response(conn, 200)
2010-
assert text_of_element(html, ~s/[data-test="create-a-team-cta"]/) == "Create a Team"
2010+
assert text_of_element(html, ~s/[data-test="create-a-team-cta"]/) == "Create a team"
20112011
end
20122012

2013-
test "does not render the 'Create a Team' option if a team is already set up", %{
2013+
test "does not render the 'Create a team' option if a team is already set up", %{
20142014
conn: conn,
20152015
user: user
20162016
} do

test/plausible_web/live/sites_test.exs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ defmodule PlausibleWeb.Live.SitesTest do
1414
{:ok, _lv, html} = live(conn, "/sites")
1515

1616
text = text(html)
17-
assert text =~ "My Personal Sites"
17+
assert text =~ "My personal sites"
1818
assert text =~ "You don't have any sites yet"
1919
refute text =~ "You currently have no personal sites"
2020
refute text =~ "Go to your team"
@@ -31,7 +31,7 @@ defmodule PlausibleWeb.Live.SitesTest do
3131
{:ok, _lv, html} = live(conn, "/sites")
3232
text = text(html)
3333

34-
assert text =~ "My Personal Sites"
34+
assert text =~ "My personal sites"
3535
refute text =~ "You don't have any sites yet"
3636
assert text =~ "You currently have no personal sites"
3737
assert text =~ "Go to your team"
@@ -68,10 +68,10 @@ defmodule PlausibleWeb.Live.SitesTest do
6868
{:ok, _lv, html} = live(conn, "/sites")
6969

7070
assert text_of_element(html, "#invitation-#{invitation1.invitation_id}") =~
71-
"G.I. Joe has invited you to join the \"My Personal Sites\" as viewer member."
71+
"G.I. Joe has invited you to join the \"My personal sites\" as viewer member."
7272

7373
assert text_of_element(html, "#invitation-#{invitation2.invitation_id}") =~
74-
"G.I. Jane has invited you to join the \"My Personal Sites\" as editor member."
74+
"G.I. Jane has invited you to join the \"My personal sites\" as editor member."
7575

7676
assert element_exists?(
7777
html,

test/plausible_web/live/team_setup_test.exs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,24 +31,24 @@ defmodule PlausibleWeb.Live.TeamSetupTest do
3131
setup [:create_user, :log_in, :create_team]
3232

3333
test "renames the team on first render", %{conn: conn, team: team} do
34-
assert team.name == "My Personal Sites"
34+
assert team.name == "My personal sites"
3535
{:ok, _lv, html} = live(conn, @url)
3636

3737
assert text_of_attr(html, ~s|input#update-team-form_name[name="team[name]"]|, "value") ==
38-
"Jane Smith's Team"
38+
"Jane Smith's team"
3939

40-
assert Repo.reload!(team).name == "Jane Smith's Team"
40+
assert Repo.reload!(team).name == "Jane Smith's team"
4141
end
4242

4343
test "renames even if team already has non-default name", %{conn: conn, team: team} do
44-
assert team.name == "My Personal Sites"
44+
assert team.name == "My personal sites"
4545
Repo.update!(Teams.Team.name_changeset(team, %{name: "Foo"}))
4646
{:ok, _lv, html} = live(conn, @url)
4747

4848
assert text_of_attr(html, ~s|input#update-team-form_name[name="team[name]"]|, "value") ==
49-
"Jane Smith's Team"
49+
"Jane Smith's team"
5050

51-
assert Repo.reload!(team).name == "Jane Smith's Team"
51+
assert Repo.reload!(team).name == "Jane Smith's team"
5252
end
5353

5454
test "renders form", %{conn: conn} do
@@ -67,19 +67,19 @@ defmodule PlausibleWeb.Live.TeamSetupTest do
6767
_ = render(lv)
6868
end
6969

70-
test "setting team name to 'My Personal Sites' is reserved", %{
70+
test "setting team name to 'My personal sites' is reserved", %{
7171
conn: conn,
7272
team: team,
7373
user: user
7474
} do
7575
{:ok, lv, html} = live(conn, @url)
7676

7777
assert text_of_attr(html, ~s|input#update-team-form_name[name="team[name]"]|, "value") ==
78-
"#{user.name}'s Team"
78+
"#{user.name}'s team"
7979

8080
type_into_input(lv, "team[name]", "Team Name 1")
8181
_ = render(lv)
82-
type_into_input(lv, "team[name]", "My Personal Sites")
82+
type_into_input(lv, "team[name]", "My personal sites")
8383
_ = render(lv)
8484
assert Repo.reload!(team).name == "Team Name 1"
8585
end

0 commit comments

Comments
 (0)