[WIP] [Systems-Development-and-Frameworks] Storybook for reported content
Created by: Tirokk
Authored by roschaefer Closed
🍰 Pullrequest
This is the new exercise for the course "Systems Development and Frameworks". As a user you can report content that violates the community guidelines. It will show up in such a list:
What we didn't thought of is that multiple users could report the same thing. So a moderator should see all reports grouped by resource, e.g. one post and a list of all users who reported the post and when.
Relates to #1710 (closed) .
See moderation page:
- Visit https://nitro-staging.human-connection.org/
- Log in as
moderator@example.org
and password1234
. - Click on the avatar menu and choose
Moderation
.
Where is the code that renders the list?
It is here: https://github.com/Human-Connection/Human-Connection/blob/master/webapp/pages/moderation/index.vue
How can I report someting?
- Visit https://nitro-staging.human-connection.org/
- Log in as any user, you can choose
huey@example.org
ordewey@example.org
etc. and password1234
- Click on the context menu of a post or comment or the context menu on the user profile page. You must not be this user or must not be the author of this post or comment.
Task 1: Refactor
All the code which is relevant to show a single line in the table should be moved into this component:
Import the component on the moderation page component
Refactoring is started in #1954 now.
Task 2: Write a storybook story
You can find the storybook story here: https://github.com/Human-Connection/Human-Connection/blob/storybook_for_reported_content/webapp/components/ReportedContent/ReportedContent.story.js
It would be great if you could write data to show the ReportedContent
component if the content is a Post
a Comment
or a User
respectively.
Task 2.1: Implement the moderation "log"
As described in the screenshot above
So the goal is to list this log just below the row with the reported resource.
Task 3: Write a component test
You can find a blueprint for a component tere here: https://github.com/Human-Connection/Human-Connection/blob/storybook_for_reported_content/webapp/components/ReportedContent/ReportedContent.spec.js
In the test you could e.g. test:
- links to the reported content
- given the content is not disabled
- it shows a dash in the column
Disabled by
- it shows a dash in the column
- given the content is disabled
- it shows who disabled the content