Bug #11652
closed
[Workbench] Search should search subprojects as well as selected project
Added by Tom Morris over 7 years ago.
Updated over 7 years ago.
Assigned To:
Radhika Chippada
Description
Customer request:
Is it possible to change behaviour of the search in the following way: selection of project will lead to all result matching the search within the subprojects and Data Collections? Currently it shows only the results for the project itself but does not go deeper into the subproject structure.
Example: project A > project B > project A & B
Search in all projects for B results in: Project B and Project A & B
Search in Project A for B results only in: Project B (we would like to have also project A & B)
Implementation:
- switch search to be recursive in the global search modal
- results are shown as a flat list
- Subject changed from [Workbench] Search should search subprojects as well as selected project to [Workbench] Search should search subprojects as well as selected project - to be groomed
- Target version changed from 2017-06-07 sprint to 2017-06-21 sprint
- Description updated (diff)
- Story points set to 2.0
- Subject changed from [Workbench] Search should search subprojects as well as selected project - to be groomed to [Workbench] Search should search subprojects as well as selected project
- Status changed from New to In Progress
- Assigned To set to Radhika Chippada
- Target version changed from 2017-06-21 sprint to 2017-06-07 sprint
LGTM
Please consider adding the following three tests in groups_controller_test.rb
test 'get contents recursive=true from home project' do
authorize_with :active
get :contents, {
recursive: true,
format: :json,
}
owners = json_response['items'].map do |item|
item['owner_uuid']
end
assert_includes(owners, users(:active).uuid)
assert_includes(owners, groups(:aproject).uuid)
assert_includes(owners, groups(:asubproject).uuid)
end
test 'get contents recursive=false' do
authorize_with :active
get :contents, {
id: groups(:aproject).uuid,
recursive: false,
format: :json,
}
owners = json_response['items'].map do |item|
item['owner_uuid']
end
assert_includes(owners, groups(:aproject).uuid)
assert_not_includes(owners, groups(:asubproject).uuid)
end
test 'get contents with no recursive flag' do
authorize_with :active
get :contents, {
id: groups(:aproject).uuid,
format: :json,
}
owners = json_response['items'].map do |item|
item['owner_uuid']
end
assert_includes(owners, groups(:aproject).uuid)
assert_not_includes(owners, groups(:asubproject).uuid)
end
Lucas: branch 11652-recursive-contents-wb is ready for review @ f1aed11fd3a5e204a2cf2e4fc5f099179e877eb6
This branch implements the workbench side of recursive project contents for search.
To review: please compare against the 11652-recursive-contents branch (which is being addressed by Tom to implement the API server support for recursive flag. I will merge this branch after Tom merges 11652-recursive-contents branch.)
git diff 11652-recursive-contents...11652-recursive-contents-wb
A couple of small comments:
- File
apps/workbench/test/controllers/search_controller_test.rb
- Line 51: Shouldn’t the message say something like “search results for non empty project should not be empty”?
- File
services/api/lib/can_be_an_owner.rb
- Line 36: I think the map call is not needed, shouldn’t
exec_query(‘…’).rows
be enough in this case?
The rest LGTM. Thanks!
- Status changed from In Progress to Resolved
- % Done changed from 50 to 100
Applied in changeset arvados|commit:f7b0474852fa8f270605c4cb5eeaf85c910c421e.
Also available in: Atom
PDF