-
Notifications
You must be signed in to change notification settings - Fork 32
CON-337 return all rooms when there is no location #506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
77fe190
to
1e1f832
Compare
api/room/schema_query.py
Outdated
@@ -280,7 +280,8 @@ def resolve_all_rooms(self, info, **kwargs): | |||
def resolve_all_remote_rooms(self, info, return_all=None): | |||
page_token = None | |||
filter = map_remote_room_location_to_filter() | |||
location = 'all' if return_all else get_user_from_db().location | |||
location = get_user_from_db().location | |||
location = 'all' if not filter.get(location) or return_all else location |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MCFrank16 your else
condition seems like repetition. You can get rid of it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me check that @joshuaocero
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joshuaocero is there any situation that an admin can view all remote rooms while his location is available in the map filter function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MCFrank16 yes, if the admin passes the return_all
field, they should be able to see all locations even if their location is available in the map filter.
b73076d
to
5b7fee2
Compare
api/room/schema_query.py
Outdated
@@ -280,7 +280,8 @@ def resolve_all_rooms(self, info, **kwargs): | |||
def resolve_all_remote_rooms(self, info, return_all=None): | |||
page_token = None | |||
filter = map_remote_room_location_to_filter() | |||
location = 'all' if return_all else get_user_from_db().location | |||
location = get_user_from_db().location | |||
if not filter.get(location) or return_all: location = 'all' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MCFrank16 put the assignment on a separate line to allow for easy reading of your code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok... let me do it
898c55b
to
6b94245
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please respond to those minor naming changes and we'll be good to go.
fixtures/room/query_room_fixtures.py
Outdated
} | ||
} | ||
} | ||
|
||
all_remote_rooms_query2 = ''' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MCFrank16 please name this fixture appropriately. The variable name should be more descriptive of what the query is doing.
fixtures/room/query_room_fixtures.py
Outdated
} | ||
''' | ||
|
||
all_remote_rooms_response2 = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MCFrank16 please name this fixture variable appropriately. The variable name should be more descriptive of what the response contains.
tests/test_rooms/test_query_rooms.py
Outdated
@@ -78,6 +80,17 @@ def test_calendar_list_function(self, mocked_method): | |||
get_google_api_calendar_list() | |||
assert mocked_method.called | |||
|
|||
def test_all_remote_rooms_with_true(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MCFrank16 please change the grammar in the function name. test_all_remote_rooms_with_true
makes no sense. Perhaps you could try test_all_remote_rooms_with_returnall_true
.
fd18d12
to
038442e
Compare
fixtures/room/query_room_fixtures.py
Outdated
} | ||
} | ||
} | ||
|
||
all_remote_rooms_query_with_returnAll_True = ''' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please look into your variable naming. Read the conventions -> https://www.python.org/dev/peps/pep-0008/#function-and-variable-names
fixtures/room/query_room_fixtures.py
Outdated
} | ||
''' | ||
|
||
all_remote_rooms_response_with_returnAll_True = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please look into your variable naming. Read the conventions -> https://www.python.org/dev/peps/pep-0008/#function-and-variable-names
tests/test_rooms/test_query_rooms.py
Outdated
@@ -78,6 +80,17 @@ def test_calendar_list_function(self, mocked_method): | |||
get_google_api_calendar_list() | |||
assert mocked_method.called | |||
|
|||
def test_all_remote_rooms_with_argument_returnAll_true(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please look into your variable naming. Read the conventions -> https://www.python.org/dev/peps/pep-0008/#function-and-variable-names
5d357d5
to
4c6d3e4
Compare
886fba8
to
98a958d
Compare
98a958d
to
71bd74c
Compare
- return all rooms when the location is not available in the map filter [Delivers CON-337]
71bd74c
to
f52245b
Compare
Description
Type of change
Please select the relevant option
How Has This Been Tested?
How to Test
Give instructions on how reviewers can verify your work
Any background context you want to add
JIRA
CON-337