Skip to content

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

MCFrank16
Copy link

@MCFrank16 MCFrank16 commented Oct 11, 2019

Description

Type of change

Please select the relevant option

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Others (cosmetics, styling, improvements)
  • This change requires a documentation update

How Has This Been Tested?

  • Unit
  • Integration
  • End-to-end

How to Test

Give instructions on how reviewers can verify your work

Any background context you want to add

JIRA

CON-337

@MCFrank16 MCFrank16 changed the title CON-337-fix(remote-rooms): return all rooms when there is no location CON-337 return all rooms when there is no location Oct 13, 2019
@MCFrank16 MCFrank16 force-pushed the bug/CON-337-return-all-rooms-without-filter branch from 77fe190 to 1e1f832 Compare October 14, 2019 13:13
@MCFrank16 MCFrank16 added the To be merged This PR is ready to be merged, developer can start on a new story label Oct 14, 2019
@mifeille mifeille removed the To be merged This PR is ready to be merged, developer can start on a new story label Oct 14, 2019
@@ -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
Copy link
Contributor

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.

Copy link
Author

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

Copy link
Author

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?

Copy link
Contributor

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.

@MCFrank16 MCFrank16 force-pushed the bug/CON-337-return-all-rooms-without-filter branch 2 times, most recently from b73076d to 5b7fee2 Compare October 16, 2019 07:39
@@ -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'
Copy link
Contributor

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.

Copy link
Author

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

@MCFrank16 MCFrank16 force-pushed the bug/CON-337-return-all-rooms-without-filter branch 11 times, most recently from 898c55b to 6b94245 Compare October 17, 2019 07:32
Copy link
Contributor

@joshuaocero joshuaocero left a 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.

}
}
}

all_remote_rooms_query2 = '''
Copy link
Contributor

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.

}
'''

all_remote_rooms_response2 = {
Copy link
Contributor

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.

@@ -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):
Copy link
Contributor

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.

@MCFrank16 MCFrank16 force-pushed the bug/CON-337-return-all-rooms-without-filter branch 2 times, most recently from fd18d12 to 038442e Compare October 17, 2019 10:18
@MCFrank16 MCFrank16 added the To be merged This PR is ready to be merged, developer can start on a new story label Oct 18, 2019
}
}
}

all_remote_rooms_query_with_returnAll_True = '''
Copy link
Contributor

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

}
'''

all_remote_rooms_response_with_returnAll_True = {
Copy link
Contributor

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

@@ -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):
Copy link
Contributor

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

@MCFrank16 MCFrank16 force-pushed the bug/CON-337-return-all-rooms-without-filter branch 15 times, most recently from 5d357d5 to 4c6d3e4 Compare October 23, 2019 08:46
@MCFrank16 MCFrank16 force-pushed the bug/CON-337-return-all-rooms-without-filter branch 7 times, most recently from 886fba8 to 98a958d Compare October 29, 2019 09:46
@MCFrank16 MCFrank16 force-pushed the bug/CON-337-return-all-rooms-without-filter branch from 98a958d to 71bd74c Compare November 25, 2019 12:53
- return all rooms when the location is not available in the map filter

[Delivers CON-337]
@MCFrank16 MCFrank16 force-pushed the bug/CON-337-return-all-rooms-without-filter branch from 71bd74c to f52245b Compare November 25, 2019 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
To be merged This PR is ready to be merged, developer can start on a new story
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants