+++ This bug was initially created as a clone of Bug #406181 +++ Description: On certain pages Ajax optimizations are used to speed up page loading time. Red Hat has a high number of components for certain products. The component lists cause a large amount of HTML having to be downloaded by the client browser. The Ajax functions allow the UI to only show the components needed depending on which products are selected. Function Requirements: When selecting products on query.cgi, the components, versions, milestones fields are automatically updated. Pretty much self contained on the backend in Bugzilla/Ajax.pm and ajax.cgi. A lot of javascript though in js/*.js and the templates themselves.
LOC Estimation: js/product_query.js: 86 templates: 139 selenium tests to verify proper operation of component/version/milestone filtering: 4 hours LOC Total: 225
Created attachment 301328 [details] Patch to optimize query.cgi using ajax to update component/version/milestone list Attaching a patch that optimizes the query.cgi page by filtering the component/version/target_milestone lists using ajax instead of loading the entire structure fresh with each page load. Note: 1. Added js/query.js and js/rpc-min.js to support the javascript call updateQuerySelects() that redraws the proper select forms when products are selected. 2. Using get_selection() and restoreSelection() in js/util.js provided by upstream. 3. Updated query.cgi to only load the component/version/target_milestones for selected products (if any are selected) which helps speed things up considerably. Before even if you only wanted to see RHEL products, it would still initially load all components from all products which included Fedora (5000+ components). I have installed this on bugdev.devel.redhat.com/bugzilla for testing. Please review Dave
Comment on attachment 301328 [details] Patch to optimize query.cgi using ajax to update component/version/milestone list query.cgi your code fell outside your REDHAT comment terminator
I jumped over to bugdev and took it for a test drive. First Page load of query.cgi?format=advanced No Classification, Product, Component, Version are selected however they are all filled with values. My expectation was that on the virgin load it would only have the Classification filled. If I clicked a classification then it would show the products for that classification. If I clicked a product then it would then fill the components and versions for that product. Until then they would be empty. If no classification is selected how does the UI determine what products to list? All products? Likewise if no product is selected what components are chosen? IMHO they should be empty and only the Classification box should have values. An empty list would indicate that you are not searching on that field and hence searching all. Am I making sense?
Created attachment 302696 [details] Patch to optimize query.cgi using ajax to update component/version/milestone list (v2) Kevin, I had different versions running today and you may have hit bugdev at a bad time. Attaching a new version of the query.cgi patch. Took a much different approach and tied in more closely with the upstream javascript instead of writing most new from scratch. This makes the patch much smaller. Also this is better in that any subsequent loads of the same product data will not get it again from the server and caches the data. Please review Dave
Comment on attachment 302696 [details] Patch to optimize query.cgi using ajax to update component/version/milestone list (v2) looks good to me Dave.
Checked in to CVS. Worked 8 hours. Created a new bug separately for query.cgi to be optimized to only load components/versions/milestones if certain classifications/products are already selected to cut down on HTML sent initially. https://bugzilla.redhat.com/show_bug.cgi?id=442939 Dave