WIP: Add Comment Count to Video Preview Components #6635
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
For backend changes, I added a migration that adds a commentCount column to the video table.
The migration:
From there, I've also updated the video comment model to add triggers for events that impact visibility of comments on a video, with those being:
At this time, I think I've missed the case when we ban/unban or delete a user, will try to find remaining cases if the approach seems sound so far.
From there, also added the commentCount field to the video model and made the field visible by adding it to relevant formatter definitions.
Front end changes are less significant, just some setup to allow the commentCount to come through from the API, then the UI changes to display the value.
Also added commentCount to the displayOptions, but tbh I still need to dig further into that. Still not sure exactly how this bit works yet, but it seems reasonable to have the commentCount as an optional display, would just need to trace the behavior and implement.
Related issues
Resolves #492
Implements UI based on screenshot provided from #3166
Has this been tested?
Some manual testing at this time does show the comment count coming through, but still need to implement unit tests.
Screenshots