Merge ~ines-almeida/launchpad:fix-social-accounts-class-to-not-trigger-adblocker into launchpad:master

Proposed by Ines Almeida
Status: Merged
Approved by: Ines Almeida
Approved revision: c53c249eed0cb1b4dc5a811569ecccd0de0e623d
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~ines-almeida/launchpad:fix-social-accounts-class-to-not-trigger-adblocker
Merge into: launchpad:master
Prerequisite: ~lgp171188/launchpad:fix-social-accounts-class-to-not-trigger-adblocker
Diff against target: 146 lines (+19/-19)
7 files modified
lib/canonical/launchpad/icing/css/components/social_accounts.scss (+1/-1)
lib/lp/app/browser/tales.py (+1/-1)
lib/lp/app/tests/test_tales.py (+1/-1)
lib/lp/registry/stories/person/xx-person-edit-jabber-ids.rst (+1/-1)
lib/lp/registry/stories/person/xx-person-edit-matrix-accounts.rst (+1/-1)
lib/lp/registry/stories/person/xx-person-home.rst (+2/-2)
lib/lp/registry/templates/person-portlet-contact-details.pt (+12/-12)
Reviewer Review Type Date Requested Status
Simone Pelosi Approve
Review via email: mp+459260@code.launchpad.net

Commit message

ui: update social accounts class names to use hyphens instead of underscores

This is more consistent with the rest of Launchpad's class names

To post a comment you must log in.
Revision history for this message
Simone Pelosi (pelpsi) wrote :

LGMT!

review: Approve
Revision history for this message
Ines Almeida (ines-almeida) wrote :

Waiting on merge request about CSS standards to be merged before merging this one (to ensure it will be consistent with standards): https://github.com/canonical/launchpad-manual/pull/22

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/canonical/launchpad/icing/css/components/social_accounts.scss b/lib/canonical/launchpad/icing/css/components/social_accounts.scss
2index 1524995..be6e2d9 100644
3--- a/lib/canonical/launchpad/icing/css/components/social_accounts.scss
4+++ b/lib/canonical/launchpad/icing/css/components/social_accounts.scss
5@@ -1,4 +1,4 @@
6-.user_social_accounts {
7+.user-social-accounts {
8 &__icon {
9 margin-right: 0.5em;
10 height: 1.4em;
11diff --git a/lib/lp/app/browser/tales.py b/lib/lp/app/browser/tales.py
12index e2cf36c..99e0e5d 100644
13--- a/lib/lp/app/browser/tales.py
14+++ b/lib/lp/app/browser/tales.py
15@@ -3065,7 +3065,7 @@ class SocialAccountFormatterAPI(ObjectFormatterAPI):
16
17 def icon(self, platform):
18 return (
19- f'<img class="user_social_accounts__icon" alt="{platform.title}" '
20+ f'<img class="user-social-accounts__icon" alt="{platform.title}" '
21 f'title="{platform.title}" src="/@@/{platform.icon}" />'
22 )
23
24diff --git a/lib/lp/app/tests/test_tales.py b/lib/lp/app/tests/test_tales.py
25index 1376d95..52730b8 100644
26--- a/lib/lp/app/tests/test_tales.py
27+++ b/lib/lp/app/tests/test_tales.py
28@@ -406,7 +406,7 @@ class TestSocialAccountFormatterAPI(TestCaseWithFactory):
29 person, SocialPlatformType.MATRIX, identity
30 )
31 expected_html = (
32- '<img class="user_social_accounts__icon" alt="Matrix" '
33+ '<img class="user-social-accounts__icon" alt="Matrix" '
34 'title="Matrix" src="/@@/social-matrix" /> '
35 "<a href=https://matrix.to//#/@fred:ubuntu.com "
36 'target="_blank"><strong>@fred:ubuntu.com</strong></a>'
37diff --git a/lib/lp/registry/stories/person/xx-person-edit-jabber-ids.rst b/lib/lp/registry/stories/person/xx-person-edit-jabber-ids.rst
38index b18d91f..f58b5bf 100644
39--- a/lib/lp/registry/stories/person/xx-person-edit-jabber-ids.rst
40+++ b/lib/lp/registry/stories/person/xx-person-edit-jabber-ids.rst
41@@ -47,7 +47,7 @@ it will be associated with their account.
42 >>> show_errors(user_browser)
43
44 >>> def show_jabberids(browser):
45- ... tags = find_tags_by_class(browser.contents, "jabber_account")
46+ ... tags = find_tags_by_class(browser.contents, "jabber-account")
47 ... for item in tags:
48 ... print(extract_text(item.find("span")))
49 ...
50diff --git a/lib/lp/registry/stories/person/xx-person-edit-matrix-accounts.rst b/lib/lp/registry/stories/person/xx-person-edit-matrix-accounts.rst
51index 976b13f..7f1dc34 100644
52--- a/lib/lp/registry/stories/person/xx-person-edit-matrix-accounts.rst
53+++ b/lib/lp/registry/stories/person/xx-person-edit-matrix-accounts.rst
54@@ -51,7 +51,7 @@ and clicks on the 'Save Changes' button.
55
56 >>> def show_matrix_accounts(browser):
57 ... for item in find_tags_by_class(
58- ... browser.contents, "matrix_account"
59+ ... browser.contents, "matrix-account"
60 ... ):
61 ... print(extract_text(item.find("span")))
62 ...
63diff --git a/lib/lp/registry/stories/person/xx-person-home.rst b/lib/lp/registry/stories/person/xx-person-home.rst
64index 03cd8d6..ac5885e 100644
65--- a/lib/lp/registry/stories/person/xx-person-home.rst
66+++ b/lib/lp/registry/stories/person/xx-person-home.rst
67@@ -105,14 +105,14 @@ A person's jabber IDs are only show to authenticated users.
68
69 >>> user_browser.open("http://launchpad.test/~mark")
70 >>> for item in find_tags_by_class(
71- ... user_browser.contents, "jabber_account"
72+ ... user_browser.contents, "jabber-account"
73 ... ):
74 ... print(extract_text(item.find("span")))
75 markshuttleworth@jabber.org
76
77 >>> anon_browser.open("http://launchpad.test/~mark")
78 >>> for item in find_tags_by_class(
79- ... anon_browser.contents, "jabber_account"
80+ ... anon_browser.contents, "jabber-account"
81 ... ):
82 ... print(extract_text(item.find("span")))
83 &lt;email address hidden&gt;
84diff --git a/lib/lp/registry/templates/person-portlet-contact-details.pt b/lib/lp/registry/templates/person-portlet-contact-details.pt
85index 0354913..e7b5a00 100644
86--- a/lib/lp/registry/templates/person-portlet-contact-details.pt
87+++ b/lib/lp/registry/templates/person-portlet-contact-details.pt
88@@ -172,46 +172,46 @@
89 </dl>
90 </div>
91
92- <div class="yui-u user_social_accounts" tal:condition="view/should_show_socialaccounts_section">
93+ <div class="yui-u user-social-accounts" tal:condition="view/should_show_socialaccounts_section">
94 <dl id="social-accounts">
95 <dt>Social accounts:</dt>
96
97- <dd class="user_social_accounts__item irc_account" tal:repeat="ircnick context/ircnicknames">
98- <img class="user_social_accounts__icon" alt="IRC" title="IRC" src="/@@/social-irc"/>
99+ <dd class="user-social-accounts__item irc-account" tal:repeat="ircnick context/ircnicknames">
100+ <img class="user-social-accounts__icon" alt="IRC" title="IRC" src="/@@/social-irc"/>
101 <span><span tal:replace="structure ircnick/fmt:formatted_displayname" /></span>
102 <a tal:replace="structure overview_menu/editircnicknames/fmt:icon"/>
103 </dd>
104
105- <dd class="user_social_accounts__item jabber_account" tal:repeat="jabberid context/jabberids">
106- <img class="user_social_accounts__icon" alt="Jabber" title="Jabber" src="/@@/social-jabber" />
107+ <dd class="user-social-accounts__item jabber-account" tal:repeat="jabberid context/jabberids">
108+ <img class="user-social-accounts__icon" alt="Jabber" title="Jabber" src="/@@/social-jabber" />
109 <span><span tal:replace="jabberid/jabberid/fmt:obfuscate-email" /></span>
110 <a tal:replace="structure overview_menu/editjabberids/fmt:icon"/>
111 </dd>
112
113- <dd class="user_social_accounts__item matrix_account" tal:repeat="social_account view/matrix_accounts">
114+ <dd class="user-social-accounts__item matrix-account" tal:repeat="social_account view/matrix_accounts">
115 <span><span tal:replace="structure social_account/fmt:formatted_display" /></span>
116 <a tal:replace="structure overview_menu/editmatrixaccounts/fmt:icon" />
117 </dd>
118
119 <tal:irc condition="view/should_show_ircnicknames_section">
120- <dd class="user_social_accounts__item" tal:condition="not: context/ircnicknames" id="empty-irc">
121- <img class="user_social_accounts__icon" alt="IRC" title="IRC" src="/@@/social-irc"/>
122+ <dd class="user-social-accounts__item" tal:condition="not: context/ircnicknames" id="empty-irc">
123+ <img class="user-social-accounts__icon" alt="IRC" title="IRC" src="/@@/social-irc"/>
124 <span>No IRC nicknames registered.</span>
125 <a tal:replace="structure overview_menu/editircnicknames/fmt:icon"/>
126 </dd>
127 </tal:irc>
128
129 <tal:jabber condition="view/should_show_jabberids_section">
130- <dd class="user_social_accounts__item" tal:condition="context/jabberids/is_empty" id="empty-jabber">
131- <img class="user_social_accounts__icon" alt="Jabber" title="Jabber" src="/@@/social-jabber" />
132+ <dd class="user-social-accounts__item" tal:condition="context/jabberids/is_empty" id="empty-jabber">
133+ <img class="user-social-accounts__icon" alt="Jabber" title="Jabber" src="/@@/social-jabber" />
134 <span>No Jabber IDs registered.</span>
135 <a tal:replace="structure overview_menu/editjabberids/fmt:icon" />
136 </dd>
137 </tal:jabber>
138
139 <tal:matrix condition="view/should_show_matrix_accounts_section">
140- <dd class="user_social_accounts__item" tal:condition="not: view/matrix_accounts" id="empty-matrix">
141- <img class="user_social_accounts__icon" alt="Matrix" title="Matrix" src="/@@/social-matrix" />
142+ <dd class="user-social-accounts__item" tal:condition="not: view/matrix_accounts" id="empty-matrix">
143+ <img class="user-social-accounts__icon" alt="Matrix" title="Matrix" src="/@@/social-matrix" />
144 <span>No matrix accounts registered.</span>
145 <a tal:replace="structure overview_menu/editmatrixaccounts/fmt:icon" />
146 </dd>

Subscribers

People subscribed via source and target branches

to status/vote changes: