Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

WIP: Inline Moderation #120

Closed
wants to merge 35 commits into from
Closed

WIP: Inline Moderation #120

wants to merge 35 commits into from

Conversation

wpillar
Copy link
Contributor

@wpillar wpillar commented Apr 27, 2015

This PR contains the WIP of inline moderation for posts and topics. See the issue here #45 for the tools that it has implemented.

Would like some QA and feedback whilst I tidy things up, then I'm going to open a PR with a view to being merged. Once this work is merged I will crack on with the rest of the items in the above issue.

  • Fix build.
  • When you unapprove a topic the first post is also unapproved but if you approve the first post the topic isn't approved which feels inconsistent.
  • Closing a topic should hide the quick reply and throw an error on the full reply page as long as the user doesn't have permission to reply to closed topics (which should at least show a warning)
  • If you select one topic, click on "clear selection" and then select another topic the moderation bar doesn't pop up
  • Address in-line comments
  • File headers
  • Tests covering new classes
  • Tests covering new methods
  • Move moderation JS out of other.js and into moderation.js
  • Move icon methods onto presenters

*/
public function moveTopicToForum(Topic $topic, Forum $forum)
{
return $this->decoratedRepository->moveTopicToForum($topic, $forum);
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs to update the cache (simply call forget for now), otherwise the other functions will return invalid data.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok cool, thanks.

@JN-Jones
Copy link
Contributor

Some other things I've noticed:

  • The checkbox column should be smaller
  • "Clear selection" doesn't change the checkbox status
  • Close/Open and Unapprove/Approve should only be shown if possible (eg hide "Open" if only open topics are selected)
  • The forum dropdown when moving should get some indention (like in 1.x)
  • Unapproved posts/topics should be ignored in the last discussions table
  • Restoring posts/topics should be added
  • When you unapprove a topic the firstpost is also unapproved but if you approve the firstpost the topic isn't approved which feels inconsistent
  • closing a topic should hide the quickreply and throw an error on the full reply page as long as the user doesn't have permission to reply to closed topics (which should at least show a warning)
  • I can't click on the moderations bar as long as it's over the quickreply textarea
  • The Merge link doesn't seem to work
  • The move modal should also accept a link and get the id out of it (there are laravel classes to do so, similar to the wio page does)
  • If you select one topic, click on "clear selection" and then select another topic the moderation bar doesn't pop up
  • The selected topics/posts should be saved in a cookie eg to merge two posts from different topics or to merge two posts on two pages

That's what I found while playing with the code a bit. Sorry if you're already aware of some of them ;)

@wpillar
Copy link
Contributor Author

wpillar commented Apr 28, 2015

@JN-Jones Thanks man!

I'm not really worrying about the front-end tbh, it's not my area of expertise so I'm kinda making it work and not look horrendous on the basis that we will create separate issues to improve the front-end. What do you think?

Close/Open and Unapprove/Approve should only be shown if possible (eg hide "Open" if only open topics are selected)

Yup, I've thought about this but I don't think that blocks this PR, as above I think creating a new issue to improve the front-end is the best course of action once this is merged.

Unapproved posts/topics should be ignored in the last discussions table

Sure, don't think that is an issue for this PR though.

Restoring posts/topics should be added

Yup, will add to #45 for future PRs.

When you unapprove a topic the firstpost is also unapproved but if you approve the firstpost the topic isn't approved which feels inconsistent

Thanks, will fix that.

closing a topic should hide the quickreply and throw an error on the full reply page as long as the user doesn't have permission to reply to closed topics (which should at least show a warning)

Happy to this in this PR. Can the permissions system do this right now? Or will it have to wait?

The Merge link doesn't seem to work

What are the steps to reproduce?

The move modal should also accept a link and get the id out of it (there are laravel classes to do so, similar to the wio page does)

Actually I think we can be smarter and provide an autocomplete type-ahead feature for this. For now though I'd like to merge as is and tackle this in a separate issue / PR if that's ok?

If you select one topic, click on "clear selection" and then select another topic the moderation bar doesn't pop up

I'll have a look at the clear selection link in this PR, thanks.

The selected topics/posts should be saved in a cookie eg to merge two posts from different topics or to merge two posts on two pages

Agreed, would also like to tackle this in a separate PR.

The aim is to provide basic working inline moderation that we can iterate on with future PRs and issues. Keen to avoid a long-running branch that falls foul of conflicts over time.

@JN-Jones let me know what your thoughts are on what I've said, then I can put together a list of things to address in this PR and what we're happy to leave for future PRs. I will happily create the issues for future work so we do not forget the good ideas in this PR.

@JN-Jones
Copy link
Contributor

I'm fine with seperate issues/PRs, did the same already with my PRs.

About styles: Feel free to add them on trello: https://trello.com/b/NFeiW7em/mybb-2-0-styles

Can the permissions system do this right now?

Yes. The permissions system has three types of permissions: yes/no where yes overrides no and never which is never overwritten. Simply add a new permission related to forums, 0 as default value and then add the admin role with value 1.

The Merge link doesn't seem to work

What are the steps to reproduce?

I've selected one post, selected the second, clicked on the link and nothing happened.

@wpillar
Copy link
Contributor Author

wpillar commented Apr 28, 2015

Thanks buddy, I'll add a to-do list to the PR tonight and work through it this week.

@JN-Jones
Copy link
Contributor

JN-Jones commented May 8, 2015

About the merge link:

http://localhost/moderate Failed to load resource: the server responded with a status of 500 (Internal Server Error)

(Un)approving any post will also change the status of the topic.

@@ -209,6 +210,10 @@ public function reply($slug, $id, Request $request, $postId = null)
throw new TopicNotFoundException;
}

if ($topic->closed) {
throw new \Exception("This topic has been closed");
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be translatable and a real exception class instead of throwing a basic exception

@JN-Jones
Copy link
Contributor

The file headers need to be updated now ;)

@wpillar
Copy link
Contributor Author

wpillar commented May 10, 2015

Closing for refurbishment.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants