Merge lp:~deryck/launchpad/edit-bug-ui-update-412971 into lp:launchpad

Proposed by Deryck Hodge
Status: Merged
Merged at revision: not available
Proposed branch: lp:~deryck/launchpad/edit-bug-ui-update-412971
Merge into: lp:launchpad
Diff against target: None lines
To merge this branch: bzr merge lp:~deryck/launchpad/edit-bug-ui-update-412971
Reviewer Review Type Date Requested Status
Eleanor Berger (community) ui Approve
Guilherme Salgado (community) Approve
Review via email: mp+10151@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Deryck Hodge (deryck) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

= Summary =

This branch is my first attempt at mechanical conversions for 3.0 UI
updates for bugs templates. This works on bug-edit.pt, which will
rarely be hit with all the recent AJAX work. The idea was to do an
easy, low-visibility template to start, to understand some basics of the
updating process.

See bug 412971 for a good bit of discussion/mid-implementation notes as
I worked out what to do.

I think most of the comments there also get me pretty far along in UI
review. The only question I have remaining is minor. In the original
version the page heading was "Edit bug description" and I changed that
to "Edit bug information" since the page encompasses more fields than
description. Perhaps description is a better word or there is yet
another better term.

== Screenshots ==

Before:
http://launchpadlibrarian.net/30273670/edit-bug-page-before-changes.png

After:
http://launchpadlibrarian.net/30279936/edit-bug-using-generic-edit.png

== Tests ==

./bin/test -vv -t xx-bug-edit.txt

The test is currently broken, and I'm waiting on a fix to base layout by
Edwin to land before fixing the test. There may be other tests broken,
too, and I have the branch in ec2test for now to know for sure.

I'll amend the MP with a diff of test updates when done.

== Demo and Q/A ==

Add +edit to any bug page url and make sure the page works and looks
like it should.

= Launchpad lint =

Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.

Linting changed files:
  lib/lp/bugs/browser/bug.py
  lib/lp/bugs/browser/configure.zcml
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkqFZC4ACgkQ4glRK0DaE8hqKACePEtezQOZY461nq4jbK50LhO+
icwAn0n0s9+t0eF7ZAl9HI37znsigG+T
=d32Q
-----END PGP SIGNATURE-----

Revision history for this message
Guilherme Salgado (salgado) wrote :

Hi Deryck,

I noticed the link to the bug's page on the heading doesn't exist in the
new UI, but I don't think that's a problem as we now have the 'Cancel'
link at the bottom. It'd be nice if you could double check that with
Martin.

Other than that, it looks nice, and I only have one suggestion below.

 review approve

On Fri, 2009-08-14 at 13:25 +0000, Deryck Hodge wrote:
> = Summary =
>
> This branch is my first attempt at mechanical conversions for 3.0 UI
> updates for bugs templates. This works on bug-edit.pt, which will
> rarely be hit with all the recent AJAX work. The idea was to do an
> easy, low-visibility template to start, to understand some basics of
> the
> updating process.
>
> See bug 412971 for a good bit of discussion/mid-implementation notes
> as
> I worked out what to do.
>
> I think most of the comments there also get me pretty far along in UI
> review. The only question I have remaining is minor. In the original
> version the page heading was "Edit bug description" and I changed that
> to "Edit bug information" since the page encompasses more fields than
> description. Perhaps description is a better word or there is yet
> another better term.
>
> == Screenshots ==
>
> Before:
> http://launchpadlibrarian.net/30273670/edit-bug-page-before-changes.png
>
> After:
> http://launchpadlibrarian.net/30279936/edit-bug-using-generic-edit.png
>
> == Tests ==
>
> ./bin/test -vv -t xx-bug-edit.txt
>
> The test is currently broken, and I'm waiting on a fix to base layout
> by
> Edwin to land before fixing the test. There may be other tests
> broken,
> too, and I have the branch in ec2test for now to know for sure.
>
> I'll amend the MP with a diff of test updates when done.
>

> === modified file 'lib/lp/bugs/browser/bug.py'
> --- lib/lp/bugs/browser/bug.py 2009-08-04 05:30:51 +0000
> +++ lib/lp/bugs/browser/bug.py 2009-08-14 13:06:27 +0000
> @@ -412,7 +412,8 @@
> @cachedproperty
> def subscriber_ids(self):
> """Return a dictionary mapping a css_name to user name."""
> - subscribers = self.direct_subscribers.union(self.duplicate_subscribers)
> + subscribers = self.direct_subscribers.union(
> + self.duplicate_subscribers)
>
> # The current user has to be in subscribers_id so
> # in case the id is needed for a new subscription.
> @@ -555,6 +556,21 @@
> BugEditViewBase.__init__(self, context, request)
> self.notifications = []
>
> + @property
> + def label(self):
> + """The form label."""
> + return 'Edit Bug Information'

I guess we don't need this to be a property, do we?

> +
> + @property
> + def page_title(self):
> + """The page title."""
> + return 'Edit %s ' % self.context.title
> +
> + @property
> + def cancel_url(self):
> + """See `LaunchpadFormView`."""
> + return canonical_url(self.context)
> +
> def validate(self, data):
> """Make sure new tags are confirmed."""
> if 'tags' not in data:
>

>
--
Guilherme Salgado <email address hidden>

review: Approve
Revision history for this message
Deryck Hodge (deryck) wrote :

Hi, salgado. Thanks for the review!

On Fri, Aug 14, 2009 at 9:30 AM, Guilherme Salgado<email address hidden> wrote:
> I noticed the link to the bug's page on the heading doesn't exist in the
> new UI, but I don't think that's a problem as we now have the 'Cancel'
> link at the bottom. It'd be nice if you could double check that with
> Martin.

I think this is okay because the breadcrumbs Gavin is working on will
have the bug link.

>> +    @property
>> +    def label(self):
>> +        """The form label."""
>> +        return 'Edit Bug Information'
>
> I guess we don't need this to be a property, do we?
>

I'm not sure I follow exactly what you mean, sorry. Do you mean I
should use the simpler form of:

label = 'Edit Bug Description'

That would make since given the string is not constructed from some
other piece of data. But I wanted to make sure I understood you
first.

Cheers,
deryck

Revision history for this message
Guilherme Salgado (salgado) wrote :

On Fri, 2009-08-14 at 15:45 +0000, Deryck Hodge wrote:
> Hi, salgado. Thanks for the review!
>
> On Fri, Aug 14, 2009 at 9:30 AM, Guilherme Salgado<email address hidden> wrote:
> > I noticed the link to the bug's page on the heading doesn't exist in the
> > new UI, but I don't think that's a problem as we now have the 'Cancel'
> > link at the bottom. It'd be nice if you could double check that with
> > Martin.
>
> I think this is okay because the breadcrumbs Gavin is working on will
> have the bug link.

Fair enough.

>
> >> + @property
> >> + def label(self):
> >> + """The form label."""
> >> + return 'Edit Bug Information'
> >
> > I guess we don't need this to be a property, do we?
> >
>
> I'm not sure I follow exactly what you mean, sorry. Do you mean I
> should use the simpler form of:
>
> label = 'Edit Bug Description'
>
> That would make since given the string is not constructed from some
> other piece of data. But I wanted to make sure I understood you
> first.

That's exactly what I meant. :)

Cheers,

--
Guilherme Salgado <email address hidden>

Revision history for this message
Eleanor Berger (intellectronica) wrote :

We've discussed removing the nickname field from the form (since it now can't be accessed by most users). You're filing a bug for doing that.

review: Approve (ui)
Revision history for this message
Deryck Hodge (deryck) wrote :

> We've discussed removing the nickname field from the form (since it now can't
> be accessed by most users). You're filing a bug for doing that.

This is captured as bug 416369.

Revision history for this message
Deryck Hodge (deryck) wrote :
Download full text (5.6 KiB)

I had been waiting on some notifications fixes to be able to land
this branch, but turns out, the older way of doing this is correct
because the notifications have to appear inside the form.

Here's a diff of the change back to the original template, with
3.0 mechanical updates plus removing the obsolete test.

=== modified file 'lib/lp/bugs/browser/bug.py'
--- lib/lp/bugs/browser/bug.py 2009-08-21 12:57:32 +0000
+++ lib/lp/bugs/browser/bug.py 2009-08-21 15:31:10 +0000
@@ -549,7 +549,6 @@
     custom_widget('title', TextWidget, displayWidth=30)
     custom_widget('tags', BugTagsWidget)
     next_url = None
- label = 'Edit Bug Information'

     _confirm_new_tags = False

@@ -558,9 +557,14 @@
         self.notifications = []

     @property
+ def label(self):
+ """The form label."""
+ return 'Edit details for bug #%d' % self.context.id
+
+ @property
     def page_title(self):
         """The page title."""
- return 'Edit %s ' % self.context.title
+ return self.label

     @property
     def cancel_url(self):

=== modified file 'lib/lp/bugs/browser/configure.zcml'
--- lib/lp/bugs/browser/configure.zcml 2009-08-21 12:57:32 +0000
+++ lib/lp/bugs/browser/configure.zcml 2009-08-21 15:19:06 +0000
@@ -485,7 +485,7 @@
             name="+edit"
             for="lp.bugs.interfaces.bugtask.IBugTask"
             class="lp.bugs.browser.bug.BugEditView"
- template="../../app/templates/generic-edit.pt"
+ template="../templates/bug-edit.pt"
             permission="launchpad.Edit"/>
         <browser:page
             name="+secrecy"

=== removed file 'lib/lp/bugs/stories/bugs/xx-bug-actions.txt'
--- lib/lp/bugs/stories/bugs/xx-bug-actions.txt 2009-06-12 16:36:02 +0000
+++ lib/lp/bugs/stories/bugs/xx-bug-actions.txt 1970-01-01 00:00:00 +0000
@@ -1,93 +0,0 @@
-The bug index page includes action links, which provide various links
-to add things to the bug, inlined within the main content area.
-
- >>> user_browser.open(
- ... 'http://bugs.launchpad.dev/debian/+source/mozilla-firefox/+bug/3')
- >>> print user_browser.contents
- <...
- ...Activity log...
- ...Mark as duplicate...
-
-On other bug views, the 'Mark as duplicate' link can be found in the actions
-menu.
-
- >>> user_browser.getLink(url='+edit').click()
- >>> print find_tags_by_class(
- ... user_browser.contents, 'menu-link-markduplicate')[0].renderContents()
- Mark as duplicate
-
- Tests the marking of a bug that is a duplicate of a duplicate.
-
- >>> user_browser.getLink('Mark as duplicate').click()
- >>> print user_browser.url
- http://bugs.launchpad.dev/debian/+source/mozilla-firefox/+bug/3/+duplicate
-
- >>> user_browser.getControl('Duplicate Of').value = '6'
- >>> user_browser.getControl('Change').click()
- >>> print user_browser.contents
- <...
- <p class="error message">There is 1 error.</p>
- ...
- ...already a duplicate...
-
-
- Tests the marking of a bug that is a duplicate of itself.
-
- >>> user_browser.getControl('Duplicate Of').value = '3'
- >>> user_browser.getControl('Change').click()
- >>> print user_browser.contents
- <...
- <p class="error message">There is 1 error.</p>
- ...
- ......

Read more...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/bugs/browser/bug.py'
2--- lib/lp/bugs/browser/bug.py 2009-08-04 05:30:51 +0000
3+++ lib/lp/bugs/browser/bug.py 2009-08-14 13:06:27 +0000
4@@ -412,7 +412,8 @@
5 @cachedproperty
6 def subscriber_ids(self):
7 """Return a dictionary mapping a css_name to user name."""
8- subscribers = self.direct_subscribers.union(self.duplicate_subscribers)
9+ subscribers = self.direct_subscribers.union(
10+ self.duplicate_subscribers)
11
12 # The current user has to be in subscribers_id so
13 # in case the id is needed for a new subscription.
14@@ -555,6 +556,21 @@
15 BugEditViewBase.__init__(self, context, request)
16 self.notifications = []
17
18+ @property
19+ def label(self):
20+ """The form label."""
21+ return 'Edit Bug Information'
22+
23+ @property
24+ def page_title(self):
25+ """The page title."""
26+ return 'Edit %s ' % self.context.title
27+
28+ @property
29+ def cancel_url(self):
30+ """See `LaunchpadFormView`."""
31+ return canonical_url(self.context)
32+
33 def validate(self, data):
34 """Make sure new tags are confirmed."""
35 if 'tags' not in data:
36
37=== modified file 'lib/lp/bugs/browser/configure.zcml'
38--- lib/lp/bugs/browser/configure.zcml 2009-07-27 12:39:34 +0000
39+++ lib/lp/bugs/browser/configure.zcml 2009-08-13 18:51:36 +0000
40@@ -485,7 +485,7 @@
41 name="+edit"
42 for="lp.bugs.interfaces.bugtask.IBugTask"
43 class="lp.bugs.browser.bug.BugEditView"
44- template="../templates/bug-edit.pt"
45+ template="../../app/templates/generic-edit.pt"
46 permission="launchpad.Edit"/>
47 <browser:page
48 name="+secrecy"
49
50=== removed file 'lib/lp/bugs/templates/bug-edit.pt'
51--- lib/lp/bugs/templates/bug-edit.pt 2009-07-17 17:59:07 +0000
52+++ lib/lp/bugs/templates/bug-edit.pt 1970-01-01 00:00:00 +0000
53@@ -1,58 +0,0 @@
54-<html
55- xmlns="http://www.w3.org/1999/xhtml"
56- xmlns:tal="http://xml.zope.org/namespaces/tal"
57- xmlns:metal="http://xml.zope.org/namespaces/metal"
58- xmlns:i18n="http://xml.zope.org/namespaces/i18n"
59- xml:lang="en"
60- lang="en"
61- dir="ltr"
62- metal:use-macro="context/@@main_template/master"
63- i18n:domain="malone"
64->
65- <body>
66- <metal:heading fill-slot="pageheading">
67- <div>
68- <tal:icon replace="structure context/image:icon" />
69- <a tal:attributes="href context/fmt:url"
70- >Bug #<tal:bug replace="context/bug/id">3252543</tal:bug></a>:
71- <tal:title replace="context/bug/title">Foo doesn't work</tal:title>
72- </div>
73- <h1>Edit bug description</h1>
74- </metal:heading>
75-
76- <metal:leftportlets fill-slot="portlets_one">
77- <div tal:replace="structure context/bug/@@+portlet-subscribers" />
78- </metal:leftportlets>
79-
80- <metal:rightportlets fill-slot="portlets_two">
81- <div tal:replace="structure context/@@+portlet-search" />
82- <div tal:replace="structure context/bug/@@+portlet-cve" />
83- <div tal:replace="structure context/bug/@@+portlet-watch" />
84- </metal:rightportlets>
85-
86- <div metal:fill-slot="main">
87-
88- <div metal:use-macro="context/@@launchpad_form/form">
89-
90-
91- <metal:extra_info metal:fill-slot="extra_info">
92-
93- <p>
94- Your changes will be reflected in all contexts where
95- this bug has been reported.
96- </p>
97-
98- <p class="informational message"
99- tal:repeat="message view/notifications"
100- tal:content="structure message">
101- Confirmation message.
102- </p>
103-
104- </metal:extra_info>
105-
106- </div>
107-
108- </div>
109-
110- </body>
111-</html>