Esri/crowdsource-manager

Filter with range should be able applied only after both min and max value is entered

skrishn opened this issue · 11 comments

Please see the production app below

  1. Click on Filter icon
  2. Enter a value in the first textbox and hit enter. Notice it applies the filter and we dont get to change the value in the second textbox.
  3. In order to change the second value we have to click on the filter icon.

Enhancement

When a Range filter is set, user should be able to enter both min and max values and then filter should be applied.

filterRange

https://arcgis4localgov2.maps.arcgis.com/apps/CrowdsourceManager/index.html?appid=106b1b968ffb4596b5ad74d6f86bf72d

Originally posted by @skrishn in #293 (comment)

@skrishn @aparveen

As per our discussion on yesterday's call,

  • We decided that, the range filter will only be applied when user leaves/focus out from second number box.

This will lead to following cases :

  1. User enters value in First number box and then enters value in Second number box. The filter will be applied once user leaves second number box and the filter window will close.

  2. User directly enters value in Second number box :

    • First number box is EMPTY, once user leaves second number box then the filter will not be applied and window remains open.
    • First number box has valid value, once user leaves second number box then the filter will be applied and window will be closed.
  3. User only enters value in First number box :

    • Second number box is EMPTY, once user leaves first number box then the filter will not be applied and window remains open.
    • Second number box has valid value, once user leaves first number box then the filter will still not be applied and window remains open. In order to filter to be applied, user will have to navigate through Second number box.
      • As per this workflow, we think that user will not get any clue, why the filter is not getting applied even when both the text boxes has valid values. (This is change in behavior for existing users)

Please let us know your thoughts.

@skrishn

As per our discussion on the last call,

  • We were on the same page for the above comment and hence we will go ahead and implement the discussed approach.

  • However, as per your suggestion here is our approach to show the warning message for empty values in case of range filter :

    • Here is the screenshot of how the warning message will be shown when at least one of the text box has empty value
    • This message will be shown only for range filters
    • Please let us know if you need any changes in the message and styling of a message and we can easily update the same

image

Please let us know your thoughts on this.

@chris-fox : Please let us know if you like this approach. Thanks.

This seems very confusing, can we just apply the changes when the pop-up window loses focus? This allows me to click in either box multiple times and I click off when I want it to apply?

@ashishchoure : This is the approach we would like to go with ..

Currently, non-range filter is applied when we hit Enter or click outside popup. With the proposed approach on range filter, user enters/edits value in first textbox > tab/enter > focus is on second textbox for user to enter a value/edit current value or do nothing and it gets applied when hit Enter/focus outside. This approach is similar to current behavior when both boxes are empty. And, if the value in either textbox is empty or invalid, app throws alert message ‘No feature found for this value’ as it is now and we don’t show any message within filter popup window. Please let me know if you've any questions.

@skrishn

  • As per your suggestion, we have made changes to the filter functionality.
  • Please have look at the filter functionality in this application link and let us know if we are on the same page.

The range filter is applied on "num" field as shown in the screenshot :
image

@ashishchoure : Thank you - i tested the functionality. It looks good but i noticed the following

  1. When min/max is invalid (i.e: min = 18; max = 12)
  • Hit Enter (on Second textbox)
    Throws alert message and table goes to state it was in before filter

  • Click outside
    Throws alert message and table goes to state it was before filter, but filter window is still visible. Please change the behavior similar to what happens on hitting Enter

  1. When min or max is empty
  • Hit Enter
    Nothing happens but filter window is visible

  • Click outside
    Nothing happens but filter window is closed

In this case (2), please display the alert message, table goes to previous state and dismiss the filter window.

@skrishn

We are going through your feedback and we will get back to you at the earliest.

@skrishn @aparveen @chris-fox

We went through your feedback and here are our comments.

  1. When min/max is invalid (i.e: min = 18; max = 12)
    Hit Enter (on Second textbox)
    Throws alert message and table goes to state it was in before filter
    Click outside
    Throws alert message and table goes to state it was before filter, but filter window is still visible. Please change the behavior similar to what happens on hitting Enter
  • We can easily implement this behavior.
  1. When min or max is empty
    Hit Enter
    Nothing happens but filter window is visible
    Click outside
    Nothing happens but filter window is closed
    In this case (2), please display the alert message, table goes to previous state and dismiss the filter window.
  • The range filter is applied only when both the text boxes have a valid value and if the applied filter returns no records then only we see an alert message.
  • Since this is as per the design, as discussed we will keep this behavior as it is.

Dev Checklist

Items ​ Is required​ Status Comments​
Required NLS change?​ No NA 
Required Backward compatibility​? No NA  
Required 508​? No NA  
Need Sanitize?​ No NA

Impact Analysis Report

Impacted Areas Comments
Have Configuration changes?​ No
Have Runtime changes?​ Yes
Impact on RTL No
Range Filter inside data table
  • The code change for this implementation will have an impact on range filter functionality.
  • The range filter will be applied once the user focuses out from the second text box or press enter on the second text box.
  • The range filter will only be applied when both min and max values are present.
Filter (Inside data table) The other column filters should work as is and should not be impacted by the range filter changes.

verified in qa. Testcase added