Merge lp:~allenap/launchpad/ui-convert-filebug-3.0-bug-415263-search into lp:launchpad
- ui-convert-filebug-3.0-bug-415263-search
- Merge into devel
Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~allenap/launchpad/ui-convert-filebug-3.0-bug-415263-search |
Merge into: | lp:launchpad |
Diff against target: | None lines |
To merge this branch: | bzr merge lp:~allenap/launchpad/ui-convert-filebug-3.0-bug-415263-search |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michael Nelson (community) | ui | Approve | |
Martin Albisetti (community) | ui | Approve | |
Brad Crittenden (community) | code | Approve | |
Review via email: mp+10321@code.launchpad.net |
Commit message
Description of the change
Gavin Panella (allenap) wrote : | # |
Michael Nelson (michael.nelson) wrote : | # |
Hi Gavin,
It looks *so* much friendlier!
As I mentioned via irc, I had a few things that I was uncertain about - so I'll need to defer to Martin or Curtis:
1. At first I thought that you should be using the default <h2>context.
2. Since you are (currently) over-riding the heading slot with an h1, you will not define view.label, otherwise the form machinery will add a second h1 to the page.
3. I'm aware that the way we designate privacy generally has changed (see base-layout.pt), but in your case you're indicating that the future bug to be created will be private - I don't know if this needs to follow the same style? Martin?
Sorry - that wasn't much help in terms of a review :/
<noodles775> Thanks allenap.... initial thoughts - it looks *much* friendlier!
<allenap> noodles775: The diff generated is complete rubbish :( I forget to target the branch to devel.
<noodles775> np.
<allenap> noodles775: But, yeah, it does look much better :)
<allenap> noodles775: I'm going to recreate the mp, so don't comment on it yet.
<noodles775> ok
* sinzui has quit (Remote closed the connection)
<allenap> noodles775: https:/
<noodles775> allenap: have you made ff a private project for that screenshot? Or why is the report private by default there (I saw that it's not locally)
<allenap> noodles775: I set bugs private by default for ff.
<noodles775> allenap: OK, so it looks great, but there are two things I'm uncertain about.
<allenap> noodles775: Hit me with the bad news!
<noodles775> allenap: first, you've used <h1>Report a bug</h1> in the 'heading' slot, where as, if I've understood sinzui's email correctly, that should be displaying the default h2 context.title there,
<noodles775> allenap: and your h1 should be displayed by lpform macro automatically (if you define view.label).
<noodles775> allenap: secondly, I haven't seen the latest discussions on the privacy indicators, but I thought we were using a global privacy indicator, rather than custom ones like you've put into the 'heading' slot there?
* noodles775 checks the template.
<allenap> noodles775: The first point - displaying context.title in the heading slot - seems strange. The title is already on the page, just above.
<allenap> noodles775: The second point - view.label - I'll look into now.
* jtv has quit ("Leaving.")
<allenap> noodles775: The privacy indicator was preserved from the old version of the template. I don't know what the new style is for private things, but I'm happy to adopt it :)
<noodles775> allenap: the view.label for forms is described in the email on lp-dev.
<noodles775> allenap: and yes, with the first point, I think you're right - it fits into the case where displaying the same heading twice is silly :)
* henninge has quit ("Ex-Chat")
...
Michael Nelson (michael.nelson) wrote : | # |
I meant to save the previous one with Needs Information.
Michael Nelson (michael.nelson) wrote : | # |
> Hi Gavin,
>
> It looks *so* much friendlier!
>
> As I mentioned via irc, I had a few things that I was uncertain about - so
> I'll need to defer to Martin or Curtis:
>
> 1. At first I thought that you should be using the default
> <h2>context.
> out that this would fall into the case of the same heading twice - so we think
> that overriding with the h1 heading is correct (fits with Curtis' email
> "because showing two identical titles is stupid" but the page_title is *not*
> the same as the context.title here - hence the uncertainty).
>
But:
noodles775> allenap: actually, I just realised - you've got two h1's there - as the heading in the branding is already h1 - so you should definitely be using an h2 in the 'heading' fill-slot.
<noodles775> Here's a good example to work from: https:/
<noodles775> (Curtis did that one :) ).
And looking at some other approved landings:
https:/
it looks like you should be using the default h2 for the breadcrumb heading even though it repeats the heading, and the form's view.label defining the h1 heading in the main content.
Again, I'm sorry that I can't yet be more definitive :/.
Brad Crittenden (bac) wrote : | # |
The code looks good Gavin.
Martin Albisetti (beuno) wrote : | # |
Hi Gavin,
This looks so much better without that initial list. Good call.
I do have, however, comments:
- The second step of the bug report shows me the old UI, even though it appears to be the same URL. Could you make sure that this only lands with both steps using the same UI?
- How about moving the "continue" button right next to the input, and maybe rename it to "next", like in our 3.0 mockup? https:/
- You have 2 h1's on the page. There should only be 1, in this case, the "Report a bug". The projects' name should be an h2. Talk to Curtis if you're not sure how to fix that
Otherwise, looking forward to this landing.
Gavin Panella (allenap) wrote : | # |
> Hi Gavin,
>
> This looks so much better without that initial list. Good call.
> I do have, however, comments:
Thanks for looking at it :)
>
> - The second step of the bug report shows me the old UI, even though it
> appears to be the same URL. Could you make sure that this only lands with both
> steps using the same UI?
Sure. I already have a follow-on branch that does this, so I'll land
them together.
> - How about moving the "continue" button right next to the input, and maybe
> rename it to "next", like in our 3.0 mockup?
> https:/
The form is being rendered by launchpad-form, which does not allow
more than one widget per row. To get the button to display on the same
row means either doing big work on launchpad-form, or bypassing it,
which would lose us a lot and adds a big maintenance overhead.
Also, as Bjorn has just mentioned in our stand-up call, we very much
need to pick up the pace of template conversions, so I'd like to leave
these kinds of changes for the second round.
Can we leave this for now, and perhaps schedule some work on
launchpad-form?
> - You have 2 h1's on the page. There should only be 1, in this case, the
> "Report a bug". The projects' name should be an h2. Talk to Curtis if you're
> not sure how to fix that
This seems to be a rule in the location_heading formatter:
if not IHasLogo.
context = nearest(context, IHasLogo)
heading = 'h2'
else:
heading = 'h1'
On the +filebug page, the context is the project (or distribution,
etc), so this is always going to end up as an h1. I'll talk to Curtis
about it.
For now, I've changed the "Report a bug" to an h2, which noodles
suggested.
Gavin.
Martin Albisetti (beuno) wrote : | # |
> The form is being rendered by launchpad-form, which does not allow
> more than one widget per row. To get the button to display on the same
> row means either doing big work on launchpad-form, or bypassing it,
> which would lose us a lot and adds a big maintenance overhead.
I really hate these zope forms.
> Also, as Bjorn has just mentioned in our stand-up call, we very much
> need to pick up the pace of template conversions, so I'd like to leave
> these kinds of changes for the second round.
>
> Can we leave this for now, and perhaps schedule some work on
> launchpad-form?
Yes, go for it.
> For now, I've changed the "Report a bug" to an h2, which noodles
> suggested.
Great, thank you.
Michael Nelson (michael.nelson) : | # |
Preview Diff
1 | === modified file 'lib/lp/bugs/browser/bugtarget.py' |
2 | --- lib/lp/bugs/browser/bugtarget.py 2009-08-17 17:09:23 +0000 |
3 | +++ lib/lp/bugs/browser/bugtarget.py 2009-08-18 11:14:07 +0000 |
4 | @@ -463,7 +463,6 @@ |
5 | security_related = data.get("security_related", False) |
6 | distribution = data.get( |
7 | "distribution", getUtility(ILaunchBag).distribution) |
8 | - product = getUtility(ILaunchBag).product |
9 | |
10 | context = self.context |
11 | if distribution is not None: |
12 | @@ -897,20 +896,6 @@ |
13 | |
14 | return search_context |
15 | |
16 | - @cachedproperty |
17 | - def most_common_bugs(self): |
18 | - """Return a list of the most duplicated bugs.""" |
19 | - search_context = self.search_context |
20 | - if search_context is None: |
21 | - return [] |
22 | - else: |
23 | - return search_context.getMostCommonBugs( |
24 | - self.user, limit=self._MATCHING_BUGS_LIMIT) |
25 | - |
26 | - @property |
27 | - def found_possible_duplicates(self): |
28 | - return self.similar_bugs or self.most_common_bugs |
29 | - |
30 | @property |
31 | def search_text(self): |
32 | """Return the search string entered by the user.""" |
33 | @@ -972,18 +957,6 @@ |
34 | " product the user selected.") |
35 | return self.widgets['product'].getInputValue() |
36 | |
37 | - @cachedproperty |
38 | - def most_common_bugs(self): |
39 | - """Return a list of the most duplicated bugs.""" |
40 | - # We can only discover the most common bugs when a product has |
41 | - # been selected. |
42 | - if self.widgets['product'].hasValidInput(): |
43 | - selected_product = self._getSelectedProduct() |
44 | - return selected_product.getMostCommonBugs( |
45 | - self.user, limit=self._MATCHING_BUGS_LIMIT) |
46 | - else: |
47 | - return [] |
48 | - |
49 | def getSecurityContext(self): |
50 | """See FileBugViewBase.""" |
51 | return self._getSelectedProduct() |
52 | @@ -1098,7 +1071,7 @@ |
53 | """See FileBugViewBase.""" |
54 | try: |
55 | bugtarget = self.widgets['bugtarget'].getInputValue() |
56 | - except InputErrors, error: |
57 | + except InputErrors: |
58 | return None |
59 | if IDistributionSourcePackage.providedBy(bugtarget): |
60 | return bugtarget.distribution |
61 | |
62 | === removed file 'lib/lp/bugs/doc/minimizing-duplicate-bug-reports.txt' |
63 | --- lib/lp/bugs/doc/minimizing-duplicate-bug-reports.txt 2009-06-12 16:36:02 +0000 |
64 | +++ lib/lp/bugs/doc/minimizing-duplicate-bug-reports.txt 1970-01-01 00:00:00 +0000 |
65 | @@ -1,95 +0,0 @@ |
66 | -Minimizing Duplicate Bug Reports |
67 | -================================ |
68 | - |
69 | -Malone does its best to discourage duplicate bug report filing. The |
70 | -default filebug workflow, for example, guides the user through a search |
71 | -for duplicate bugs before allowing the bug to actually be filed. |
72 | - |
73 | -IBugTarget has a getMostCommonBugs() method which returns a list of bugs |
74 | -ordered by number of dupes, most-duped to least-duped. |
75 | - |
76 | -(First, let's add some more duplicate bug sample data.) |
77 | - |
78 | - >>> from zope.component import getUtility |
79 | - >>> from canonical.database.sqlbase import flush_database_updates |
80 | - >>> from canonical.launchpad.interfaces import ( |
81 | - ... IBugSet, CreateBugParams, IDistributionSet, IProductSet, |
82 | - ... ILaunchBag) |
83 | - |
84 | - >>> login("no-priv@canonical.com") |
85 | - |
86 | - >>> bugset = getUtility(IBugSet) |
87 | - >>> bug_five = bugset.get(5) |
88 | - >>> bug_one = bugset.get(1) |
89 | - |
90 | - >>> firefox = getUtility(IProductSet).getByName("firefox") |
91 | - >>> ubuntu = getUtility(IDistributionSet).getByName("ubuntu") |
92 | - >>> ubuntu_firefox = ubuntu.getSourcePackage("mozilla-firefox") |
93 | - >>> current_user = getUtility(ILaunchBag).user |
94 | - >>> params = CreateBugParams( |
95 | - ... owner=current_user, title="a duplicate bug", |
96 | - ... comment="this bug is a duplicate") |
97 | - >>> bug_five_dupe = firefox.createBug(params) |
98 | - >>> bug_five_dupe.duplicateof = bug_five |
99 | - >>> bug_one_dupe = firefox.createBug(params) |
100 | - >>> bug_one_dupe.duplicateof = bug_one |
101 | - |
102 | - >>> flush_database_updates() |
103 | - |
104 | -By default, 10 bugs are returned by getMostCommonBugs(). |
105 | - |
106 | - >>> for bug in firefox.getMostCommonBugs(current_user): |
107 | - ... print "%s, %s" % (bug.title, bug.duplicates.count()) |
108 | - Firefox install instructions should be complete, 2 |
109 | - Firefox does not support SVG, 1 |
110 | - |
111 | - >>> for bug in ubuntu_firefox.getMostCommonBugs(current_user): |
112 | - ... print "%s, %s" % (bug.title, bug.duplicates.count()) |
113 | - Firefox does not support SVG, 1 |
114 | - |
115 | -If we ask for just one bug, we get only one. |
116 | - |
117 | - >>> for bug in firefox.getMostCommonBugs(current_user, limit=1): |
118 | - ... print "%s, %s" % (bug.title, bug.duplicates.count()) |
119 | - Firefox install instructions should be complete, 2 |
120 | - |
121 | -getMostCommonBugs() is also privacy aware. If bug one is marked |
122 | -private, we will no longer see it in the results, because no-priv is |
123 | -not subscribed to the bug. Note that setPrivate adds all indirect |
124 | -subscribers as direct subscribers to the bug so we must unsubscribe |
125 | -immediately. |
126 | - |
127 | - >>> print current_user.name |
128 | - no-priv |
129 | - |
130 | - >>> bug_one.isSubscribed(current_user) |
131 | - False |
132 | - >>> bug_one.setPrivate(True, current_user) |
133 | - True |
134 | - >>> bug_one.isSubscribed(current_user) |
135 | - True |
136 | - >>> bug_one.unsubscribe(current_user, current_user) |
137 | - >>> flush_database_updates() |
138 | - |
139 | - >>> for bug in firefox.getMostCommonBugs(current_user): |
140 | - ... print "%s, %s" % (bug.title, bug.duplicates.count()) |
141 | - Firefox install instructions should be complete, 2 |
142 | - |
143 | -An admin will, of course, see the private bug. |
144 | - |
145 | - >>> login("foo.bar@canonical.com") |
146 | - |
147 | - >>> current_user = getUtility(ILaunchBag).user |
148 | - |
149 | - >>> for bug in firefox.getMostCommonBugs(current_user): |
150 | - ... print "%s, %s" % (bug.title, bug.duplicates.count()) |
151 | - Firefox install instructions should be complete, 2 |
152 | - Firefox does not support SVG, 1 |
153 | - |
154 | -When the context has no duplicate bugs, an empty list is returned. |
155 | - |
156 | - >>> from canonical.launchpad.interfaces import IDistributionSet |
157 | - |
158 | - >>> kubuntu = getUtility(IDistributionSet).getByName("kubuntu") |
159 | - >>> kubuntu.getMostCommonBugs(current_user) |
160 | - [] |
161 | |
162 | === modified file 'lib/lp/bugs/interfaces/bugtarget.py' |
163 | --- lib/lp/bugs/interfaces/bugtarget.py 2009-07-17 00:26:05 +0000 |
164 | +++ lib/lp/bugs/interfaces/bugtarget.py 2009-08-18 11:12:06 +0000 |
165 | @@ -244,13 +244,6 @@ |
166 | required=False, |
167 | max_length=50000)) |
168 | |
169 | - def getMostCommonBugs(user, limit=10): |
170 | - """Return the list of most commonly-reported bugs. |
171 | - |
172 | - This is the list of bugs that have the most dupes, ordered from |
173 | - most to least duped. |
174 | - """ |
175 | - |
176 | def createBug(bug_params): |
177 | """Create a new bug on this target. |
178 | |
179 | |
180 | === modified file 'lib/lp/bugs/model/bugtarget.py' |
181 | --- lib/lp/bugs/model/bugtarget.py 2009-07-17 00:26:05 +0000 |
182 | +++ lib/lp/bugs/model/bugtarget.py 2009-08-18 11:14:07 +0000 |
183 | @@ -162,7 +162,6 @@ |
184 | statuses = BugTaskStatus.items |
185 | statuses = list(statuses) |
186 | |
187 | - from_tables = ['BugTask', 'Bug'] |
188 | count_column = """ |
189 | COUNT (CASE WHEN BugTask.status = %s |
190 | THEN BugTask.id ELSE NULL END)""" |
191 | @@ -190,37 +189,6 @@ |
192 | |
193 | All IBugTargets should inherit from this class. |
194 | """ |
195 | - def getMostCommonBugs(self, user, limit=10): |
196 | - """See canonical.launchpad.interfaces.IBugTarget.""" |
197 | - constraints = [] |
198 | - bug_privacy_clause = get_bug_privacy_filter(user) |
199 | - if bug_privacy_clause: |
200 | - constraints.append(bug_privacy_clause) |
201 | - constraints.append(self._getBugTaskContextWhereClause()) |
202 | - c = cursor() |
203 | - c.execute(""" |
204 | - SELECT duplicateof, COUNT(duplicateof) |
205 | - FROM Bug |
206 | - WHERE duplicateof IN ( |
207 | - SELECT DISTINCT(Bug.id) |
208 | - FROM Bug, BugTask |
209 | - WHERE BugTask.bug = Bug.id AND |
210 | - %s) |
211 | - GROUP BY duplicateof |
212 | - ORDER BY COUNT(duplicateof) DESC |
213 | - LIMIT %d |
214 | - """ % ("AND\n".join(constraints), limit)) |
215 | - |
216 | - common_bug_ids = [ |
217 | - str(bug_id) for (bug_id, dupe_count) in c.fetchall()] |
218 | - |
219 | - if not common_bug_ids: |
220 | - return [] |
221 | - # import this database class here, in order to avoid |
222 | - # circular dependencies. |
223 | - from lp.bugs.model.bug import Bug |
224 | - return list( |
225 | - Bug.select("Bug.id IN (%s)" % ", ".join(common_bug_ids))) |
226 | |
227 | |
228 | class OfficialBugTagTargetMixin: |
229 | |
230 | === modified file 'lib/lp/bugs/stories/guided-filebug/xx-displaying-similar-bugs.txt' |
231 | --- lib/lp/bugs/stories/guided-filebug/xx-displaying-similar-bugs.txt 2009-07-31 17:30:34 +0000 |
232 | +++ lib/lp/bugs/stories/guided-filebug/xx-displaying-similar-bugs.txt 2009-08-18 11:04:38 +0000 |
233 | @@ -28,8 +28,6 @@ |
234 | the summary entered (assuming some are found). |
235 | |
236 | >>> user_browser.open("http://bugs.launchpad.dev/firefox/+filebug") |
237 | - >>> print find_tag_by_id(user_browser.contents, 'frequent-bugs') |
238 | - <h2 id="frequent-bugs">Most frequently reported bugs</h2> |
239 | >>> user_browser.getControl("Summary").value = 'a' |
240 | >>> user_browser.getControl("Continue").click() |
241 | |
242 | |
243 | === modified file 'lib/lp/bugs/stories/guided-filebug/xx-distro-guided-filebug.txt' |
244 | --- lib/lp/bugs/stories/guided-filebug/xx-distro-guided-filebug.txt 2009-07-15 13:22:29 +0000 |
245 | +++ lib/lp/bugs/stories/guided-filebug/xx-distro-guided-filebug.txt 2009-08-18 11:04:38 +0000 |
246 | @@ -5,14 +5,6 @@ |
247 | |
248 | >>> user_browser.open("http://launchpad.dev/ubuntu/+filebug") |
249 | |
250 | -There are no duplicate bugs reported in Ubuntu so the most common bugs |
251 | -table is not shown. |
252 | - |
253 | - >>> most_common_bugs_table = find_tag_by_id( |
254 | - ... user_browser.contents, "most-common-bugs") |
255 | - >>> print most_common_bugs_table |
256 | - None |
257 | - |
258 | Submitting a bug title... |
259 | |
260 | >>> user_browser.getControl("Summary").value = ( |
261 | |
262 | === modified file 'lib/lp/bugs/stories/guided-filebug/xx-distro-sourcepackage-guided-filebug.txt' |
263 | --- lib/lp/bugs/stories/guided-filebug/xx-distro-sourcepackage-guided-filebug.txt 2009-06-12 16:36:02 +0000 |
264 | +++ lib/lp/bugs/stories/guided-filebug/xx-distro-sourcepackage-guided-filebug.txt 2009-08-18 11:04:38 +0000 |
265 | @@ -22,13 +22,6 @@ |
266 | <... |
267 | No similar bug reports were found... |
268 | |
269 | -And no duplicated bugs in this package. |
270 | - |
271 | - >>> most_common_bugs_table = find_tag_by_id( |
272 | - ... user_browser.contents, "most-common-bugs") |
273 | - >>> most_common_bugs_table is None |
274 | - True |
275 | - |
276 | The filebug form looks similar to the normal distro form, but the |
277 | package name is prepopulated. |
278 | |
279 | |
280 | === modified file 'lib/lp/bugs/stories/guided-filebug/xx-product-guided-filebug.txt' |
281 | --- lib/lp/bugs/stories/guided-filebug/xx-product-guided-filebug.txt 2009-07-15 13:22:29 +0000 |
282 | +++ lib/lp/bugs/stories/guided-filebug/xx-product-guided-filebug.txt 2009-08-18 11:04:38 +0000 |
283 | @@ -7,14 +7,6 @@ |
284 | >>> user_browser.open("http://bugs.launchpad.dev/firefox") |
285 | >>> user_browser.getLink('Report a bug').click() |
286 | |
287 | -On this page and the user is shown a table of the most common bugs in |
288 | -the current context. |
289 | - |
290 | - >>> from lp.bugs.tests.bug import print_bugs_table |
291 | - |
292 | - >>> print_bugs_table(user_browser.contents, "most-common-bugs") |
293 | - 5 Firefox install instructions should be complete |
294 | - |
295 | If no title is entered, the user is asked to supply one. |
296 | |
297 | >>> user_browser.getControl('Summary').value |
298 | |
299 | === modified file 'lib/lp/bugs/templates/bugtarget-filebug-search.pt' |
300 | --- lib/lp/bugs/templates/bugtarget-filebug-search.pt 2009-07-31 17:30:34 +0000 |
301 | +++ lib/lp/bugs/templates/bugtarget-filebug-search.pt 2009-08-18 11:04:38 +0000 |
302 | @@ -1,90 +1,60 @@ |
303 | -<html |
304 | +<filebug-search |
305 | xmlns="http://www.w3.org/1999/xhtml" |
306 | xmlns:tal="http://xml.zope.org/namespaces/tal" |
307 | xmlns:metal="http://xml.zope.org/namespaces/metal" |
308 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
309 | - xml:lang="en" |
310 | - lang="en" |
311 | - dir="ltr" |
312 | - metal:use-macro="view/macro:page/onecolumn" |
313 | -> |
314 | -<body> |
315 | - |
316 | -<metal:leftportlets fill-slot="portlets_one"> |
317 | - <div tal:replace="structure context/@@+portlet-latestbugs|nothing" /> |
318 | -</metal:leftportlets> |
319 | - |
320 | -<div metal:fill-slot="main"> |
321 | - |
322 | - <div tal:condition="view/isPrivate" id="privacy" class="aside private" |
323 | - >This report will be private, though you can disclose it later.</div> |
324 | - <h1>Report a bug</h1> |
325 | - |
326 | -<metal:not_uses_malone |
327 | - use-macro="context/@@+filebug-macros/not_uses_malone" /> |
328 | - |
329 | -<tal:uses_malone tal:condition="view/contextUsesMalone"> |
330 | - <div metal:use-macro="context/@@launchpad_form/form"> |
331 | - <table class="form" metal:fill-slot="widgets"> |
332 | - |
333 | - <tal:product_widget |
334 | - tal:define="widget nocall:view/widgets/product|nothing" |
335 | - tal:condition="widget"> |
336 | - <metal:widget metal:use-macro="context/@@launchpad_form/widget_row" /> |
337 | - </tal:product_widget> |
338 | - |
339 | - <tal:bugtarget |
340 | - tal:define="widget nocall:view/widgets/bugtarget|nothing" |
341 | - tal:condition="widget"> |
342 | - <metal:widget metal:use-macro="context/@@launchpad_form/widget_row" /> |
343 | - </tal:bugtarget> |
344 | - |
345 | - <tal:hidden_tags tal:replace="structure view/widgets/tags/hidden" /> |
346 | - |
347 | - <tr> |
348 | - <td colspan="2"> |
349 | - <p> |
350 | - Please describe the bug in a few words, for example, "weather |
351 | - applet crashes on logout": |
352 | - </p> |
353 | - </td> |
354 | - </tr> |
355 | - <tal:title_widget tal:define="widget nocall:view/widgets/title"> |
356 | - <metal:widget use-macro="context/@@launchpad_form/widget_row" /> |
357 | - </tal:title_widget> |
358 | - </table> |
359 | - |
360 | - <div class="actions" metal:fill-slot="buttons"> |
361 | - <input tal:replace="structure view/actions/field.actions.search/render" /> |
362 | - </div> |
363 | - </div> |
364 | - |
365 | - <tal:most-common-bugs condition="view/most_common_bugs"> |
366 | - <h2 id="frequent-bugs">Most frequently reported bugs</h2> |
367 | - |
368 | - <table class="listing" id="most-common-bugs"> |
369 | - <thead> |
370 | - <tr><th colspan="2">Summary</th></tr> |
371 | - </thead> |
372 | - <tbody> |
373 | - <tr tal:repeat="bug view/most_common_bugs" |
374 | - tal:attributes="title bug/description/fmt:shorten/150" |
375 | - title="bug description goes here"> |
376 | - <td class="amount" tal:content="bug/id" width="10%">1</td> |
377 | - <td> |
378 | - <a href="#" |
379 | - tal:content="bug/title" |
380 | - tal:attributes="href bug/fmt:url"> |
381 | - Firefox doesn't work |
382 | - </a> |
383 | - </td> |
384 | - </tr> |
385 | - </tbody> |
386 | - </table> |
387 | - </tal:most-common-bugs> |
388 | -</tal:uses_malone> |
389 | - |
390 | - |
391 | - </div> |
392 | - </body> |
393 | -</html> |
394 | + metal:use-macro="view/macro:page/main_only"> |
395 | + |
396 | + <div metal:fill-slot="heading"> |
397 | + <div tal:condition="view/isPrivate" id="privacy" class="aside private"> |
398 | + This report will be private, though you can disclose it later. |
399 | + </div> |
400 | + <h1>Report a bug</h1> |
401 | + </div> |
402 | + |
403 | + <div metal:fill-slot="main"> |
404 | + <div class="yui-g"> |
405 | + |
406 | + <tal:does-not-use-malone condition="not: view/contextUsesMalone"> |
407 | + <div class="top-portlet"> |
408 | + <metal:not_uses_malone |
409 | + use-macro="context/@@+filebug-macros/not_uses_malone" /> |
410 | + </div> |
411 | + </tal:does-not-use-malone> |
412 | + |
413 | + <tal:uses-malone tal:condition="view/contextUsesMalone"> |
414 | + <div class="top-portlet"> |
415 | + <div metal:use-macro="context/@@launchpad_form/form"> |
416 | + <table class="form" metal:fill-slot="widgets"> |
417 | + <tal:product_widget |
418 | + tal:define="widget nocall:view/widgets/product|nothing" |
419 | + tal:condition="widget"> |
420 | + <metal:widget metal:use-macro="context/@@launchpad_form/widget_row" /> |
421 | + </tal:product_widget> |
422 | + <tal:bugtarget |
423 | + tal:define="widget nocall:view/widgets/bugtarget|nothing" |
424 | + tal:condition="widget"> |
425 | + <metal:widget metal:use-macro="context/@@launchpad_form/widget_row" /> |
426 | + </tal:bugtarget> |
427 | + <tal:hidden_tags tal:replace="structure view/widgets/tags/hidden" /> |
428 | + <tr> |
429 | + <td colspan="2"> |
430 | + Please describe the bug in a few words, for example, |
431 | + "weather applet crashes on logout": |
432 | + </td> |
433 | + </tr> |
434 | + <tal:title_widget tal:define="widget nocall:view/widgets/title"> |
435 | + <metal:widget use-macro="context/@@launchpad_form/widget_row" /> |
436 | + </tal:title_widget> |
437 | + </table> |
438 | + <div class="actions" metal:fill-slot="buttons"> |
439 | + <input tal:replace="structure view/actions/field.actions.search/render" /> |
440 | + </div> |
441 | + </div> |
442 | + </div> |
443 | + </tal:uses-malone> |
444 | + |
445 | + </div> |
446 | + </div> |
447 | + |
448 | +</filebug-search> |
449 | |
450 | === modified file 'lib/lp/bugs/tests/bug.py' |
451 | --- lib/lp/bugs/tests/bug.py 2009-06-25 00:40:31 +0000 |
452 | +++ lib/lp/bugs/tests/bug.py 2009-08-18 11:04:38 +0000 |
453 | @@ -90,21 +90,6 @@ |
454 | print target, extract_text(span.findNext('a')) |
455 | |
456 | |
457 | -def print_bugs_table(content, table_id): |
458 | - """Print the bugs table with the given ID. |
459 | - |
460 | - The table is assumed to consist of rows of bugs whose first column |
461 | - is a bug ID, and whose second column is a bug title. |
462 | - """ |
463 | - bugs_table = find_tag_by_id(content, table_id) |
464 | - |
465 | - for tr in bugs_table("tr"): |
466 | - if not tr.td: |
467 | - continue |
468 | - bug_id, bug_title = tr("td", limit=2) |
469 | - print bug_id.string, bug_title.a.string |
470 | - |
471 | - |
472 | def print_bugs_list(content, list_id): |
473 | """Print the bugs list with the given ID. |
474 | |
475 | |
476 | === modified file 'lib/lp/registry/configure.zcml' |
477 | --- lib/lp/registry/configure.zcml 2009-08-12 05:09:36 +0000 |
478 | +++ lib/lp/registry/configure.zcml 2009-08-18 11:12:06 +0000 |
479 | @@ -387,7 +387,6 @@ |
480 | getUsedBugTagsWithOpenCounts |
481 | bugtargetdisplayname |
482 | bugtargetname |
483 | - getMostCommonBugs |
484 | getBugCounts |
485 | bug_subscriptions |
486 | getSubscriptions |
This converts the +filebug search page to the 3.0 layout, using the
main_only layout. This included removing the "Most frequently reported
bugs" area, which, after discussion with noodles, wgrant and beuno, is
basically not very useful, especially in comparison with the more
accurate, detailed and useful duplicate listing shown on the following
page.
Test: ./bin/test -vvt filebug
Lint free.
lib/lp/ bugs/browser/ bugtarget. py
Removed the most_common_bugs and found_possible_ duplicates duplicates was
properties. The first, most_common_bugs, was only used by the "Most
frequently reported bugs" area, and found_possible_
already unused.
Also, I removed a little lint.
lib/lp/ bugs/doc/ minimizing- duplicate- bug-reports. txt
I also removed the IBugTarget. getMostCommonBu gs() method because, Bugs(), so I removed it too.
list the most_common_bugs property above, was only used for the
+filebug search page. This test was entirely about
getMostCommon
lib/lp/ bugs/interfaces /bugtarget. py bugs/model/ bugtarget. py
lib/lp/
getMostCommon Bugs() removed.
lib/lp/ bugs/stories/ guided- filebug/ xx-displaying- similar- bugs.txt bugs/stories/ guided- filebug/ xx-distro- guided- filebug. txt bugs/stories/ guided- filebug/ xx-distro- sourcepackage- guided- filebug. txt bugs/stories/ guided- filebug/ xx-product- guided- filebug. txt
lib/lp/
lib/lp/
lib/lp/
"Most frequently reported bugs" area removed, so tests for it
removed too.
lib/lp/ bugs/templates/ bugtarget- filebug- search. pt
Template converted. The only interesting thing here was the extra
condition around the not_uses_malone macro call. The not_uses_malone
macro already checks the same condition, but I think that the
condition should be checked in the calling template instead. Once
the other templates that use the not_uses_malone macro have been
converted to follow this style, the condition in the macro will be
removed.
lib/lp/ bugs/tests/ bug.py
The print_bugs_table() helper was only used in one place. That place
has now gone, so the helper goes too.
lib/lp/ registry/ configure. zcml
Remove getMostCommonBugs.