Merge lp:~gmb/launchpad/add-next_check-to-bugwatch-pages-bug-558410 into lp:launchpad

Proposed by Graham Binns
Status: Merged
Approved by: Graham Binns
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~gmb/launchpad/add-next_check-to-bugwatch-pages-bug-558410
Merge into: lp:launchpad
Diff against target: 237 lines (+112/-20)
4 files modified
lib/lp/bugs/stories/bugtracker/xx-bugtracker.txt (+35/-12)
lib/lp/bugs/stories/bugwatches/xx-edit-bugwatch.txt (+42/-1)
lib/lp/bugs/templates/bugtracker-portlet-watches.pt (+14/-0)
lib/lp/bugs/templates/bugwatch-portlet-details.pt (+21/-7)
To merge this branch: bzr merge lp:~gmb/launchpad/add-next_check-to-bugwatch-pages-bug-558410
Reviewer Review Type Date Requested Status
Michael Nelson (community) ui Approve
Abel Deuring (community) code Approve
Review via email: mp+23080@code.launchpad.net

Commit message

Display the lastchecked and next_check values for BugWatches on the BugTracker overview and BugWatch +edit pages.

Description of the change

This branch changes the BugTracker overview and BugWatch +edit pages so
that they now display a watch's next_check and lastchecked columns. This
will give users a better idea of when to expect a bug watch to be
updated.

== lib/lp/bugs/stories/bugtracker/xx-bugtracker.txt ==

 - I've added tests to cover the new "Last checked" and "Next check"
   columns.

== lib/lp/bugs/stories/bugwatches/xx-edit-bugwatch.txt ==

 - I've added tests to cover the new "Last checked" and "Scheduled"
   items on the page.

== lib/lp/bugs/templates/bugtracker-portlet-watches.pt ==

 - The lastchecked and next_check fields of each BugWatch are now
   displayed in the BugWatch table.

== lib/lp/bugs/templates/bugwatch-portlet-details.pt ==

 - The lastchecked and next_check fields of each BugWatch are now
   displayed on the +edit page.

To post a comment you must log in.
Revision history for this message
Abel Deuring (adeuring) :
review: Approve (code)
Revision history for this message
Michael Nelson (michael.nelson) wrote :

Looks great Graham. I noticed you are using approximatedate for the 'Last checked' column, which I think is correct, as seeing 3 days ago would be more helpful to me than 2010-04-06, but it seems that approximatedate only does so if the timedelta is <= 1 day... do you know why this is?

Also why not simply use 'Last check' as the column heading? (ie. a noun, like 'Next check' and the other column headers).

Very insignificant thought regarding the ordering of the 2 col dls, would it be easier to scan if Created/Changed and Checked/Scheduled where vertically aligned like this:

Tracker | Remote bug id
Last status | Created
Checked | Changed
Scheduled | Created by

Anyway, approved either way.

review: Approve (ui)
Revision history for this message
Graham Binns (gmb) wrote :

On Fri, Apr 09, 2010 at 10:52:38AM -0000, Michael Nelson wrote:
> Review: Approve ui
> Looks great Graham. I noticed you are using approximatedate for the
> 'Last checked' column, which I think is correct, as seeing 3 days ago
> would be more helpful to me than 2010-04-06, but it seems that
> approximatedate only does so if the timedelta is <= 1 day... do you
> know why this is?

I don't know. Long forgotten design decision probably.

>
> Also why not simply use 'Last check' as the column heading? (ie. a
> noun, like 'Next check' and the other column headers).

No reason; I'll change it.

> Very insignificant thought regarding the ordering of the 2 col dls,
> would it be easier to scan if Created/Changed and Checked/Scheduled
> where vertically aligned like this:

True. I'll see if I can fix that in my next branch, which is going to
work on that page anyway.

> Tracker | Remote bug id
> Last status | Created
> Checked | Changed
> Scheduled | Created by
>
> Anyway, approved either way.

Thanks.

--
Graham Binns | PGP Key: EC66FA7D

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/bugs/stories/bugtracker/xx-bugtracker.txt'
--- lib/lp/bugs/stories/bugtracker/xx-bugtracker.txt 2009-09-18 15:24:30 +0000
+++ lib/lp/bugs/stories/bugtracker/xx-bugtracker.txt 2010-04-09 12:15:52 +0000
@@ -537,16 +537,38 @@
537When looking at a bug tracker page, a list of bug watches is537When looking at a bug tracker page, a list of bug watches is
538displayed:538displayed:
539539
540 >>> anon_browser.open(540 >>> anon_browser.open(
541 ... 'http://launchpad.dev/bugs/bugtrackers/debbugs')541 ... 'http://launchpad.dev/bugs/bugtrackers/debbugs')
542 >>> print extract_text(find_tag_by_id(542 >>> print extract_text(find_tag_by_id(
543 ... anon_browser.contents, 'latestwatches'))543 ... anon_browser.contents, 'latestwatches'))
544 Launchpad bug Remote bug Status544 Launchpad bug Remote bug Status Last check Next check
545 #15: Nonsensical bugs are useless 308994 open important545 #15: Nonse... 308994 open...
546 #3: Bug Title Test 327549546 #3: Bug T... 327549
547 #2: Blackhole Trash folder 327452547 #2: Black... 327452
548 #1: Firefox does not support SVG 304014548 #1: Firef... 304014
549 #7: A test bug 280883549 #7: A tes... 280883
550
551Scheduling any of the watches will change their "Next check" column.
552
553 >>> from datetime import datetime
554 >>> from pytz import utc
555
556 >>> login('foo.bar@canonical.com')
557 >>> debbugs = getUtility(IBugTrackerSet).getByName('debbugs')
558 >>> watch_15 = debbugs.watches[0]
559 >>> watch_15.next_check = datetime(2010, 4, 9, 9, 50, 0, tzinfo=utc)
560 >>> logout()
561
562 >>> anon_browser.open(
563 ... 'http://launchpad.dev/bugs/bugtrackers/debbugs')
564 >>> print extract_text(find_tag_by_id(
565 ... anon_browser.contents, 'latestwatches'))
566 Launchpad bug Remote bug Status Last check Next check
567 #15: Nonse... 308994 open... 2007-12-18 2010-04-09 09:50:00 UTC
568 #3: Bug T... 327549
569 #2: Black... 327452
570 #1: Firef... 304014
571 #7: A tes... 280883
550572
551573
552=== Private bugs ===574=== Private bugs ===
@@ -565,7 +587,7 @@
565 ... 'http://launchpad.dev/bugs/bugtrackers/debbugs')587 ... 'http://launchpad.dev/bugs/bugtrackers/debbugs')
566 >>> print extract_text(find_tag_by_id(588 >>> print extract_text(find_tag_by_id(
567 ... anon_browser.contents, 'latestwatches'))589 ... anon_browser.contents, 'latestwatches'))
568 Launchpad bug Remote bug Status590 Launchpad bug Remote bug Status...
569 #15: (Private) -591 #15: (Private) -
570 #3: Bug Title Test 327549592 #3: Bug Title Test 327549
571 #2: Blackhole Trash folder 327452593 #2: Blackhole Trash folder 327452
@@ -615,7 +637,8 @@
615 ... watches = find_tag_by_id(637 ... watches = find_tag_by_id(
616 ... browser.contents, 'latestwatches').tbody.findAll('tr')638 ... browser.contents, 'latestwatches').tbody.findAll('tr')
617 ... for watch in watches:639 ... for watch in watches:
618 ... bug, remote_bug, status = watch.findAll('td')640 ... bug, remote_bug, status, last_checked, next_check = (
641 ... watch.findAll('td'))
619 ... print extract_text(bug)642 ... print extract_text(bug)
620 ... print ' --> %s: %s' % (643 ... print ' --> %s: %s' % (
621 ... extract_text(remote_bug),644 ... extract_text(remote_bug),
622645
=== modified file 'lib/lp/bugs/stories/bugwatches/xx-edit-bugwatch.txt'
--- lib/lp/bugs/stories/bugwatches/xx-edit-bugwatch.txt 2009-06-12 16:36:02 +0000
+++ lib/lp/bugs/stories/bugwatches/xx-edit-bugwatch.txt 2010-04-09 12:15:52 +0000
@@ -1,4 +1,6 @@
1= Edit a bug watch =1Edit a bug watch
2================
3
24
3After a bug watch is recorded, it is possible to go back and change it.5After a bug watch is recorded, it is possible to go back and change it.
46
@@ -36,3 +38,42 @@
36 ... print extract_text(message)38 ... print extract_text(message)
37 There is 1 error.39 There is 1 error.
38 "GELLER" is not a valid URI40 "GELLER" is not a valid URI
41
42
43BugWatch details
44----------------
45
46The +edit page for a watch also displays some details about the watch.
47
48 >>> for data_tag in find_tags_by_class(
49 ... admin_browser.contents, 'bugwatch-data'):
50 ... print extract_text(data_tag.renderContents())
51 Tracker: The Mozilla.org Bug Tracker
52 Remote bug ID: 1000
53 Last status: None recorded
54 Changed: 2004-10-04
55 Checked: 2004-10-04
56 Next check: Not yet scheduled
57 Created: 2004-10-04
58 Created by: Mark Shuttleworth
59
60If we change the next_check date of the watch its will be shown in the
61Next check column.
62
63 >>> from datetime import datetime
64 >>> from pytz import utc
65 >>> from zope.component import getUtility
66
67 >>> from canonical.launchpad.ftests import login, logout
68 >>> from lp.bugs.interfaces.bugwatch import IBugWatchSet
69
70 >>> login('foo.bar@canonical.com')
71 >>> watch = getUtility(IBugWatchSet).get(2)
72 >>> watch.next_check = datetime(2010, 4, 8, 16, 07, tzinfo=utc)
73 >>> logout()
74
75 >>> admin_browser.open('http://bugs.launchpad.dev/bugs/1/+watch/2')
76 >>> data_tag = find_tag_by_id(
77 ... admin_browser.contents, 'bugwatch-next_check')
78 >>> print extract_text(data_tag.renderContents())
79 Next check: 2010-04-08...
3980
=== modified file 'lib/lp/bugs/templates/bugtracker-portlet-watches.pt'
--- lib/lp/bugs/templates/bugtracker-portlet-watches.pt 2009-09-01 15:34:12 +0000
+++ lib/lp/bugs/templates/bugtracker-portlet-watches.pt 2010-04-09 12:15:52 +0000
@@ -13,6 +13,8 @@
13 <th>Launchpad bug</th>13 <th>Launchpad bug</th>
14 <th>Remote bug</th>14 <th>Remote bug</th>
15 <th>Status</th>15 <th>Status</th>
16 <th>Last check</th>
17 <th>Next check</th>
16 </tr>18 </tr>
17 </thead>19 </thead>
18 <tbody>20 <tbody>
@@ -43,6 +45,18 @@
43 </a>45 </a>
44 </td>46 </td>
45 <td><tal:status tal:replace="watch/remotestatus"/></td>47 <td><tal:status tal:replace="watch/remotestatus"/></td>
48 <td>
49 <span
50 tal:attributes="title watch/lastchecked/fmt:datetime"
51 tal:content="watch/lastchecked/fmt:approximatedate">
52 13 Jan 2004
53 </span>
54 </td>
55 <td>
56 <span tal:content="watch/next_check/fmt:datetime">
57 13 Jan 2004
58 </span>
59 </td>
46 </tal:show-watch-details>60 </tal:show-watch-details>
47 </tr>61 </tr>
48 </tal:watches>62 </tal:watches>
4963
=== modified file 'lib/lp/bugs/templates/bugwatch-portlet-details.pt'
--- lib/lp/bugs/templates/bugwatch-portlet-details.pt 2009-09-03 15:47:41 +0000
+++ lib/lp/bugs/templates/bugwatch-portlet-details.pt 2010-04-09 12:15:52 +0000
@@ -5,13 +5,13 @@
5 class="portlet">5 class="portlet">
6 <h2>Bug watch details</h2>6 <h2>Bug watch details</h2>
7 <div class="two-column-list">7 <div class="two-column-list">
8 <dl>8 <dl class="bugwatch-data">
9 <dt>Tracker:</dt>9 <dt>Tracker:</dt>
10 <dd>10 <dd>
11 <a tal:replace="structure context/bugtracker/fmt:link"/>11 <a tal:replace="structure context/bugtracker/fmt:link"/>
12 </dd>12 </dd>
13 </dl>13 </dl>
14 <dl>14 <dl class="bugwatch-data">
15 <dt>Remote bug ID:</dt>15 <dt>Remote bug ID:</dt>
16 <dd>16 <dd>
17 <a tal:attributes="href context/url">17 <a tal:attributes="href context/url">
@@ -19,7 +19,7 @@
19 </a>19 </a>
20 </dd>20 </dd>
21 </dl>21 </dl>
22 <dl>22 <dl class="bugwatch-data">
23 <dt>Last status:</dt>23 <dt>Last status:</dt>
24 <dd>24 <dd>
25 <span tal:condition="not: context/remotestatus">25 <span tal:condition="not: context/remotestatus">
@@ -28,7 +28,7 @@
28 <span tal:replace="context/remotestatus">6642</span>28 <span tal:replace="context/remotestatus">6642</span>
29 </dd>29 </dd>
30 </dl>30 </dl>
31 <dl>31 <dl class="bugwatch-data">
32 <dt>Changed:</dt>32 <dt>Changed:</dt>
33 <dd>33 <dd>
34 <span34 <span
@@ -38,7 +38,7 @@
38 </span>38 </span>
39 </dd>39 </dd>
40 </dl>40 </dl>
41 <dl>41 <dl class="bugwatch-data">
42 <dt>Checked:</dt>42 <dt>Checked:</dt>
43 <dd>43 <dd>
44 <span44 <span
@@ -48,7 +48,21 @@
48 </span>48 </span>
49 </dd>49 </dd>
50 </dl>50 </dl>
51 <dl>51 <dl class="bugwatch-data" id="bugwatch-next_check">
52 <dt>Next check:</dt>
53 <dd>
54 <span
55 tal:condition="context/next_check"
56 tal:content="context/next_check/fmt:datetime">
57 13 Jan 2004
58 </span>
59 <span
60 tal:condition="not: context/next_check">
61 Not yet scheduled
62 </span>
63 </dd>
64 </dl>
65 <dl class="bugwatch-data">
52 <dt>Created:</dt>66 <dt>Created:</dt>
53 <dd>67 <dd>
54 <span68 <span
@@ -58,7 +72,7 @@
58 </span>72 </span>
59 </dd>73 </dd>
60 </dl>74 </dl>
61 <dl>75 <dl class="bugwatch-data">
62 <dt>Created by:</dt>76 <dt>Created by:</dt>
63 <dd>77 <dd>
64 <a tal:replace="structure context/owner/fmt:link" />78 <a tal:replace="structure context/owner/fmt:link" />