Project

General

Profile

Actions

Bug #5620

closed

[Workbench] Collection#show page search filter is neither cleared nor applied when back button is used in Chrome.

Added by Radhika Chippada about 9 years ago. Updated about 9 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Radhika Chippada
Category:
Workbench
Target version:
Story points:
-

Description

  • Type “md5sum” in the search box. You will see two files. Select them and click on Selection -> create new collection…
  • Once you are in the new collection page, hit back button
  • You will now see all three files (all the files in this collection); however, the search box still has the text “md5sum” in it and the two md5sum files are selected. That is, the collection page is reloaded, but the browser is caching user inputs.

What needs to be done:

  1. It would be nice if we can apply the search filter when the user hits the back button
  2. Alternatively, we should clear the search box text as well as the check box selections (if #1 is not acceptable). To clear user inputs add autocomplete="off" to the search box and checkboxes.

Subtasks 1 (0 open1 closed)

Task #5771: Review branch: 5620-collection-selectionsResolvedRadhika Chippada04/17/2015Actions
Actions #1

Updated by Radhika Chippada about 9 years ago

  • Description updated (diff)
  • Category set to Workbench
Actions #2

Updated by Tom Clegg about 9 years ago

Suggestions
  • Perhaps the browser sends an event when it puts stuff in the input, like "input" or "change" or "autocomplete" -- in this case we just need to add this to the list of events that we listen for in our input→filters code.
  • If not, perhaps $(document).ready(function(){$('input').trigger('input');}); will do it.
Actions #3

Updated by Radhika Chippada about 9 years ago

Implementation notes:

Added ready handler for input. To test, use Chrome (and probably Safari) to view a collection page and enter text in search box. Select one or two files from the results and combine to transition into the new collection page. Hit back button and you will see the search filter applied (provided your browser retained those search filters). Firefox does not retain user inputs (at least on my machine).

The application_helper file update is unrelated. As I was reading through the code, I learned that I can pass Collection as resource_class, rather than getting it from uuid. Since in this context, dataclass can be either Collection or File, I was not passing it and letting the object_readable method to get from uuid. Now that I learned that I can pass it instead, passing to avoid this unnecessary step.

Actions #4

Updated by Radhika Chippada about 9 years ago

  • Status changed from New to In Progress
  • Assigned To set to Radhika Chippada
  • Target version changed from Bug Triage to 2015-04-29 sprint
Actions #5

Updated by Tom Clegg about 9 years ago

1.5 comments at 4ccec6c:

Glad $('input').trigger('input'); works, but I think it should get a comment. (I know what it's for right now, but in 10 minutes it might look totally superfluous/mysterious, and no tests will fail if someone removes it...) Perhaps:
  • This is needed to trigger input validation/synchronization callbacks because some browsers auto-fill form fields (e.g., when navigating "back" to a page where some text had been entered in a search box) without triggering a change or input event.

In case you're looking for bikeshed ideas, for this:

is_readable_input = object_readable attrvalue, Collection unless attrvalue.andand.empty?

How about:

is_readable_input = attrvalue.present? and object_readable attrvalue, Collection
Actions #6

Updated by Radhika Chippada about 9 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100

Applied in changeset arvados|commit:1fe347f8cf77564a791b9f98963fc73ee6802c4f.

Actions

Also available in: Atom PDF