Opened 19 years ago

Closed 19 years ago

Last modified 17 years ago

#771 closed bug (fixed)

query feature doesn't use multi-level components

Reported by: wkornewald Owned by: johndrinkwater
Priority: normal Milestone: Website R1
Component: Website/Trac Version:
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description (last modified by wkornewald)

Go to "View Tickets"/"Custom Query" and add a query for "Component". It shows the raw list ("desktop/tracker", etc.) instead of a multi-level select.

Change History (29)

comment:1 by johndrinkwater, 19 years ago

Looking into it :)

comment:2 by admin, 19 years ago

Owner: set to johndrinkwater

comment:3 by admin, 19 years ago

Hmm, your second point needs to be assigned to tic/charlie. Py isn't my thing, just yet.

comment:4 by wkornewald, 19 years ago

Okay, I'll file a second bug for it.

comment:5 by wkornewald, 19 years ago

Description: modified (diff)
Summary: query feature and Milestone view don't use multi-level componentsquery feature doesn't use multi-level components

comment:6 by wkornewald, 19 years ago

Second bug is #4.

comment:7 by johndrinkwater, 19 years ago

Fixed, afaik ( read comment at the end of #2 )

comment:8 by wkornewald, 19 years ago

Cool. Now, there is just one single other "bug":

When selecting some component all subcomponents should be queried, too. I.e.: search for "apps" and you also get the results for "apps/mediaplayer", etc.

comment:9 by johndrinkwater, 19 years ago

Owner: changed from johndrinkwater to admin
Status: newassigned

atm we can't give the user access to select "apps" because of that change you requested (the one to remove entries, and to automatically expand the first entry). I'm happy to revert that for queries.

You just want the behaviour on the query view ? Hmm, the query page only has is | is not for the component field, do we need add 'contains', or should the backend be the only thing adjusted?

The completed script will be sending "apps" or "drivers/graphics" as part components, the rest is down to the backend then (compo/nent% should cover both parent and subchildren)

comment:10 by johndrinkwater, 19 years ago

Following on from your request/suggestion, I've made a new version (always at the same URL - http://ezri.nextraweb.com/examples/js/haiku/ )

For the normal Ticket page, you can only select valid leafs. For the query page, you can select super/sub or super/ depending on what you are looking for.

Todo: edit modes in query.js to allow 'contains', need to refer to the python guys for that though.

(sidenote, Konq doesn't half behave weirdly.. ) Opera, Mozilla, and Konq are good for it. Please test, ty.

comment:11 by admin, 19 years ago

Component: appsweb/trac
Milestone: Website R1

comment:12 by admin, 19 years ago

We don't need "contains", but "starts with". But the end-user should still only see "is" and "is not". The query for "is" would become:

component == "apps"
component <starts-with> "apps/"

(once with "/", once without). Otherwise we could search for "apps" and also find "apps-tests/playground" (just an example).

comment:13 by johndrinkwater, 19 years ago

Component: web/tracapps

Just testing out the repaired script, excuse the component change

comment:14 by johndrinkwater, 19 years ago

Component: appsweb/trac

good, s'working (displays "apps" with another option with ""+"mediaplayer")

comment:15 by wkornewald, 19 years ago

Owner: changed from admin to johndrinkwater
Status: assignednew

comment:16 by johndrinkwater, 19 years ago

What's the news in relation to query.js being updated?

comment:17 by wkornewald, 19 years ago

It doesn't get updated. Maybe it's getting loaded from some other location than we expect, but even Mikael didn't know and there are not a lot of places...

comment:18 by johndrinkwater, 19 years ago

Was asked if there was anyway to not edit query.js:

Trac sends a list of query options in javascript in the /query page; I'd love to add the hook here so that our method is called, but there isn't provision for adding this without adjusting query anyhow. Could use javascript from our file to hook into the add filter dropdown, but we can't be certain we don't get call before their method (ie, we'd be called before the element was added), and we wouldn't have a handle on the obj anyhow.

I look into another way, if possible :)

comment:19 by wkornewald, 19 years ago

I think that we need a clean solution if we modify query.js. I'd like everything to be committed to the official repos, so we have less patches to maintain.

comment:20 by wkornewald, 19 years ago

Okay, I've adjusted query.js, but there are two new bugs:

  • "&amp;" is not converted to "&" (and probably other chars, too)
  • after having selected a component and clicking Update it switches back to a flat (!) component list, but correctly converts "&amp;" to "&"

comment:21 by johndrinkwater, 19 years ago

Status: newassigned
  • "&amp;" is not converted to "&" (and probably other chars, too)

TBH, Trac is doing the wrong thing here, escaping & inside Javascript strings is bad, as it has potentional to break certain browsers; Would be better to CDATA the <script> sections... anyhow, because we can't have a clean + simple &entity to character conversion, I think adding just &amp; will be enough for now. It should also fix the POST problem (ie, query doesnt listen to selected component)

  • after having selected a component and clicking Update it switches back to a flat (!) component list, but correctly converts "&amp;" to "&"

This is due to it now outputting the option as HTML, rather than from the JS. A reason why the &amp; is being parsed by the browser rather than JS.. just needs more hook work, i'll do it tomorrow lunchtime.

comment:22 by johndrinkwater, 19 years ago

Following on from #20, is there much point continuing with this js ?

comment:23 by wkornewald, 19 years ago

Yes, I'd like to keep it. The admin interface will have to be adapted, instead.

comment:24 by johndrinkwater, 19 years ago

OK, newer version should include fixes to previous problems; the file has gained in size a little, but I think thats ok for testing sake. I can compact it when we have the final working copying. You need only update componentselect.js, query.js shouldn't need another edit. And I am still looking into another way to attach ourselves rather than edit query. Just been busy :)

  • I've removed a method that Trac already had (addEvent), so we must make certain this script is included after trac.js
  • ampersandmp; "bug" is fixed, but i'd prefer to get it fixed with Trac instead; If you didn't notice, even without my script Trac breaks ampersands
  • On another note, Konq 3.5.1 hates ampersand in option entries. Unescaped it underlines text like a menu shortcut, and escaped it stays escaped :)

comment:25 by wkornewald, 19 years ago

Okay, let's better solve this by using "+" instead of "&". If it's even incompatible with Konqueror and makes so many problems I prefer a clean solution. Maybe we will not even have these "A & B" entries. Could you please remove the "hack" for fixing "&amp;"? If it will be fixed it should be in Trac.

comment:26 by johndrinkwater, 19 years ago

Platform: All

Right, that's the &amp; hack removed. I've also removed the need to edit query.js, so if you can revert query.js to repo quality, and fetch my new componentselect.js that should be enough.

comment:27 by johndrinkwater, 19 years ago

Resolution: fixed
Status: assignedclosed

<.<

.>

I think it's OK now. Anymore problems to new bugs thanks.

comment:28 by wkornewald, 19 years ago

Yep. Good job!

Note: See TracTickets for help on using tickets.