Commit graph

18 commits

Author SHA1 Message Date
Jacob Herrington
c7e0b496ba
Add open reports count to admin overview (#13346)
* Add open reports count

* Conditionally pluralize open reports copy

* Add new scope to FeedbackMessage
2021-04-12 12:03:11 -05:00
Andy Zhao
f0d9149bf1
[15-min-fix] Better feedback messaging (#13254)
* Add validation errors to flash msg

* Use constants for static strings

* Use constants in test
2021-04-12 09:05:45 -04:00
Michael Kohl
2a72dc9951
Remove unused method (#11226) 2020-11-02 10:45:02 -05:00
rhymes
5ba8c44b05
[deploy] Add missing foreign keys to ahoy_messages and articles (#10321)
* Add FK between ahoy_messages and feedback_messages

* Add FKs between articles.second_user_id, articles.third_user_id and users

* Fix associations and specs

* Add more validations

* Remove FKs to articles.second_user_id and .third_user_id as they are about to be removed
2020-09-16 19:47:03 +02:00
Julianna Tetreault
31990b3d3b
Add Recent Reports to Users' Admin User Page (#10058) [deploy]
* Adds _reports partial and renders _reports.html.erb in /admin/users/edit.html.erb

* Adds a Recent Reports sections and a toggle function to /admin/users/_reports

* WIP: display feedback_messages in _reports.html.erb

* Adds #set_feedback_messages to Admin::Users::Controller and adjusts _reports.html.erb

* Adjusts #set_feedback_messages to look for message ids and adds to _reports.html.erb data

* Remove accidental dead code from Admin::Users::Controller

* Adjusts the else statement wording to be more fun

* Adjusts style of recent reports to mirror style of recent reactions

* Implement Admin UI changes to Recent Reports section of admin/users/:id/edit

* Adds a link to the admin_feedback_messages_path for each report in _reports.html.erb

* Adjusts the path used when a report is clicked on in _reports.html.erb

* Adds #user_types check to feedback_message.rb to determine Affected, Offender, or Reporter in _reports
2020-09-03 12:06:15 -06:00
rhymes
c753375daa
Routine rubocop fixes (#8685)
* rubocop -a

* rubocop --auto-gen-config

* Fix spec
2020-06-16 11:09:15 +02:00
Molly Struve
815248884c
[deploy] Enforce Uniq Abuse Reports from Reporters (#7831) 2020-05-14 09:03:10 -04:00
Andy Zhao
50ba93c232
[deploy] Add character limits for reported_url and message (#7283)
* Add character limits for reported_url and message

* Use one line for reported_url validation

* Revert accidental removal of index line

* Adjust length limits to account for production values
2020-04-14 15:57:21 -04:00
Andy Zhao
ea1c0b85af
Add single resource admin roles for a few internal pages (#7202)
* Add resourcify to allow single resource admin access

* Override application_controller resource b/c custom name

* Don't resourcify audit log because moderator actions model exists

* Add tests for checking single resource admin access

* Use rails path helpers

* Add happy path spec for single resource admin, negative reactions
2020-04-10 12:51:19 -04:00
Anna Buianova
01456fe029 [deploy] Finalize deleting user associations (#5624)
* Prepare factories and associations for Users::DeleteActivity specs

* Altered user associations, delete the needed associations in Users::DeleteActivity

* Moved and refined user deletion spec

* Removed useless commented user associations

* Refactored BackupData factory

* Refactored ProfilePin factory

* Refactored Reaction factory

* Fixed specs: Keep default _type in factories or specify it in tests

* Ok, notes shouldn't be deleted on user deletion

* Fixed creating reactable for specs

* Specify commentable/commentable_type explicitly when creating data for tests

* Fixed typo in the comments spec

* Removed unnneeded space

* Added aggregate_failures for testing user associations deletion

* Keep feedback_messages while deleting user activities
2020-01-23 11:29:47 -05:00
Jess Lee
a6d92c702b Add report abuse link to listings (#2684)
* add report abuse link

* add listings category on abuse form

* include listings category
2019-05-04 09:06:42 -04:00
Abraham Williams
9cb40e546b Enables Rails cops (#2186)
* Enable Rails cops

* Fix Rails/DynamicFindBy

* Fix Rails/HttpStatus

* Fix Rails/Blank

* Fix Rails/RequestReferer

* Fix Rails/ActiveRecordAliases

* Fix Rails/FindBy

* Fix Rails/Presence

* Fix Rails/Delegate

* Fix Rails/Validation

* Fix Rails/PluralizationGrammar

* Fix Rails/Present

* Fix Rails/Output

* Fix Rails/Blank

* Fix Rails/FilePath

* Fix Rails/InverseOf

* Fix Rails/LexicallyScopedActionFilter

* Add Rails/OutputSafety to TODO

* Add Rails/HasManyOrHasOneDependent to TODO

* Add Rails/SkipsModelValidations to TODO
2019-03-25 09:25:55 -04:00
Keshav Biswa
8d57d45ecc Rubocop Style cops enabled (#2056)
* Rubocop enabled style/alias

* Enabled Style/ArrayJoin Cop

* Enabled Style/Attr

* Enabled Case Equality

* Enabled CharacterLiteral

*  Enabled ColonMethodCall Cop

* Enabled CommentAnnotation cop

* Enabled PreferredHashMethods Cop

*  Enabled DoubleNegation Cop

* Enabled EachWithObject Cop

* Enabled EmptyLiteral Cop

* Enabled EvenOdd Cop

* Enabled IfWithSemicolon Cop

* Enabled Lambda and LambdaCall Cop

* Enabled LineEndConcatenation Cop

* Enabled ModuleFunction Cop;

* Enable NegatedIf and NegatedWhile Cop

* Enabled NilComparison Cop

* Enabled Not Cop

* Enabled NumericLiterals Cop

* Enabled OneLineConditional Cop

* Enabled PercentLiteralDelimiters Cop

* Excluded internal/users_controller from negated_if cop

* Reverted the double negation change from github_issue_tag and github_issue.rb"

* Enabled PerlBackrefs Cop

* Changed Regexp.last_match(1) to Regexp.last_match(0)

* Enabled proc cop

* Enabled RaiseArgs Cop

* Reverted Regexp.last_match(0) to Regexp.last_match(1)

* Enabled SelfAssignment Cop

* Enabled SingleLineMethods Cop

* Enabled SpecialGlobalVars Cop

* Enabled VariableInterpolation Cop

* Enabled WhenThen Cop

* Enabled WhileUntilModifier Cop

* Enabled WordArray Cop

* Enabled IfUnlessModifier Cop

* Enabled GuardClause Cop
2019-03-15 18:33:54 -04:00
Andy Zhao
c9efc7a2b2 Fix repeated queries for reports (#835)
* Fix repeated queries for reports

* Load stylesheet once by moving into index

* Remove unused method

* Remove unused code again and update method

* Use better name for migration and add indices

* Use latest schema version oops

* Add missing column to query
2018-10-09 12:42:55 -04:00
Maksim Litvinov
33db32e5f4 Fix rubocop lints (#794) 2018-10-03 13:00:09 -04:00
Andy Zhao
22c9714919 V2 of Reports System (#441)
* Fix weird breakpoint top-nav issue

* Fix error handling when submitting blank note

* Change status closed to invalid

* Add ability to sort between status

* WIP

* Add working views for new report page

* Add mailer WIP

* Add MVP of new reports system

* Move collapse to the right & add show page link

* Fix buttons for index page

* Change collapse to collapse/expand

* Remove email functionality from new report

* Update copy of report abuse responses

* WIP of showing emails in reports

* Fix notes for user_role_service.rb

* Remove unused scripts from internal.html.erb

* Update tests for reports dashboard

* Add missing migration file

* Add finishing touches to reports dashboard

* Remove deprecated methods

* Update view with better timestamps

* Update and write new tests

* Add .codeclimate.yml

* Remove commented out editor thing

* Undo commented out code for recaptcha method

* Undo comment out code for development

* Use new comment path instead of old comment path
2018-09-04 17:08:41 -04:00
Andy Zhao
ecbb9d4ab1 [Done] New Reporting System MVP (#408)
* Move validations from controller to model

* Add new columns to feedback message model

* Use polymorphic notes relationship

* MVP of ticketing system

* Use new URL for reported_url param

* Add missing files

* Add validations and tests for feedback_messages

* Clean up some html

* Update create spec and add update spec

* Add mail tests and lint

* Add link to user profile
2018-06-19 16:41:31 -04:00
Mac Siri
301c6080e3 Initial commit 2018-02-28 16:11:08 -05:00