-
Notifications
You must be signed in to change notification settings - Fork 0
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
Create a SearchSelectorField to replace the current SelectorField for adding skills #663
Conversation
Visit the preview URL for this PR (updated for commit 25ee0d0): https://sistering-dev--pr663-tejas-update-skills-fgu5cep8.web.app (expires Mon, 05 Sep 2022 22:18:41 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 |
currentLanguages.filter((l) => l.id !== language), | ||
); | ||
}; | ||
|
||
const createAccount = (values: CreateAccountFormValues): void => { | ||
if (onVolunteerCreate && onEmployeeCreate) { | ||
if (isAdmin) { |
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.
Could someone double-check this part? In editAccount
, we set branches: []
, but that effectively deletes the branches that were assigned to the user. I've verified this with prisma studio, seems like a bug?
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.
hmm I need to look into this. I've don't think I've ever encountered this bug on staging though
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.
wait yea, I think I get the bug. Definitely worth fixing since it's big impact. I'll file a ticket for 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.
I think I can quickly take care of this.
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.
#665 PR up
const newSkillsArr: string[] = Array.from(addedSkills); | ||
const newSkillsInDB: SkillResponseDTO[] = []; | ||
|
||
for (let i = 0; i < newSkillsArr.length; i += 1) { |
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.
forEach
doesn't work with await
as intended, and for ... of
is restricted.
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.
Woah, good job with the custom component. It definitely seemed non-trivial as expected. I'll try to take a closer look sometime tmw.
tooltip={<Text>Search and select skills you have.</Text>} | ||
onSelect={(skill) => | ||
selectSkill(skill, values.skills, setFieldValue) | ||
} | ||
onDeselect={(skill) => | ||
deselectSkill(skill, values.skills, setFieldValue) | ||
} | ||
onCreateNewOption={(newSkill) => addNewSkill(newSkill)} | ||
onDeleteNewOption={(newSkill) => deleteNewSkill(newSkill)} | ||
/> | ||
)} | ||
<SelectorField |
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.
@twilkhoo it would be really nice to have this for languages as well. Do you think it'll be difficult to include that in this PR as well?
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.
Yeah I was thinking that too! I'm planning to add the language field changes in a separate PR though after this one gets submitted for organization.
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.
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.
Made some suggestions, interested in your thoughts. Very impressed with the custom component overall 😤
Co-authored-by: Rickson Yang <44826218+MatoPlus@users.noreply.github.com>
Regarding the acronyms comment, I suppose that is a limitation with converting everything to title case. If we were to avoid converting to title case however, we would likely have lots of case differences in the db (some users may enter things all lowercase, some all uppercase, etc.). Due to this, I think that keeping the title case conversion outweighs the downsides. |
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.
LGTM, awesome work!
Ticket link
Closes #502
Implementation description
Steps to test
What should reviewers focus on?
Checklist