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
Mod Center: clicking on article title opens a in new tab #9314
Mod Center: clicking on article title opens a in new tab #9314
Conversation
|
Thanks for making a PR! This looks good! 🎉 I noticed a commented out line and had a question about 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.
Looks good. It just needs a test for this change.
|
I made a test case to see if the article title matches the title given in the href tag, but I'm not sure if this would be valid enough for a test case. |
|
Thanks for the PR! Looks like you have merge conflicts now unfortunately. @lisasy, do you think the link color should be there? Or should it be the color of regular text? I think it probably makes sense to have the link color now that the title has become a link. Also @PrimeNoodles do you mind checking if the titles look okay with different themes? |
|
@Zhao-Andy I've updated the original post with examples of every theme, seems to be working fine, also some themes seem to have their own link color. I'm trying to fix this problem with codeclimate and the merge conflicts. |
…dles/post-listed-mod-center-open-new-tab-8976
|
Oh very useful thank you! 🙌🏼🌱 |
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 this is a good change! Great first PR! 🎉
Thanks for tackling this @PrimeNoodles ❤️
|
This looks good to me! |
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 adding some tests @PrimeNoodles. Left a suggestion.
| /> | ||
| </>, | ||
| ); | ||
| const text = getNodeText(container.querySelector('.article-title-link')); |
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.
refactor (non-blocking): You can use preact-testing-library's getByText instead of using DOM APIs directly.
question: Is the <div /> in the render necessary for the test?
<div
data-testid="flag-user-modal"
class="flag-user-modal-container hidden"
/>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.
@nickytonline as the OP hasn't responded in a week and as this PR is months old, do you want to finalize this change or shall we merge as is?
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.
We can merge it as it's non-blocking.
What type of PR is this? (check all applicable)
Description
Was able to create a clickable title on the modCenter page where clicking on the article title would open a new tab to the the article. Clicking on the label will bring up the original inline article mod.
Related Tickets & Documents
Closes #8976
I was also able to get a clickable link on the author to work, which seemed to have no errors on my local host end. However, when trying to commit and run the test cases on singleArticle.text.jsx, it wasn't able to pass one of the test on line 73 to 77 where it renders the author's name. I have commented the code out if anyone can look and see what the problem is.
I also wasn't able to implement @jacobherrington suggestion of having a external link icon simply because I wasn't able to import the externalicon.svg, maybe it's connect to the crayon system?
QA Instructions, Screenshots, Recordings
Added tests?
Added to documentation?