Implement TUI support for multiple users in each position #80

Merged
merenber merged 6 commits from feature-59 into master 2023-01-23 02:26:15 -05:00
Member
No description provided.
j24chung added 1 commit 2022-10-13 17:54:04 -04:00
j24chung added 1 commit 2022-10-13 20:18:03 -04:00
continuous-integration/drone/pr Build is passing Details
d16e7bb293
Fixed linting
r389li requested changes 2022-10-14 00:25:00 -04:00
r389li left a comment
Owner

Almost there! Thanks for taking this on!

Almost there! Thanks for taking this on!
@ -18,6 +22,7 @@ class SetPositionsController(Controller):
for pos, field in self.view.position_fields.items():
if field.edit_text != '':
body[pos] = field.edit_text
logger.info(body)
Owner

Will this clutter up log?

Will this clutter up log?
Author
Member

Not sure why but this piece of code isn't supposed to be in the branch anymore. I don't see it on my local repo which should be in sync with the branch being merged. I'll look into why it isn't gone yet.

Not sure why but this piece of code isn't supposed to be in the branch anymore. I don't see it on my local repo which should be in sync with the branch being merged. I'll look into why it isn't gone yet.
Author
Member

Fixed :)

Fixed :)
j24chung marked this conversation as resolved
@ -32,0 +35,4 @@
for user in username:
self.positions[user].append(position)
else:
raise TypeError("Username(s) under each position must either be a string or a list")
Owner

Would the rest of this file work as well? On a cursory glance there's a couple more places that look like they should need changing (i.e. removing old positions, etc.)

Also, let's add some tests specifically targetting this, so we can future-proof guarantees of it working!

Would the rest of this file work as well? On a cursory glance there's a couple more places that look like they should need changing (i.e. removing old positions, etc.) Also, let's add some tests specifically targetting this, so we can future-proof guarantees of it working!
Author
Member

Could you clarify on what places need more changing? Not very sure about the whole code design but all I've changed is that when a position has a list of userids, instead of just a string of one user's userid, it will know how to parse that list and add the position to each user. I assume the remaining code knows how to handle a case where one user has multiple positions, as required

Could you clarify on what places need more changing? Not very sure about the whole code design but all I've changed is that when a position has a list of userids, instead of just a string of one user's userid, it will know how to parse that list and add the position to each user. I assume the remaining code knows how to handle a case where one user has multiple positions, as required
Author
Member

I could def add tests targeting this new feature!

I could def add tests targeting this new feature!
Owner

I think this is the only other place that needs to be updated


            self.old_positions[username] = old_positions
            for position in new_positions:
                new_positions_reversed[position] = username

Also, I think the ceod api is the only place using UpdateMemberPositionsTransaction, so you can just change the type without needing to care about string

I think this is the only other place that needs to be updated ```python self.old_positions[username] = old_positions for position in new_positions: new_positions_reversed[position] = username ``` Also, I think the ceod api is the only place using `UpdateMemberPositionsTransaction`, so you can just change the type without needing to care about string
j24chung added 1 commit 2022-10-14 13:21:23 -04:00
continuous-integration/drone/pr Build is failing Details
910449d67a
Remove some logging code
j24chung added 1 commit 2022-10-14 13:36:48 -04:00
continuous-integration/drone/pr Build is passing Details
4145491373
Fix linting error
merenber added 2 commits 2023-01-23 02:15:26 -05:00
merenber merged commit 5e8f1b5ba5 into master 2023-01-23 02:26:15 -05:00
merenber deleted branch feature-59 2023-01-23 02:26:15 -05:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: public/pyceo#80
No description provided.