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
fix: add id to checkbox, add link to profiles #1449
fix: add id to checkbox, add link to profiles #1449
Conversation
β Deploy Preview for oss-insights failed.Built without sensitive environment variables
|
β Deploy Preview for design-insights ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
htmlFor={id} | ||
className="ml-3 text-sm font-medium leading-none cursor-pointer text-light-slate-12 peer-disabled:cursor-not-allowed peer-disabled:opacity-70" | ||
({ className, label, id, ...props }, ref) => { | ||
id = id ? id : label?.replaceAll(" ", "_").toLowerCase(); |
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 line is the line that I changed here, plus the ID call in the function, yet git did not detect it only (not sure why)
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.
You should turn this to a function that returns the conditional statements here
id = id ? id : label?.replaceAll(" ", "_").toLowerCase(); | |
const getId = ()=> id ? id : label?.replaceAll(" ", "_").toLowerCase(); | |
Then in the component attributes, set it to id={getId()}
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 am going to implement this, but was wondering why we would take this approach?
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.
The variable name needs updating to avoid conflicts with the reserved id
keyword from the props.
We could have easily said const newId = id ? id : label?.replaceAll(" ", "_").toLowerCase();
but it makes more sense with a function since we are performing some checks to determine the used id
.
<label | ||
htmlFor={id} | ||
className="ml-3 text-sm font-medium leading-none cursor-pointer text-light-slate-12 peer-disabled:cursor-not-allowed peer-disabled:opacity-70" | ||
({ className, label, id, ...props }, ref) => { |
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.
the id
had checkbox as default value, I removed it from here.
htmlFor={id} | ||
className="ml-3 text-sm font-medium leading-none cursor-pointer text-light-slate-12 peer-disabled:cursor-not-allowed peer-disabled:opacity-70" | ||
({ className, label, id, ...props }, ref) => { | ||
id = id ? id : label?.replaceAll(" ", "_").toLowerCase(); |
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.
You should turn this to a function that returns the conditional statements here
id = id ? id : label?.replaceAll(" ", "_").toLowerCase(); | |
const getId = ()=> id ? id : label?.replaceAll(" ", "_").toLowerCase(); | |
Then in the component attributes, set it to id={getId()}
@@ -54,7 +54,7 @@ const ContributorProfileInfo = ({ | |||
{isConnected && <Badge text="beta" />} | |||
</div> | |||
<div className="flex items-center text-sm gap-3"> | |||
<span className="text-light-slate-11 text-sm">{`@${githubName}`}</span> | |||
<a className="text-light-slate-11 text-sm" href={`https://github.com/${githubName}`}>{`@${githubName}`}</a> |
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.
<a className="text-light-slate-11 text-sm" href={`https://github.com/${githubName}`}>{`@${githubName}`}</a> | |
<a className="text-light-slate-11 text-sm" href={`/user/${username}`}>{`@${githubName}`}</a> |
I don't think the @[username]
UI element speaks/communicate well enough of the location it takes a user to on click action, I think its best for User Experience to either have this just link back to the same profile on open-sauced/insights or not link at all.
I understand your thought of having a link to the Contributor' GitHub profile from insights Yes, but I would suggest we create a link to the profile explicitly with an Icon/button
somewhere on the UserCard
, best in the Socials section
below the About
, this because the @[username]
link alone doesn't tell me by itself its a link to the contributors' github profile.
This compared to the current set-up better informs the users of what they're clicking on and where its should take them to.
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.
If we have the user back to their profile, then it would not make sense to add a link here.
https://deploy-preview-1449--oss-insights.netlify.app/user/a0m0rajab/highlights
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 agree with @babblebey on this. We should ignore making a link to Github from the user's profile for now. we can revisit this in the future and maybe add some design help from @isabensusan.
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.
@bdougie already agreed on that in the previous issue 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.
I agreed on the PR, code review is part of the process.
I also stand by my previous feedback in the issue. It is not clear what the goal is in this PR. The title seems like this PR is two features in on PR.
This PR links 3 different issues. I don't know where to begin on the feedback or review.
I'd suggest closing this PR and opening separate PRs.
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.
I thought this is an accepted pattern since I saw it before in the AI repo
This is a repo used by close to 4k users.
We can close multiple issues when it makes sense, but your changes were completely different and your title and descriptions were not cohesive.
There are a lot more π here than the AI repo.
Please consider the context
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.
Thank you for giving me information about the context! Was looking at all repos from the same perspective π
Co-authored-by: ( Nechiforel David-Samuel ) NsdHSO <[email protected]>
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.
Open one PR per issue.
Please do one PR per feature/issue. |
Thanks for that, I opened them. |
Description
This PR adds redirect to profile page like the next:
Beside the redirects, it fixes the label/input connection issue in the pages with multiple checkboxes, if the check box has no ID. the default id would be checkbox which will break the UI due to having multiple similar IDs, I fixed this by using the label as ID, to avoid any issue in the future and make the ID as an optional for programmer for easier coding.
What type of PR is this? (check all applicable)
Related Tickets & Documents
Fixes #1447
Fixes #1199
Fixes #1448
Mobile & Desktop Screenshots/Recordings
This link in the profile page is redirecting to GitHub:
To test:
This link in the feed page redirects to OpenSauced Profile:
To test
The checkbox elements and labels are connected to their related inputs:
To Test you need to do the next:
Deploy Test Links:
Added tests?
Added to documentation?
[optional] Are there any post-deployment tasks we need to perform?
[optional] What gif best describes this PR or how it makes you feel?