-
Notifications
You must be signed in to change notification settings - Fork 3
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
Update team table so that duplicate team members cannot be added #1551
base: main
Are you sure you want to change the base?
Conversation
…g object thing and also fixes other bugs
value: { workgroup_id: newValue?.workgroup_id }, | ||
value: { | ||
workgroup_id: newValue?.workgroup_id, | ||
workgroup_name: workgroupLookup[newValue?.workgroup_id], |
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.
this fixed a bug thats currently in prod where if you edit a row and click a new user and then in the same edit session click the old user again and save that, you would see [object Object] in the workgroup name field. also in other cases where you are actually saving a new user, [object Object] would just flash on the screen in the time between clicking save and this hook running which manually adds the workgroup_name
to the row data
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.
Nice! Thank you for catching AND fixing this bug. 🚀 I was able to see the native object peek out in staging when I adjusted my connection speed. 🙏
FYI @chiaberry this probably affects your work on reusable autocompletes that have dependent fields
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.
Thanks for addressing this bug! I am going to check the milestones table to see if I see that same bug there.
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.
Looks great! I tested adding, editing, and deleting team members, and I can no longer add the same person over and over. Thanks for bundling in a bug fix too. Great find! 🙏
I left some comments about code that I'd like to get your feedback on, but this is 🚢 based on functionality. 🙌
value: { workgroup_id: newValue?.workgroup_id }, | ||
value: { | ||
workgroup_id: newValue?.workgroup_id, | ||
workgroup_name: workgroupLookup[newValue?.workgroup_id], |
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.
Nice! Thank you for catching AND fixing this bug. 🚀 I was able to see the native object peek out in staging when I adjusted my connection speed. 🙏
FYI @chiaberry this probably affects your work on reusable autocompletes that have dependent fields
moped-editor/src/views/projects/projectView/ProjectTeam/ProjectTeamTable.js
Outdated
Show resolved
Hide resolved
moped-editor/src/views/projects/projectView/ProjectTeam/ProjectTeamTable.js
Outdated
Show resolved
Hide resolved
… filter, update to use user_ids
thanks for your feedback mike, i pushed up some updates lmk what you think! |
); | ||
// filter out existing team members from list of options unless they are the current row member | ||
// that way the current member remains an option when editing a row | ||
const teamMembersWithoutDuplicates = data?.moped_users.filter( |
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.
I'm not 100% sold on this variable name. Because our existing list of users already does not have duplicates in it. This is a list of team members that aren't already on the project, so its preventing duplicates.
maybe unassignedTeamMembers
?
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.
cool i like that, just updated!
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.
🚢 Good fix! and thank you for fixing that bug.
I am not sold on the variable name, but its nothing preventing this from being merged
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.
Works just as expected, and a bug squashed in the process! 🙏 🚢 🚀
Associated issues
Closes cityofaustin/atd-data-tech#21199
Even though theres minimal code changes i found this to be way more complicated to untangle/implement than i thought it would!
Testing
URL to test:
https://deploy-preview-1551--atd-moped-main.netlify.app/moped/
Steps to test:
Ship list