-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Comments: add single comment view #19635
Conversation
|
||
const CommentPermailnk = ( { permaLink, translate } ) => ( | ||
<Card className="comment__comment-permalink"> | ||
<SectionHeader label={ translate( 'Comment Permalink' ) } /> |
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.
Hi! I've found a possible matching string that has already been translated 43 times:
translate( 'Permalink to this comment' )
ES Score: 8
See 1 additional suggestion in the PR translation status page
Help me improve these suggestions: react with 👎 if the suggestion doesn't make any sense, or with 👍 if it's a particularly good one (even if not implemented).
const CommentPermalink = ( { isLoading, permaLink, translate } ) => | ||
! isLoading && ( | ||
<Card className="comment__comment-permalink"> | ||
<SectionHeader label={ translate( 'Comment Permalink' ) } /> |
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.
Hi! I've found a possible matching string that has already been translated 43 times:
translate( 'Permalink to this comment' )
ES Score: 8
See 1 additional suggestion in the PR translation status page
Help me improve these suggestions: react with 👎 if the suggestion doesn't make any sense, or with 👍 if it's a particularly good one (even if not implemented).
I know technically everything is a post, but in |
* | ||
* we may not have user capabilities loaded onto state. | ||
* We trust that the API will handle user capabilities for us. | ||
*/ |
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.
Still much more secure than the inverse ;)
client/my-sites/comment/main.jsx
Outdated
const { commentId, siteFragment } = ownProps; | ||
|
||
const siteId = getSiteId( state, siteFragment ); | ||
// const isJetpack = isJetpackSite( state, siteId ); |
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.
Do we need Jetpack checks? We should have the related endpoint work ready.
@drw158 did we need anything here in the header to help differentiate between the post specific view and one for a single comment? |
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 @rodrigoi! Let's tidy some of the commented out sections and get this in. This feels like a good chunk of work already.
If we feel like this might not ship with the new changes we can add another feature flag but I don't think it's necessary right now.
Things we can address in follow up PRs:
- timing and how much information the route needs. eg can we simplify this to only needing the action param?
- fix the clean cache flash of not having correct permissions
- no feedback when replying to a comment
- a redirect when deleting a comment permanently from this view
- hitting the endpoint with the extra params I think does perform the update, but we're not seeing a re-render
- add an
edit
action once that's available in the new component.
Because this is mainly for email, I think this design will be fine for now. |
09250cf
to
3fa23c0
Compare
@rodrigoi can we try landing this and follow up with the other items in the next PRs? |
…or permailnk... it's permalink!
…ity warning when state is empty
3fa23c0
to
5d0b7d4
Compare
Overall this works well, but there are a bunch of follow up PRs that we should take care soonish, other than the ones already pointed out by @gwwar:
With the exception of the last point, I think we can easily fix and/or discuss in follow up PRs all the other points. 👍 |
* Comments: sidebar menu item is selected on both list and single comment view * Comments: updates link on the author date to the single comment view * Comments: adds moderation data component
Closes #18321
Very much in progress, but hidden under a feature flag 😄
Depends on:
This PR adds to new view for single comments, with the capability of performing moderation actions via query string parameters.
What to expect
This PR works only with the M3 redesign feature flag and depends heavily on components that still have work in progress, so warnings and errors are expected. Also, there's a regression on the comment list that shows all panels open, until #19560 gets resolved.Also, there's duplication of code until dependent PRs get merged.
What to test:
The main reason this view exists is to perform moderation actions from emails. That's the area that requires testing at the moment. Most design elements depends on other M3 redesign PRs and will adjust once they are merged.
How to test:
ENABLE_FEATURES=comments/management/m3-design npm start
Approve
,Spam
andTrash
action
: eitherapprove
,spam
,trash
ordelete
/comment/rodrigoidummyfreesite.wordpress.com/165?action=approve