Bug #11652
closed[Workbench] Search should search subprojects as well as selected project
100%
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
Updated by Tom Morris over 7 years ago
- 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
Updated by Tom Morris over 7 years ago
- Description updated (diff)
- Story points set to 2.0
Updated by Tom Morris over 7 years ago
- 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
Updated by Radhika Chippada over 7 years ago
- 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
Updated by Tom Clegg over 7 years ago
11652-recursive-contents @ fd4bdb760eb47013b8b60b40859ba7f004ee8383
Updated by Radhika Chippada over 7 years ago
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
Updated by Radhika Chippada over 7 years ago
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
Updated by Tom Clegg over 7 years ago
11652-recursive-contents @ 29665e2d9a543bffb237d148c3484c03b03e30aa
Updated by Lucas Di Pentima over 7 years ago
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?
- Line 36: I think the map call is not needed, shouldn’t
The rest LGTM. Thanks!
Updated by Radhika Chippada over 7 years ago
search_controller_test.rb - Line 51: Shouldn’t the message say something like “search results for non empty project should not be empty”?
Thanks for catching that. Copy/paste lapse. Corrected
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?
With exec_query.rows, we get this for descendets: zzzzz-j7d0g-axqo7eu9pwvna1x%22%5D_%5B%22zzzzz-j7d0g-subprojsamenam2%22">"zzzzz-j7d0g-axqo7eu9pwvna1x"], ["zzzzz-j7d0g-subprojsamenam2" , where as with the other we get this ["zzzzz-j7d0g-axqo7eu9pwvna1x", "zzzzz-j7d0g-subprojsamenam2"]. It may work, but better to have the right format. (This is already merged by Tom)
Thanks.
Updated by Radhika Chippada over 7 years ago
- Status changed from In Progress to Resolved
- % Done changed from 50 to 100
Applied in changeset arvados|commit:f7b0474852fa8f270605c4cb5eeaf85c910c421e.