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

User list for moderative actions #12

Merged
merged 11 commits into from
Jul 21, 2018
Merged

User list for moderative actions #12

merged 11 commits into from
Jul 21, 2018

Conversation

ateufel
Copy link
Contributor

@ateufel ateufel commented Jul 21, 2018

This PR is for a new component basically for moderators and supervisors. Supervisors can add/remove the moderator role to a user/contributor, moderators can ban users.

Changelog

  • New menu entry in the sidebar for the list of users (contributors, moderators, supervisors).
  • User list component with backend search.
  • Single entries have tags for their user roles, if moderator or supervisor. No tag for simple contributors.
  • There is a special "banned" tag for banned users, with a PopOver showing the ban details.
  • Depending on the user role, several buttons for moderative actions show up (see screenshots).
  • Banning users requires a reason and an end date, both data can be entered in a modal (see screenshots).

Screenshots

Tags/Buttons:
userlist_tags

Ban Modal:
userlist_ban_modal

Ban Popover:
userlist_ban_popover

@@ -20,6 +20,7 @@ const CustomSidebar = ({location, user, articles}) => {
<Menu theme="dark" mode="inline" defaultSelectedKeys={[location.pathname]} style={{height: '100%', borderRight: 0, marginTop: '20px'}}>
{user.username && user.isContributor && <Menu.Item key="/mycontributions"><Link to="/mycontributions">My Contributions</Link></Menu.Item>}
{/*{user.isModerator && */}<Menu.Item key="/review"><Link to="/review">Review</Link></Menu.Item>{/*}*/}
{/*{user.isSupervisor && */}<Menu.Item key="/users"><Link to="/users">Users</Link></Menu.Item>{/*}*/}
Copy link
Member

Choose a reason for hiding this comment

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

We can uncomment this for production @ateufel

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, i will add it with the production flag, give me a minute!

Copy link
Member

@ms10398 ms10398 left a comment

Choose a reason for hiding this comment

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

How can we unban right now?

@ateufel
Copy link
Contributor Author

ateufel commented Jul 21, 2018

There is no backend API for unban at the moment, according to the backend docs. But it would be easy to implement if it is added.

@ateufel
Copy link
Contributor Author

ateufel commented Jul 21, 2018

Unban function added in the frontend. Backend needs to add the unban function: v1/moderation/unban

@onozasi onozasi merged commit f01b6e9 into knacksteem:master Jul 21, 2018
@ateufel ateufel deleted the userlist branch July 21, 2018 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants