Merge lp:~deadlight/canonical-identity-provider/table-header into lp:canonical-identity-provider/release

Proposed by Karl Williams
Status: Merged
Approved by: Maximiliano Bertacchini
Approved revision: no longer in the source branch.
Merged at revision: 1720
Proposed branch: lp:~deadlight/canonical-identity-provider/table-header
Merge into: lp:canonical-identity-provider/release
Diff against target: 87 lines (+34/-21)
2 files modified
src/identityprovider/tests/sso_server/test_home_page.py (+9/-3)
src/webui/templates/widgets/last_auth_sites.html (+25/-18)
To merge this branch: bzr merge lp:~deadlight/canonical-identity-provider/table-header
Reviewer Review Type Date Requested Status
Daniel Manrique (community) Approve
Anthony Dillon (community) Approve
Review via email: mp+378868@code.launchpad.net

Commit message

Update home page recently authenticated table to display more clearly. Also correct grammar of section heading

Description of the change

Updated home page recently authenticated table to display more clearly
Also corrected grammar of the section heading

To post a comment you must log in.
Revision history for this message
Karl Williams (deadlight) wrote :

This is quite difficult to QA locally but here is a screenshot of some sample data:
https://imgur.com/a/x1eX6ok

Revision history for this message
Anthony Dillon (ya-bo-ng) wrote :

LGTM +1

review: Approve
Revision history for this message
Daniel Manrique (roadmr) wrote :

+1! THanks!

Fair to land this and do any final QA on staging.

review: Approve
Revision history for this message
Otto Co-Pilot (otto-copilot) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/identityprovider/tests/sso_server/test_home_page.py'
2--- src/identityprovider/tests/sso_server/test_home_page.py 2020-02-06 17:49:06 +0000
3+++ src/identityprovider/tests/sso_server/test_home_page.py 2020-02-11 16:47:35 +0000
4@@ -33,7 +33,10 @@
5
6 self.assertContains(response, "Test Account")
7 self.assertContains(response, self.account.displayname)
8- self.assertContains(response, "Sites you last authenticated to")
9+ self.assertContains(
10+ response,
11+ "Sites to which you have recently authenticated"
12+ )
13
14 # == Previously Visited Sites ==
15
16@@ -47,8 +50,11 @@
17 # Now reload the page
18 response = self.client.get(self.base_url)
19 visited = self.get_from_response(
20- response, '.last-authenticated-sites').text()
21- self.assertIn("Sites you last authenticated to", visited)
22+ response, '#authenticated-sites').text()
23+ self.assertIn(
24+ "Sites to which you have recently authenticated",
25+ visited
26+ )
27 self.assertIn("Site", visited)
28 self.assertIn("Date", visited)
29 for summary in OpenIDRPSummary.objects.all():
30
31=== modified file 'src/webui/templates/widgets/last_auth_sites.html'
32--- src/webui/templates/widgets/last_auth_sites.html 2014-12-10 15:30:54 +0000
33+++ src/webui/templates/widgets/last_auth_sites.html 2020-02-11 16:47:35 +0000
34@@ -1,28 +1,35 @@
35 {% comment %}
36-Copyright 2010 Canonical Ltd. This software is licensed under the
37+Copyright 2010-2020 Canonical Ltd. This software is licensed under the
38 GNU Affero General Public License version 3 (see the file LICENSE).
39 {% endcomment %}
40
41 {% load i18n %}
42
43 {% if last_authenticated_sites %}
44-<section class="last-authenticated-sites listing-section">
45- <h3>{% trans "Sites you last authenticated to" %} <span class="subtitle">Date</span></h3>
46+<div class="p-strip is-shallow"><hr></div>
47
48- <table class="listing">
49- <tbody>
50- {% for site in last_authenticated_sites %}
51- <tr>
52- <td class="site-url">
53- {% if embedded %}{{ site.trust_root }}{% else %}
54- <a href="{{ site.trust_root }}" data-qa-id="visited_site_url">{{ site.trust_root }}</a>{% endif %}
55- </td>
56- <td class="site-date" data-qa-id="visited_site_date">
57- {{ site.date_last_used|date:"Y/m/d" }}
58- </td>
59- </tr>
60- {% endfor %}
61- </tbody>
62- </table>
63+<section id="authenticated-sites">
64+ <h2 class="p-heading--four">{% trans "Sites to which you have recently authenticated" %}</h2>
65+ <table class="p-table">
66+ <thead>
67+ <tr>
68+ <th>Site</th>
69+ <th class="u-align--right">Date</th>
70+ </tr>
71+ </thead>
72+ <tbody>
73+ {% for site in last_authenticated_sites %}
74+ <tr>
75+ <td>
76+ {% if embedded %}{{ site.trust_root }}{% else %}
77+ <a href="{{ site.trust_root }}" data-qa-id="visited_site_url">{{ site.trust_root }}</a>{% endif %}
78+ </td>
79+ <td class="u-align--right" data-qa-id="visited_site_date">
80+ {{ site.date_last_used|date:"Y/m/d" }}
81+ </td>
82+ </tr>
83+ {% endfor %}
84+ </tbody>
85+ </table>
86 </section>
87 {% endif %}