<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>7461</bug_id>
          
          <creation_ts>2015-03-16 13:46:46 +0000</creation_ts>
          <short_desc>Filters not working as designed</short_desc>
          <delta_ts>2015-03-31 12:39:48 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>Toaster</product>
          <component>toaster</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.8 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Belen Barros Pena">belen.barros.pena</reporter>
          <assigned_to name="David Reyna">david.reyna</assigned_to>
          <cc>alexandru.c.georgescu</cc>
    
    <cc>alexandru.damian</cc>
    
    <cc>belen.barros.pena</cc>
    
    <cc>bluelightning</cc>
    
    <cc>cristiana.voicu</cc>
    
    <cc>david.reyna</cc>
    
    <cc>jessica.zhang</cc>
          
          <qa_contact name="Mihail Stanciu">stanciux.mihail</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>49467</commentid>
    <comment_count>0</comment_count>
    <who name="Belen Barros Pena">belen.barros.pena</who>
    <bug_when>2015-03-16 13:46:46 +0000</bug_when>
    <thetext>The relationship between search and filters are like this:

The scope of the filters is the content currently on the table.

The scope of the search is always the full content of the database.

So:

- if I run a search query, any filter applied afterwards will filter the content returned by the search query.

- if I run a search query while a filter is applied, the filter is overridden by the results of the search query (i.e. we display the results of the search query and clear the filter applied beforehand).

Currently, the filter counters are not reflecting the above behaviour. 

If you apply a filter (for example, if you select the &quot;Successful builds&quot; option in the &quot;Outcome&quot; filters of the &quot;All builds&quot; page), the &quot;all&quot; option counter shows the number of records returned by the filter, instead of the total number of records in the database.

If you search, then apply a filter, the &quot;all&quot; option shows the number of records returned by the search (which is the correct behaviour), but the other options show the total number of records in the database (this is not the correct behaviour), instead of showing only the numbers applicable to the search results. 

I also appreciate how the heading of the filter is trying to tell you what the filter will be applied to, but the resulting string is a big to complicated. Something like &quot;Filter search results by &lt;column_heading&gt;&quot; might be easier to process.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49505</commentid>
    <comment_count>1</comment_count>
    <who name="David Reyna">david.reyna</who>
    <bug_when>2015-03-18 00:12:35 +0000</bug_when>
    <thetext>I also encountered this issue.

I observed that &apos;total_count&apos; always uses “queryset_with_search.count()”, but that is wrong since that query also include any filtering. The observed error is that the “all” count in the filter popup will show the current limited filtered/searched count and not the full count, and that just looks wrong.

I fixed it in the two all builds tables (via 6040, under review), but I have not touched the other view classes yet. Here is my fix:
                    

-               &apos;total_count&apos; : queryset_with_search.count(),
+               &apos;total_count&apos; : queryset_all.count(),</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49564</commentid>
    <comment_count>2</comment_count>
    <who name="Belen Barros Pena">belen.barros.pena</who>
    <bug_when>2015-03-19 12:10:21 +0000</bug_when>
    <thetext>I&apos;ve had a look at the filters behaviour and at the counter information. The funniest thing is that the filters are behaving as per the design specs. But the counters show the wrong information, and that totally throws you off. 

The easy way of solving the problem is removing the counters. Removing the counters from the filters also removes our mechanism to stop users from selecting filter options that return zero entries. We should have a state in place for that case (built as part of the empty states specification), but we need to make sure we test this case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49758</commentid>
    <comment_count>3</comment_count>
    <who name="David Reyna">david.reyna</who>
    <bug_when>2015-03-25 16:29:25 +0000</bug_when>
    <thetext>Belen&apos;s proposal was adopted.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49961</commentid>
    <comment_count>4</comment_count>
    <who name="Mihail Stanciu">stanciux.mihail</who>
    <bug_when>2015-03-31 12:39:48 +0000</bug_when>
    <thetext>Verified on master: 8b3d3e7c957ad06c390886487f69aeb8e145da6a</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>