Merge ~solazio/canonical-identity-provider:fix-truncated-columns into canonical-identity-provider:master

Proposed by Ovidiu Suciu
Status: Merged
Approved by: Maximiliano Bertacchini
Approved revision: 36dabb07c867182569d16fe51633127403cc3baa
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~solazio/canonical-identity-provider:fix-truncated-columns
Merge into: canonical-identity-provider:master
Diff against target: 62 lines (+9/-11)
3 files modified
src/webui/templates/account/auth_log.html (+6/-8)
src/webui/templates/vanilla/base.html (+2/-2)
src/webui/tests/test_views_auth_log.py (+1/-1)
Reviewer Review Type Date Requested Status
Maximiliano Bertacchini Approve
Review via email: mp+386386@code.launchpad.net

Commit message

Fix the truncated text on the account activity page

Description of the change

Fix the truncated text on the account activity page.

This is a fix for https://bugs.launchpad.net/canonical-identity-provider/+bug/1863218

To post a comment you must log in.
Revision history for this message
Maximiliano Bertacchini (maxiberta) wrote :

Thanks! Columns are not truncated now, which certainly fixes the issue with copying its contents.

Otoh, row height is now ~8x taller, which might make the table unwieldily long, imho. Would that be an issue?

  https://private-fileshare.canonical.com/~maxiberta/Screenshot_20200625_120258.png

If so, maybe it can be improved a bit:

- Join Type and IP address columns.
- Make the UA column wider.
- Move general layout from 4+8 cols to 3+9 cols (this is a site-wide design change and would probably need a more thorough review from UX/Design).

  https://private-fileshare.canonical.com/~maxiberta/Screenshot_20200625_120547.png

Diff (including mock data): https://pastebin.canonical.com/p/qcM7HYs3Vj/

This is just a mock I came up with in 5mins. Please feel free to ignore :)

review: Approve
Revision history for this message
Maximiliano Bertacchini (maxiberta) wrote :

Date/time can also be split trivially: https://pastebin.canonical.com/p/mQkX6PgcMp/

Revision history for this message
Ovidiu Suciu (solazio) wrote :

Thanks for the comments. Let me run this through UX & Design first and then I'll do the updates.

Revision history for this message
Maximiliano Bertacchini (maxiberta) wrote :

Looks great, thanks!

review: Approve
Revision history for this message
Otto Co-Pilot (otto-copilot) wrote :
Revision history for this message
Otto Co-Pilot (otto-copilot) wrote :
36dabb0... by Ovidiu Suciu

Fix failing AuthLogTestCase test

Revision history for this message
Maximiliano Bertacchini (maxiberta) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/webui/templates/account/auth_log.html b/src/webui/templates/account/auth_log.html
2index 55def28..83b844c 100644
3--- a/src/webui/templates/account/auth_log.html
4+++ b/src/webui/templates/account/auth_log.html
5@@ -30,19 +30,17 @@ GNU Affero General Public License version 3 (see the file LICENSE).
6 <table class="p-table">
7 <thead>
8 <tr>
9- <th>{% trans "Time/date" %}</th>
10- <th>{% trans "Type" %}</th>
11- <th>{% trans "IP address" %}</th>
12- <th>{% trans "User Agent/Browser" %}</th>
13+ <th>{% trans "date<br />time" %}</th>
14+ <th>{% trans "Type<br />IP address" %}</th>
15+ <th style="width: 50%">{% trans "User Agent (Browser)" %}</th>
16 </tr>
17 </thead>
18 <tbody>
19 {% for attempt in auth_log %}
20 <tr>
21- <td class="p-table__item--truncate" title="{{ attempt.when_created }}">{{ attempt.when_created }}</td>
22- <td>{{ attempt.log_type_label }}</td>
23- <td>{{ attempt.remote_ip }}</td>
24- <td class="p-table__item--truncate" title="{{ attempt.user_agent }}">{{ attempt.user_agent }}</td>
25+ <td>{{ attempt.when_created|date }}<br />{{ attempt.when_created|time }}</td>
26+ <td>{{ attempt.log_type_label }}<br />{{ attempt.remote_ip }}</td>
27+ <td>{{ attempt.user_agent }}</td>
28 </tr>
29 {% endfor %}
30 </tbody>
31diff --git a/src/webui/templates/vanilla/base.html b/src/webui/templates/vanilla/base.html
32index 7d1f356..7f8cd4d 100644
33--- a/src/webui/templates/vanilla/base.html
34+++ b/src/webui/templates/vanilla/base.html
35@@ -53,12 +53,12 @@ class="{% block bodyclass %}{% if user.is_authenticated %}with-menu{% endif %}{%
36 <div id="{% block content_id %}box{% endblock %}" class="row">
37 {% block menu %}
38 {% if user.is_authenticated %}
39- <div class="col-4 p-sidebar">
40+ <div class="col-3 p-sidebar">
41 {% include "vanilla/widgets/personal-menu.html" %}
42 </div>
43 {% endif %}
44 {% endblock %}
45- <div class="{% block content_class %}col-8{% endblock %}">
46+ <div class="{% block content_class %}col-9{% endblock %}">
47 <section class="p-strip">
48 {% block readonly %}
49 {% if readonly %}
50diff --git a/src/webui/tests/test_views_auth_log.py b/src/webui/tests/test_views_auth_log.py
51index 75c5f18..fb14f92 100644
52--- a/src/webui/tests/test_views_auth_log.py
53+++ b/src/webui/tests/test_views_auth_log.py
54@@ -28,7 +28,7 @@ class AuthLogTestCase(AuthenticatedTestCase):
55 r = self.client.get(reverse('auth_log'))
56 assert len(r.context['auth_log']) != 0
57 self.assertTemplateUsed(r, 'account/auth_log.html')
58- self.assertContains(r, "Time/date")
59+ self.assertContains(r, "date<br />time")
60 self.assertContains(r, "Recent accesses")
61
62 def test_auth_log_page_limit_per_page_auth_records(self):

Subscribers

People subscribed via source and target branches