Story #3235

[Workbench] Site-wide search from top nav

Added by Tom Clegg almost 6 years ago. Updated almost 6 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
Workbench
Target version:
Start date:
07/16/2014
Due date:
% Done:

100%

Estimated time:
(Total: 31.00 h)
Story points:
3.0

Description

For this sprint, focus on functionality inside the search box rather than achieving the best UI behavior.

  • Search button in top nav brings up a modal.
  • Typing in the search query text box and hitting Enter (or clicking the Search button) updates search results.
  • Search for (in order): projects, collections, pipeline templates, pipeline instances, jobs.
  • Row of checkboxes just below query text box determines which object types are shown in results.
  • Click to highlight a row/result.
  • Type "Escape" or click "close" button to dismiss the modal.
  • Click "Open" button (at bottom of modal) to open the selected result.

This should be implemented with a generic calling mechanism just like the existing chooser -- perhaps it can be an extension of the existing chooser, using a SearchController and a query parameter (models[]?) that determines which model types should be shown/searched.

When it has enough capabilities, we'll use it to replace the chooser modal entirely. For example, when choosing a collection, the chooser will support "type a project name, click to expand the project, and select a collection from that project" instead of the existing "choose a project from the drop-down list, then type to search collections in that project".

Important requirement:
  • If an object is not in any project (e.g., arv-put with no --project), it should show up in search.
  • If the user provides an exact UUID of an object or collection, one of the following happens:
    1. The object or collection shows up at the top of the list
    2. the user is taken directly to that object or collection
Defer for next phase:
  • Ensure control-click "Open" button opens in a new window. Making it a link rather than a button/input element should be enough to get this with default browser behavior.
  • Click a caret to expand a project in the results pane and show contents of the project.

Subtasks

Task #3294: Top nav "search" button opens a collection chooserResolvedTom Clegg

Task #3305: Turn off "projects" drop-down in chooser unless requested by callerResolvedTom Clegg

Task #3295: Make a chooser modal that shows multiple typesResolvedTom Clegg

Task #3376: Test/fix infinite scrollResolvedTom Clegg

Task #3377: Hide object type separators when no objects of that type are displayedResolvedTom Clegg

Task #3389: Fix up "filter by project" dropdownResolvedTom Clegg

Task #3396: Show only projects, not groups (and fix section heading)ResolvedTom Clegg

Task #3395: Show selected project in project-filter dropdown titleResolvedTom Clegg

Task #3390: Bring up search dialog by pasting uuid into top navResolvedTom Clegg

Task #3399: Special case for pasting UUIDResolvedTom Clegg

Task #3398: Trigger search update on keyup paste changeResolvedTom Clegg

Task #3420: Search modal bugsResolvedTom Clegg

Task #3447: Individual files in search preview should not be clickable: you can't do anything with them after selecting.ResolvedTom Clegg

Task #3267: Review 3235ResolvedRadhika Chippada

Task #3306: Replace preview pane with an "expand/collapse" button that shows details (e.g., collection contents) inline with the list of itemsClosedTom Clegg

Associated revisions

Revision 29e5eb86
Added by Tom Clegg almost 6 years ago

Merge branch '3235-all-contents' refs #3235

Revision 259fb182 (diff)
Added by Tom Clegg almost 6 years ago

Do not return non-project groups in groups#contents. refs #3235

Revision 2db098fb (diff)
Added by Tom Clegg almost 6 years ago

Fix TypeError: Got an unexpected keyword argument "uuid". refs #3235

Revision fd372f14
Added by Tom Clegg almost 6 years ago

Merge branch '3235-top-nav-site-search' refs #3235

Revision aa35b924 (diff)
Added by Tom Clegg almost 6 years ago

3235: Fix attribute keys. refs #3235

Revision 09e3c710
Added by Tom Clegg almost 6 years ago

Merge branch '3235-top-nav-site-search' refs #3235

History

#1 Updated by Tom Clegg almost 6 years ago

  • Description updated (diff)
  • Category set to Workbench

#2 Updated by Tom Clegg almost 6 years ago

  • Description updated (diff)

#3 Updated by Tom Clegg almost 6 years ago

  • Description updated (diff)

#4 Updated by Tom Clegg almost 6 years ago

  • Description updated (diff)

#5 Updated by Peter Amstutz almost 6 years ago

  • Description updated (diff)

#6 Updated by Tom Clegg almost 6 years ago

  • Assigned To set to Tom Clegg

#7 Updated by Tom Clegg almost 6 years ago

  • Status changed from New to In Progress

#11 Updated by Tom Clegg almost 6 years ago

Looking for some feedback at 9591cf9:
  • Search button in top nav → modal
  • Click "Open" to show the selected item
  • Infinite scroll works
  • Can filter by project
Known shortcomings:
  • Preview pane is still on the right side. Perhaps this branch doesn't need to block on that?
  • "Filter by project" dropdown doesn't indicate which project is currently selected.
  • Can't filter by object type. (Should this be a drop-down with checkboxes, rather than a row of checkboxes? It seems like filter-by-type and filter-by-project should behave/look similar.)
  • Search button doesn't look very buttony, and it's a bit surprising that it brings up a dialog. (Should it be a fake search box instead? That would still be surprising, but at least it would be more inviting.)
  • No test cases for new behavior.
Tangential fixes/improvements included in branch:
  • Esc closes all modals
  • Search box (if any) gets focus when modal appears
  • Filter-by-project dropdown looks like a filter instead of a breadcrumbs bar
  • Filter-by-project works with infinite scroll
  • Handle AJAX failure in infinite scroll (it used to retry immediately, and show lots of spinners)
  • Multiple-select was a mess - now the "selectable" container says whether multiple-select is allowed, so the partials and ajax calls aren't cluttered with code to propagate the multiple flag.

#12 Updated by Tom Clegg almost 6 years ago

Branch now at 4aae929, with:
  • Preview pane still present
  • "Filter by project" dropdown says what the current project is, or "All projects" if showing all projects.
  • Still can't filter by object type.
  • Search button in top nav is now a normal search input. You can paste/type text into it and hit Enter or click the search button. If you gave a UUID, you get the right "show object" page. Otherwise, you get the search modal (with the stuff you typed in the top nav copied into the modal's own search input).
  • Still no test cases.

#13 Updated by Radhika Chippada almost 6 years ago

Review feedback:

1. I cannot see my favorite project. Seems like scrolling issue in my browser. It does show up in the project drop down. However, one bigger concern. If the search filtering is applied to what is already loaded into the dialog, is this not going to be a problem in any case? Because, we are searching in what is already preloaded and since infinite scrolling is not going to kick in, the string I entered is not found. I don't think it is desirable to expect the user to scroll until the object is loaded.

2. Preloaded search string is not applied. It is populated into the search dialog but I have to hit enter to make the search filtering to happen.

3. Collections are not showing up when i select a project. It has collections. They do not show up in master also. If no project is selected, they do show up.

I think it is ok to merge after issues (2) and (3) are addressed.

#14 Updated by Tom Clegg almost 6 years ago

Ready for another look at 9872124

  • I suspect your favorite project has group_class="folder". I've fixed the search code so it accepts both folder and project (like many other places in the code), although we really should get rid of all these. I also enabled the migration I wrote for that a long time ago -- so if you update to this version and run db:migrate the bug should be doubly fixed.
  • Preloaded search string gets applied now. (I had changed an event name on the receiving end but not on the sending end.)
  • Collections now show up.

Also:

  • Search applies to UUIDs even if the name is what gets displayed in the row: If you paste a collection (or any other) UUID, eventually the relevant object should appear in the search results.

#15 Updated by Radhika Chippada almost 6 years ago

Reviewed the latest. Everything works as expected.
- My favorite project (folder) is now available :)
- UUID in search box opens up my object.
- If I type a junk UUID, I see the search box with empty results, as expected
- Typed in search string is applied in the search box
- Yes, collections are now available when I choose a project

Some comments (please do not block on these, but see if you want to address any of these in your next round of updates):
- In search results I see "unnamed - uuid". This does not feel classy but I see your intention.
- In the search results, I think it would be desirable that we sort by name instead of uuid, at least sort by name first and then by uuid. This is especially obvious and annoying in search box because we list projects first and then the rest of the objects.
- I also think we need to sort by name in project drop down also.
- I think we need to be brave and get rid off the "group_class in ['project', ['folder']" usages and look for 'project' only, now that we have implemented the migration. Otherwise, this will continue to haunt the developers with uncertainty.
- I am not sure what your thoughts on the preview box are. I think it would be nice to show some of the basic attributes such as name, description, creation time etc for non-collection objects.
- For a collection with multiple files, I saw the files listed in the preview panel. I was able to mouse over them and click on them. But the clicks did not yield any results. Is it possible to simplify the preview panel and only show read only information in here?
- I agree this is asking too much, but now that we are offering search, it would be expected that search operation searches object contents, not names and uuids. I added a "hair color = red" property to a trait. Searching for either of these words yielded no results. Just raising this for far into future consideration.

#16 Updated by Tom Clegg almost 6 years ago

Radhika Chippada wrote:

- In search results I see "unnamed - uuid". This does not feel classy but I see your intention.

Just uuid better?

- In the search results, I think it would be desirable that we sort by name instead of uuid, at least sort by name first and then by uuid. This is especially obvious and annoying in search box because we list projects first and then the rest of the objects.

Added a task.

- I think we need to be brave and get rid off the "group_class in ['project', ['folder']" usages and look for 'project' only, now that we have implemented the migration. Otherwise, this will continue to haunt the developers with uncertainty.

Agree. Added #3444 on current sprint.

- I am not sure what your thoughts on the preview box are. I think it would be nice to show some of the basic attributes such as name, description, creation time etc for non-collection objects.

First I'd like to do the "expand/collapse instead of preview pane" task. I've added #3445 to improve the content of the previews (needs a bit more grooming for details).

- For a collection with multiple files, I saw the files listed in the preview panel. I was able to mouse over them and click on them. But the clicks did not yield any results. Is it possible to simplify the preview panel and only show read only information in here?

Added a task to deal with this.

- I agree this is asking too much, but now that we are offering search, it would be expected that search operation searches object contents, not names and uuids. I added a "hair color = red" property to a trait. Searching for either of these words yielded no results. Just raising this for far into future consideration.

I've added a note about this to #3149.

- I also think we need to sort by name in project drop down also.

#17 Updated by Radhika Chippada almost 6 years ago

Regarding "In search results I see "unnamed - uuid". This does not feel classy but I see your intention", Tom asked "Just uuid better?"

Yes, I think just uuid is better than showing "unnamed - uuid". Basically, if uuid is shown, it means that the object is not named and I would assume one would know this after spending a little time with our workbench.

#18 Updated by Radhika Chippada almost 6 years ago

Tom, I am aware that you are thinking of doing the search on server for next sprint. I wanted to leave a note supporting that plan.

Last week I created a collection using arv. I then went to workbench and tried to search for that collection. I opened the search dialog and entered my collection uuid. In production. The search popup kept spinning the spinner and never did return with the matching result. I gave up after 5 mins.

So, I strongly support doing the search on server. I think we should start with empty expand/collapse panel and preview panel when the dialog comes up. Then as the user starts typing, and probably after the user types in a three or four characters or hits enter, we display results from server in the left expand/collapse panel. Trying to fill this area before the user enters search string seems unnecessary calls to server and probably with unwanted data under normal circumstances.

#19 Updated by Tom Clegg almost 6 years ago

  • Status changed from In Progress to Resolved

Also available in: Atom PDF