Commit graph

29 commits

Author SHA1 Message Date
Robert Chang
704eb4f5df
Update FeedbackMessagesController#create feedback-response-sent-at cache key (#19287) 2023-04-05 13:05:12 -04:00
yheuhtozr
c4778d832e
app/controllers & decorators i18n (#16126)
* app/controllers (& decorators) i18n etc

* tidy key names

* update keys

* delete ja.yml

* delete an involved ja.yml

* fix for PR review

* fix for spec

* delete ja.yml
2022-02-03 13:35:56 -05:00
Daniel Uber
f2a8cbce7e
Remove "connect" feedback message special treatment (#16167)
* Remove special handling of "connect" feedback by name

The special casing was related to "connect" feedback having both a
reporter and an offender. Check for offender instead.

Additionally, there was special casing in the controller to rate-limit
connect feedback separately from other channels. Since connect doesn't
exist, we should not need this.

There's a small bit of functionality (when I post to feedback_messages, the
number of feedback messages increases) that was removed from the test
case, we can add that back (and "connect" type, and
offender_id attributes) since it looks like it might have been a
useful assertion.

* Add back feedback message controller creates feedback message case

This was removed in the last commit because it was in a "connect" chat
channel context, but the basic "should persist a record" test was
otherwise valid. Submit an abuse-report rather than a connect message
report.

* typo

feeedback, woops.
2022-01-19 08:32:10 -06:00
praveen raghav ns
4b8576aec3
Use constants for Permitted params in controller (#14895)
* Use constants for controller permitted params

* User constants for controller set 2

Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2021-10-05 09:00:14 -04:00
Angel Barros
bb8b32bdf2
Zappat0n/add rate limit model everywhere 11500 (#14609)
* Create showModalAfterError function

* Show modal when comments rate limit is reached

* Show modal when article reaction rate limit is reached

* Show modal when follow user rate limit is reached

* Show form error when listing creation rate limit is reached

* Show form error when feedback messages rate limit is reached

* Rename functions for listings rate limit checks

* Show modal when notifications reaction rate limit is reached

* Show modal when picture upload rate limit reached

* Show modal for reactable objects when rate limit reached

* Add and modify tests

* empty commit

* Match modal messages to tests

* Fix error updating Modals

Co-authored-by: Dan Uber <dan@forem.com>
2021-09-23 10:49:19 +01:00
dependabot[bot]
816855ce3b
Bump rubocop from 1.17.0 to 1.18.0 (#14107)
* Bump rubocop from 1.17.0 to 1.18.0

Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.17.0 to 1.18.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.17.0...v1.18.0)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* yarn install

* Fix violations

* Restore the default aligned setting

* Trigger Travis CI

* Escape HTML

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: rhymes <github@rhymes.dev>
2021-07-01 13:51:49 +02: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
5406b0576e
Split Settings::Authentication from SiteConfig (#13095)
* Split Settings::Authentication from SiteConfig

* Move specs

* Sort fields

* Update settings usages

* Update recaptcha usages

* Add data update script

* Update spec

* Rename SiteConfigParams concern

* Fixes, new route, new controller

* Controller and service refactoring

* More controller and service updates

* Spec updates

* More spec fixes

* Move file

* Fix FeedbackMessagesController

* Update admin/configs_spec

* Fix remaining specs in admin/configs_spec

* Fix configs API

* Formatting

* Clean up old service object

* Various fixes

* Update DUS

* Add model argument to admin_config_label

* Fix key name

* Fix specs

* Add distinct request caches for settings classes

* Fix e2e tests

* Fix remaining system spec

* Make DUS idempotent

* Move routes block

* Cleanup

* Switch to ActiveSupport::CurrentAttributes

* Pinned rails-settings-cached

* Update e2e test

* Update lib/data_update_scripts/20210316091354_move_authentication_settings.rb

Co-authored-by: rhymes <rhymes@hey.com>

* Add guard to DUS

* Temporarily re-add two SiteConfig fields

* Fix config show view

Co-authored-by: rhymes <rhymes@hey.com>
2021-04-12 09:41:09 +02:00
Anna Buianova
d2d1529185
Email confirmation to abuse reports (#12557)
* Notify user that the feedback was received

* Feedback response templates

* Specs for user feedback notification
2021-02-03 22:59:50 +03:00
Nick Taylor
86eb75cee7
Report a Message in Connect (#12229)
* Frontend Ready for Connect Report Abuse

* add feedback api

* js defination fix

* Added Hooks to the Component

* add json response in feedback

* Block popup added

* fix render issue

* Made changes in internal view

* change error message

* Added few design changes =

* add test cases

* Update app/javascript/chat/actions/requestActions.js

Co-authored-by: Nick Taylor <nick@iamdeveloper.com>

* add PR suggestions

* add backend test cases

* report abuse form close

* Update app/javascript/chat/actions/requestActions.js

Co-authored-by: Nick Taylor <nick@iamdeveloper.com>

* Update app/javascript/chat/ReportAbuse/index.jsx

Co-authored-by: Nick Taylor <nick@iamdeveloper.com>

* add test cases

* Update app/javascript/chat/ReportAbuse/index.jsx

Co-authored-by: Nick Taylor <nick@iamdeveloper.com>

* Update app/javascript/chat/ReportAbuse/index.jsx

Co-authored-by: Marcy Sutton <holla@marcysutton.com>

* Update app/javascript/chat/ReportAbuse/index.jsx

Co-authored-by: Marcy Sutton <holla@marcysutton.com>

* group the fieldset

* fix report abuse api

* fix test case

* fix request test case

* fix typo

* cleaned up markup in report abuse component.

* Fixed spacing between abuse options.

* Fixed wording in report abuse confirmation.

* Removed unnecessary data-testid and aria-label attributes.

* Added some top margin to the report abuse form.

* Update app/javascript/chat/message.jsx

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Added a legend to the the fieldset.

* Update app/javascript/chat/actions/requestActions.js

Co-authored-by: Michael Kohl <citizen428@dev.to>

Co-authored-by: Sarthak <7lovesharma7@gmail.com>
Co-authored-by: Narender Singh <narender2031@gmail.com>
Co-authored-by: Marcy Sutton <holla@marcysutton.com>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
Co-authored-by: Michael Kohl <citizen428@dev.to>
2021-01-19 12:07:47 -05:00
Fernando Valverde
b02262c563
Split ReCaptcha service and use verbs instead of pronouns (#11706)
* Split ReCaptcha service and use verbs instead of pronouns

* Inline comment rewrite for clarify

* after? > >

* Use explicit role check for the user instead of .auditable?
2020-12-02 16:50:42 -06:00
Fernando Valverde
494af84e83
Refactor reCaptcha code and bypass in report abuse for trustworthy users only (#10502)
* Bypass recaptcha for authenticated users abuse reports

* Moves bypass_recaptcha? to helper method to have one definition of the criteria for this

* User must be 1 month old at least in order to bypass_recaptcha?

* Fixes test

* Better spec message

* Bypasses auditable users

* Adds better test coverage over recaptcha bypass cases

* include Helper removed from FeedbackMessagesController

* Adds some inline comments for clarity and banned check
2020-12-02 08:55:47 -06:00
Andy Zhao
6c20a70aef
[deploy] Add recaptcha keys to as site-configurable keys (#10736)
* Add recaptcha keys to as site-configurable keys

* Add recaptcha to site config view

* Use site config key

* Make ReCAPTCHA tag optional if keys are blank

* Use proper capitalization of recaptcha

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>

* Refactor logic for readability

* Use proper capitalization of recaptcha

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>

* Use proper capitalization of recaptcha

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>

* Use proper capitalization of recaptcha

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
2020-10-08 17:16:00 -04:00
Alberto Pérez de Rada Fiol
2660c76fca
Fix erblint errors on the app/views/pages folder (#8401) 2020-06-11 15:46:50 +02:00
Molly Struve
d1e39a7dba
[deploy] Rate Limit Feedback Message Creation (#7832) 2020-05-14 12:00:22 -05:00
rhymes
e9e4059ad3
Add Slack messengers: part 1 (#6748)
* Add Slack::Announcer and SlackClient

* Add Slack::Messengers::Feedback class

* Use Slack::Messengers::Feedback and refactor test

* Should not raise an error if params are nil, let the job fail

* Add Slack::Messengers::Sponsorship

* Rename spec

* Use Slack::Messengers::Sponsorship

* Add Slack::Messengers::PotentialSpammer

* Use Slack::Messengers::PotentialSpammer

* Add Slack::Messengers::RateLimit and use it

* Refactor a bit and improve tests

* Add Slack::Messengers::Note and use it

* Use Slack::Announcer and fix spec

* Fix specs

* Update app/services/slack/announcer.rb

Co-Authored-By: Vaidehi Joshi <vaidehi.sj@gmail.com>

* Implement review suggestions

* Empty commit to trigger Travis

Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
2020-03-24 18:45:40 +01:00
Andy Zhao
3412883342
Upgrade recaptcha to 5.4.1 to fix production error (#6681) [deploy]
* Use legacy 5.3.0 response param name

* Use latest recaptcha gem

* Remove additional space

* Revert verify_recaptcha workaround
2020-03-18 10:27:48 +01:00
Ben Halpern
2add3ae300
Replace dev.to with ApplicationConfig in a few locations (#6008) [deploy]
* Replace dev.to with ApplicationConfig in a few locations

* Update app/labor/badge_rewarder.rb
2020-02-11 14:48:27 -05:00
Jess Lee
5bacb4e8c1 Removed bug reports from app (#1565)
* remove bug report form and add github link

* update abuse report email templates

* remove bug-report logic

* remove emoji from form

* remove revised500 page
2019-01-16 11:28:59 -05:00
rhymes
6553f08d94 Rubocop cleanups (#1415)
* Update rubocop-todo.yml with new violations

* Fix Layout/EmptyLine* rules

* Fix Layout/Indentation* rules

* Fix remaining Layout/* rules

* Fix Lint/DuplicateMethods by removing unused accessor

* Fix Lint/IneffectiveAccessModifier

* Fix Lint/MissingCopEnableDirective

* Re-run rubocop auto gen config

* Fix Layout/RescueEnsureAlignment

* Fix Naming/* rules

* Fix some RSpec/* rules

* Fix typos

* Fix RSpec/LetBeforeExamples

* Series should only be an attr_writer, not an attr_accessor

* Fix RSpec/InstanceVariable

* Fix RSpec/InstanceVariable

* Fix RSpec/RepeatedDescription and RSpec/RepeatedExample

* Fix Style/ClassAndModuleChildren

* Fix Style/ConditionalAssignment

* Fix some Style/* rules

* Trigger Travis CI build because failing tests are not failing locally

* Revert "Fix Style/ClassAndModuleChildren"

This reverts commit 1686801d8a1516ba1894f79e24401a20dea65f99.
2019-01-02 11:20:02 -05:00
Andy Zhao
5814d0a263 Add slack notifications to notes for reports (#660)
* Remove extraneous string conversion

* Add slack message for new notes

* Move status and minimize buttons to the bottom

* Add note model spec

* Remove extraneous param for reported links
2018-09-25 14:36:54 -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
468ffd5fc2 Temporarily remove email notification and status page (#657) 2018-08-06 10:53:43 -04:00
Mac Siri
40f488d991 Migrate to Travis CI (part 2) (#591)
* Update Travis.yml

* Update README

* Update README

* Adjust test to not rely on env vars

* Update encryption

* Refactor

* Update env key

* Stub AWS calls

* Create ApplicationConfig

* Fix specs

* Fix lint

* Update ApplicationConfig

* Remove travis env vars

* Fix lint

* Extend character limit to 100

* Add env to travis

* Take out auto-restart after deploy

* Immediately discarded test cache

* Stub GA in request specs

* Stub Pusher

* Fix broken specs

* Update fixture

* Add CodeClimate id

* Change CodeClimate key

* Remove merge mistakes

* WIP

* Add Envied gem & Change README

* Add missing keys

* Add missing key

* Update fixture

* Fix broken spec

* Add Slack Notification for Travis

* Fix wording

* Fix typo
2018-07-20 20:17:18 -04:00
Andy Zhao
749ffabbe7 [Done] Adjust abuse reports (#540)
* Fix bad formatting of links

* Change spam bot to post in potential-spam

* Add internal report link to Slack message
2018-07-05 11:16:11 -04:00
Andy Zhao
cd9f6d9ada [Done] Add BDEFGI Policies and Specs (#487)
* Add comment for public controllers

* Add block policy and specs

* Add policy for authorizing dashboard

* Add follow policy and specs

* Refactor a tiny bit

* Prevent banned users from following anything

* Add a note for email sub controller about auth

* Add image upload policies

* Add policy for github repos

* Fix typo and use correct github repo variable

* Fix image uploader and use regular params

* Add authenticate_user before action back in

* Rename test

* Update slack bot message formatting and fix reported URL
2018-06-26 09:23:07 -04:00
Andy Zhao
263a74bcb6 Add more request specs (#460)
* Remove email blank onboarding redirect

* Add authorization specs for video upload

* Add registration spec

* Remove skip before actions for signup complete

* Use new param for abuse reports

* Remove else because it never runs

* Add more dashboard request specs

* Use let with no bang in case there are errors
2018-06-20 17:46:23 -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