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

Add manual "mark spam" button for admins #750

Closed
wants to merge 1 commit into from

Conversation

ldwiyono
Copy link
Contributor

@ldwiyono ldwiyono commented Aug 6, 2024

Added a manual "Mark spam" button as a template macro for admins to update ModeratedContent (Events, Jobs, Codebases) as spam. Possible further additions might be adding a notes field for users to add further details about the spam submission? Resolves comses/planning/issues/255.

Current appearance on desktop for events:
image

Please let me know about any feedback on this pull request or the button's functionality.

@sgfost
Copy link
Contributor

sgfost commented Aug 6, 2024

I'll test it out to make sure but the code LGTM, thanks Luke. The commits can be cleaned up, I guess just merged into 1 since the other 5 are adding/reverting test stuff. You can do this with an interactive rebase (can show you this tomorrow if you don't do it before)

In the meantime, the notes field might be a good addition. Should be fairly straightforward--just adding a textarea to the form and retrieving it from the request data

Copy link
Member

@alee alee left a comment

Choose a reason for hiding this comment

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

Good work! A few git issues however that must be addressed:

  1. don't submit a PR from your main branch. Create a new feature branch and set up your commits and changesets there. Otherwise you will run into problems keeping your main branch properly synced up with upstream
  2. keep your git history clean, we will only accept PRs that have a clean, linear history of relevant commits. In this case you can squash them all into a single commit but for the future you'll probably want to develop a better conceptual model of how git works and how to maintain a clean commit history: https://about.gitlab.com/blog/2020/11/23/keep-git-history-clean-with-interactive-rebase/

I don't think we need the "manually" part of the manually-mark-spam viewset method and corresponding endpoint. Let's leave it as "mark_spam" / "library:codebase-mark-spam"

Adds mark_spam_confirm_modal in core folder to be implemented for Events, Jobs, Codebases. Essentially resolves comses/planning/issues/255, however improvements in UX and further functionalities are still possible.
@ldwiyono
Copy link
Contributor Author

ldwiyono commented Aug 7, 2024

I've squashed all the commits into one, including the "manually" name change you requested. Would you like me to close this pull request and open a new one from a non-main branch?

@ldwiyono ldwiyono closed this Aug 7, 2024
@ldwiyono
Copy link
Contributor Author

ldwiyono commented Aug 8, 2024

Hi, I wanted to check before I opened a new pull request: does this look okay for the added notes field?
image

@sgfost
Copy link
Contributor

sgfost commented Aug 8, 2024

use the bootstrap form classes for the styling https://getbootstrap.com/docs/5.0/forms/overview/

no need to hold off on the PR though

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.

3 participants