-
Notifications
You must be signed in to change notification settings - Fork 154
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
Made GitHub username clickable #424
Conversation
@mickmister I haven't setup my environment for this plugin to test my changes locally yet, but is this the sort of addition that you had in mind for #408? |
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 @djanda97! I have just a few requests
|
||
if (item.user) { | ||
userName = item.user.login; | ||
userProfile = `https://github.com/${userName}`; |
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.
What do you think about this instead:
if (item.user) {
userName = item.user.login;
} else if (item.owner) {
userName = item.owner.login;
}
const userProfile = `https://github.com/${userName}`;
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 catch!
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.
Actually userName
may not be defined. So maybe just construct the URL inline since it's only used once:
<a
href={`https://github.com/${userName}`}
>
{userName}
</a>
@@ -158,7 +160,7 @@ function GithubItems(props) { | |||
style={style.subtitle} | |||
> | |||
{item.created_at && ('Opened ' + formatTimeSince(item.created_at) + ' ago')} | |||
{userName && ' by ' + userName} | |||
{userName && <a href={userProfile}> by {userName}</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.
The linter is complaining about the JSX/string formatting here:
163:56 error Missing JSX expression container around literal string: “by” react/jsx-no-literals
Maybe try something like this:
{userName && <a href={userProfile}> by {userName}</a>} | |
{userName && ( | |
<> | |
{' by '} | |
<a href={userProfile}>{userName}</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.
Once I get my environment setup, I'll go ahead and test out this change.
I tested out what the styling looks like when the username is wrapped in an |
@djanda97 Do you mind commenting on the ticket #408 so I may assign you? Also feel free to ask questions on our community server at https://community.mattermost.com/core/channels/github-plugin e.g. questions on setting up the plugin. |
@mickmister I agree that the username should not be that dark and be more visible. But I think it is using the
|
This PR has been automatically labelled "stale" because it hasn't had recent activity. |
Removing myself from the reviewers list util the UX questions are resolved. |
Thanks for the feedback @abhijit-singh. It might be a while until I can find some time to work on this PR. Once I do, I will try implementing the solutions you listed above. |
@djanda97 Could you please lmk if there's any update on this? If not can I take this up? |
Hi @adithyaakrishna, I haven't made any progress on this PR, so feel free to pick it up! |
@adithyaakrishna Would you like to take up this ticket? You can clone this PR's code using the hub command: git clone [email protected]:mattermost/mattermost-plugin-github.git
# or set the url of origin if you already have this checked out
git remote set-url origin [email protected]:mattermost/mattermost-plugin-github.git
git remote add adithyaakrishna [email protected]:adithyaakrishna/mattermost-plugin-github.git Then you can run |
I'm going to close this PR as @adithyaakrishna is working on a new one. Still, thanks @djanda97 for working on this! |
Summary
<a></a>
with a link to the URL provided from the userProfile variable.Ticket Link
Fixes #408