Skip to content
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

Conversation

PrimeNoodles
Copy link
Contributor

@PrimeNoodles PrimeNoodles commented Jul 14, 2020

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

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

ModWindow

ModWindowDark

ModWindowMinLight

ModWindowPink

ModWindowTenXHacker

Added tests?

  • yes
  • no, because they aren't needed
  • no, because I need help

Added to documentation?

  • docs.dev.to
  • readme
  • no documentation needed

@jacobherrington
Copy link
Contributor

Thanks for making a PR! This looks good! 🎉

I noticed a commented out line and had a question about it.

@rhymes rhymes requested a review from nickytonline July 15, 2020 09:33
@rhymes rhymes changed the title Prime noodles/post listed mod center open new tab 8976 Mod Center: clicking on article title opens a in new tab Jul 15, 2020
Copy link
Contributor

@nickytonline nickytonline left a 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.

@PrimeNoodles
Copy link
Contributor Author

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.

@Zhao-Andy
Copy link
Contributor

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?

@PrimeNoodles
Copy link
Contributor Author

@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
@thomasbnt
Copy link
Contributor

Oh very useful thank you! 🙌🏼🌱

Copy link
Contributor

@jacobherrington jacobherrington left a 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 ❤️

@pr-triage pr-triage bot added the PR: partially-approved bot applied label for PR's where a single reviewer approves changes label Oct 12, 2020
@lisasy
Copy link
Contributor

lisasy commented Oct 12, 2020

This looks good to me!

Copy link
Contributor

@nickytonline nickytonline left a 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'));
Copy link
Contributor

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"
/>

Copy link
Contributor

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?

Copy link
Contributor

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.

@pr-triage pr-triage bot added PR: reviewed-approved bot applied label for PR's where reviewer approves changes and removed PR: partially-approved bot applied label for PR's where a single reviewer approves changes labels Oct 14, 2020
@nickytonline nickytonline merged commit ff68888 into forem:master Oct 20, 2020
@pr-triage pr-triage bot added PR: merged bot applied label for PR's that are merged and removed PR: reviewed-approved bot applied label for PR's where reviewer approves changes labels Oct 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: merged bot applied label for PR's that are merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow posts listed in Mod Center to open in a new tab
8 participants