Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-22485

Latest Data Selected Subfilters Do Not Reset After Filter Apply

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Won't Do
    • Icon: Trivial Trivial
    • None
    • 6.2.7, 6.4.0
    • None
    • None

      Steps to Reproduce:

      1. Go to Latest data page
      2. click on a subfilter
      3. In the 'Name' box search for a substring of anything
      4. Note that the subfilter does not reset. Was this the intent?

      Thinking about usability, I think it makes the most sense to reset the subfilter selections on a filter apply. Page reset correctly resets the filters. Browser refresh should preserve filters - this looks ok.

       

      It does look like you intended to reset the subfilters in the emptySubfilter() function, but something isn't quite right with EventListener. 

       

      The following seemed to do the trick and gives me the behavior I'd expect when clicking 'Apply':

       

      diff --git ui/js/class.tabfilter.js ui/js/class.tabfilter.js
      index 23113d4..017359d 100644
      --- ui/js/class.tabfilter.js
      +++ ui/js/class.tabfilter.js
      @@ -768,14 +768,7 @@ class CTabFilter extends CBaseComponent {
                      this._filters_footer.querySelector('[name="filter_new"]')
                              .addEventListener('click', this._events.buttonSaveAsAction);
                      this._filters_footer.querySelector('[name="filter_apply"]')
      -                       .addEventListener('click', () => {
      -                               if (this._active_item._index == 0) {
      -                                       this._events.buttonUpdateAction();
      -                               }
      -                               else {
      -                                       this._events.buttonApplyAction();
      -                               }
      -                       });
      +                       .addEventListener('click', this._events.buttonApplyAction);
                      this._filters_footer.querySelector('[name="filter_reset"]')
                              .addEventListener('click', this._events.buttonResetAction);
                      this._filters_footer.addEventListener('click', this._events.buttonActionNotify); 

       

            ksalins Karlis Salins
            GRyan337 Ryan Eberly
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: