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

Comments: CommentDetail Redux refactor #18406

Closed
wants to merge 7 commits into from

Conversation

Copons
Copy link
Contributor

@Copons Copons commented Sep 29, 2017

  • Moved all props to the components who actually use it.
  • Created an util file for recurring tasks.
  • Removed CommentDetail from the devdocs, since it's now completely dependent from the CommentList.

No existing logic has been changed or harmed, this PR really just needs a smoke test on the comments section.

Next task: move CommentDetail away from /blocks and into /my-sites/comment-list.

Another task could be to re-nest some children objects, such as author or post, that are usually needed in their entirety (or close to that).

@Copons Copons added [Feature] Comments Comments on posts and the admin screen for managing them. [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it labels Sep 29, 2017
@Copons Copons requested a review from a team September 29, 2017 15:46
@matticbot
Copy link
Contributor


return {
commentIsLiked: get( comment, 'i_like' ),
commentStatus: get( comment, 'status' ),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little confused on why we pass though ever other prop but these two.

@gwwar
Copy link
Contributor

gwwar commented Sep 29, 2017

So as an overall comment let's be careful to pick which components are pure UI pieces and which ones are blocks. The former only cares about content display, and things like analytics handlers are passed through to onClick from their parents. With the right props we can render whatever we need. Blocks generally declare their data dependencies, so they are droppable and reusable in any context.

If we feel like we're repeating ourselves, that may be an opportunity to create a small block component.

I think some of the pain is being caused by the number of props we need off of comment/author. I'd also be open to passing a full comment/author object down a single level, provided we clearly document the shape of the comment that needs to be passed.

@dmsnell
Copy link
Member

dmsnell commented Sep 30, 2017

I didn't look at the code, but nice LOC delta

@Copons Copons force-pushed the update/comments/comment-detail-redux-refactor branch from 2cbdcb2 to 6874ecb Compare October 9, 2017 09:21
@Copons Copons self-assigned this Oct 9, 2017
@Copons
Copy link
Contributor Author

Copons commented Oct 9, 2017

Heads up @rodrigoi: I've rebased this PR, but I think we should put it on hold until both #18657 and #18624 are merged to avoid propagating conflicts all over the place.

@Copons
Copy link
Contributor Author

Copons commented Nov 2, 2017

Replaced by full redesign (see #19082).

@Copons Copons closed this Nov 2, 2017
@Copons Copons deleted the update/comments/comment-detail-redux-refactor branch November 2, 2017 17:01
@Copons Copons removed [Status] Blocked / Hold [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it labels Nov 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Comments Comments on posts and the admin screen for managing them.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants