Commit graph

5648 commits

Author SHA1 Message Date
Vaidehi Joshi
f04b0a7336
Display site-wide announcements (#8301)
* Serialize broadcast_data within AsyncInfoController::base_data

Adds a `broadcast:` key to our `base_data`, regardless of whether a user is logged in or not.
If a broadcast is not present, passes along a `nil` value.

* Initialize active broadcast (if present) when rendering main page

* Allow admins to preview a broadcast's processed_html when editing

* Add some fixed position styling to active broadcast

* Add system specs around broadcasts on homepage

* Use sanitize in place of html_safe when previewing broadcast

* Do not initialize broadcast if no broadcastData available

* Render default value on broadcast in options_for_select

* JS cleanup

* Unset fixed positioning for static navbar config

Also add some default styling for an active broadcast
2020-06-08 13:52:53 -04:00
Andy Zhao
885e042d31
[deploy] New Feature: Mod Actions Panel (#7777)
* db

* Add an iframe to host mod actions menu

This iframe is probably the fastest way to get a working mod actions
menu without rewriting existing code. We may eventually re-write this,
but based on Ben's recommendation we are going to go with an iframe
because it gets us a working feature quickly and it seems to be serving
us well in other parts of the application.

* Add the mod actions menu button to articles

When the user is "trusted" they will see a small badge on the lower
right-hand side of the screen. Clicking the icon reveals the mod actions
menu.

* Add header to actions panel (#7395)

* Update iframe border

* Add 'Moderate Post' header and button

* Use inline SVG over <img src='svg'>

* Use Crayons variables for units

* Use flexbox to center chevron

* Add accidentally deleted positioning

* Add chevron-right.svg

* Use a partial for actions panel and revert /mod page

* Load actions panel in iframe and not /mod

* Style UpVote, DownVote and Vomit buttons (#7421)

* Add a iframe to host mod actions menu

* Up and Downvote Icons

* Starting with vomit button

* Completed UI; interactions pending

* Incorporated Andy changes; making mod action-panel

* space reactions away from header

* UI tweaks and corrections 1

* Fixing styles to match crayons

* choose pure white color css variable

* Add thumbs-up emoji; address Lisa comments

* Trying to fix reactions interactions

* remove clearThumbReactions function

Co-authored-by: jacobherrington <jacobherringtondeveloper@gmail.com>

* Add bottom layout for actions panel (#7501)

* WIP for Lisa

* Finalize mod actions bottom section

* Use showing instead of hidden for transition

* Add new optimized SVGs

* Fix weird height issues for actions panel

* Move hover styles below the cascade, yo

* Use margin-top for sticky footer over height: 100%

* Move initialize actions panel button to Webpack (#7506)

* Move actions panel JS code to webpack

* Refactor and use destructuring

Thanks @nickytonline!

Co-Authored-By: Nick Taylor <nick@iamdeveloper.com>

* Rename file

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

* Configure Experience Level options for Mod Action Panel (#7507)

* Add a iframe to host mod actions menu

* Click interactions (no toggle of dropdowns yet)

Co-authored-by: jacobherrington <jacobherringtondeveloper@gmail.com>

* Fix the iframe's path (#7509)

* Toggle the 'Set Experience Level' menu on button-click (#7529)

* Add a iframe to host mod actions menu

* Add set-exp dropdown functionality

* WIP: making exp level updates async

* Completes async implementation

* Fix controller for "actions_panel" and "/mod"

Co-authored-by: jacobherrington <jacobherringtondeveloper@gmail.com>

* Add close button interaction (#7552)

* Rename actions panel pack file

* Add close button toggle to actions panel

* DB update

* Move more code to Webpack and add conditional tag adjustments section (#7652)

* Move JS code to Webpack

* Clean up a few style issues

* Add styling for tag adjustments

* Add active/inactive functionality

* Add conditional rendering for tag adjustments section

* Add missing variable oops (#7673)

* update with upstream

* Add missing subtract svg (#7695)

* Create 'Flag User' modal (#7626)

* Add a iframe to host mod actions menu

* Starting task

* Phase 1

* Fix "Close Modal" icon

* Implement open modal

* Working on all "Close Modal" actions

* Almost-complete implementation

* Remove Abuse Report snackbar

* Delete unneeded JS code

* Remove "How does this work?" links

* Link to Community Moderation page

* Addressing code review corrections

* Update api call to use "request" method

* Make else path clearer in api call

Co-authored-by: jacobherrington <jacobherringtondeveloper@gmail.com>

* Mod Actions Panel: Prevent nonsensical reaction pairs (#7699)

* Still implementing

* Completed Implementation

* Address code review feednack; refactor "create" method

* Move scss variables to native-css (for ModPanel code only)

* Correct missing native css

* update to native-css again

* More sccs -> native-css fixes

* Adjust ModPanel Button position on mobile (#7744)

* Adjusted ModPanel position on mobile

* Better adjustment

* Fix phantom schema.rb changes

* Fix phantom schema.rb changes

* Finalize tag adjustments (#7740)

* Finalize tag adjustments and flow

* Fix logic for rendering adjust tags options

* Clean up alert response

* Rename user to trusted user

* Use new CSS variables

* Add/remove tag on article's tag section after adjusting

* Fix logic for admin tag input and some other niceties

* Final bug fixes mod panel (#7772)

* Use correct boolean statement

* Clear the value of the textarea not div

* Use the correct attribute

* Use actions panel for /mod page (#7775)

* Fix loading logic with tag adjust button conditional render

* Link to tag moderation for adjust tags section

* Use top over window.parent

Thanks @nickytonline!

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

* Use Webpack alias to import

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

* Use place-items shorthand over align-items + justify-content

Thanks @nickytonline!

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

* Fix typo for utilities

* Add new line to end of file

* Disable linter for use for top function

* Use align-items and justify-content center

* Update SVGs to spec

* Remove unnecessary height and use spacing units for open button

* Remove accidentally added comment

* Error handling when selecting reactions; optimize "reactions.each" loop

* Add comment about clearing innerHTML

* Revert schema back to master

* Use each since there should only be two reactions

* Fix typo oops

* Add missing height oops

* Return if there are no reactions to be destroyed

* Center path with GUI tool shrug

* chose more appropriate name for JS pack; rewrote api calls using async-await

* Rename variables and methods and check categories before clearing

* Use addSnackbarItem instead of hardcoded version

* Place articleModerationTools pack behind user_signed_in

* Correct omission

* Implement dynamic imports for ModPanel tools

* Implemented async/await; added snackbar message for null response use-case

* Fix the "/article/mod" page; make sure all reactions, vomit-user and exp-level working as expected

* Update language to reflect new UI

* Close the modal after the "Confirm Action" button is clicked

* Change text for Spam/Abuse button

* Fix schema to use with master

* Update schema to master again

* Use crayons button for actions panel button

* UI tweak to play nicer with site themes

* Make actions panel work for dev.to/mod

* Add snackbar for reactions

* Update how does this work links

* Add "thumbsup" reactions to logging

* Add thumbsup to categories

* Add external link icon

* Changes to reflect "Privileged" and not "Negative" reactions; spec changes pending

* Updated instance variable

* Starting to update the specs

* Update "thumbsup" points from 10 to 5

* Still working on both requests

* Embracing an easier implemantation (thanks Andy!)

* Add tests for actions panel

* Add some basic tests for actions panel

* Change to flag to admins

* Indicate that 'Reason for Tag adjust' is required

Co-authored-by: Mac Siri <krairit.siri@gmail.com>

* Rename negative_reactions to privileged

* Update rating level to use correct values

* Use a different display value than backend value

* Don't show adjust tags for trusted users

* Add specs for moderation_routes for admin and super_admin

Co-authored-by: Arit Amana <msarit@gmail.com>
Co-authored-by: jacobherrington <jacobherringtondeveloper@gmail.com>
Co-authored-by: Arit Amana <32520970+msarit@users.noreply.github.com>
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
Co-authored-by: Mac Siri <krairit.siri@gmail.com>
2020-06-08 13:24:18 -04:00
dependabot-preview[bot]
6d684f018f
[Security] Bump websocket-extensions from 0.1.3 to 0.1.4 (#8302) 2020-06-08 12:43:21 -04:00
dependabot-preview[bot]
05f0879813
Bump lint-staged from 10.2.7 to 10.2.9 (#8328) 2020-06-08 12:42:16 -04:00
Molly Struve
77543ff87d
[deploy] Spec Speed Up: Comment Out Percy Only Specs (#8347) 2020-06-08 10:54:39 -05:00
rhymes
4ab6d02d2f
Routine rubocop fixes (#8346)
* rubocop -a

* rubocop --auto-gen-config
2020-06-08 17:37:25 +02:00
dependabot-preview[bot]
c150a46d47
Bump rubocop-performance from 1.6.0 to 1.6.1 (#8320)
* Bump rubocop-performance from 1.6.0 to 1.6.1

Bumps [rubocop-performance](https://github.com/rubocop-hq/rubocop-performance) from 1.6.0 to 1.6.1.
- [Release notes](https://github.com/rubocop-hq/rubocop-performance/releases)
- [Changelog](https://github.com/rubocop-hq/rubocop-performance/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop-hq/rubocop-performance/compare/v1.6.0...v1.6.1)

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

* Bump rubocop-performance from 1.6.0 to 1.6.1 (Update vendor/cache)

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-06-08 11:31:06 -04:00
dependabot-preview[bot]
e839607b70
Bump blazer from 2.2.4 to 2.2.5 (#8319)
* Bump blazer from 2.2.4 to 2.2.5

Bumps [blazer](https://github.com/ankane/blazer) from 2.2.4 to 2.2.5.
- [Release notes](https://github.com/ankane/blazer/releases)
- [Changelog](https://github.com/ankane/blazer/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ankane/blazer/compare/v2.2.4...v2.2.5)

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

* Bump blazer from 2.2.4 to 2.2.5 (Update vendor/cache)

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-06-08 11:29:18 -04:00
dependabot-preview[bot]
17b3eaed5e
Bump sitemap_generator from 6.1.1 to 6.1.2 (#8324)
* Bump sitemap_generator from 6.1.1 to 6.1.2

Bumps [sitemap_generator](https://github.com/kjvarga/sitemap_generator) from 6.1.1 to 6.1.2.
- [Release notes](https://github.com/kjvarga/sitemap_generator/releases)
- [Changelog](https://github.com/kjvarga/sitemap_generator/blob/master/CHANGES.md)
- [Commits](https://github.com/kjvarga/sitemap_generator/compare/v6.1.1...v6.1.2)

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

* Bump sitemap_generator from 6.1.1 to 6.1.2 (Update vendor/cache)

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-06-08 11:28:45 -04:00
dependabot-preview[bot]
61019998e7
Bump web-console from 3.7.0 to 4.0.2 (#8330)
* Bump web-console from 3.7.0 to 4.0.2

Bumps [web-console](https://github.com/rails/web-console) from 3.7.0 to 4.0.2.
- [Release notes](https://github.com/rails/web-console/releases)
- [Changelog](https://github.com/rails/web-console/blob/master/CHANGELOG.markdown)
- [Commits](https://github.com/rails/web-console/compare/v3.7.0...v4.0.2)

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

* Bump web-console from 3.7.0 to 4.0.2 (Update vendor/cache)

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-06-08 11:26:40 -04:00
icncsx
32890d719d
Fix text out of bounds in Search results feed (#8263) 2020-06-08 11:26:03 -04:00
Fernando Valverde
97fb2f9973
Adds config.hosts option in development environment (#8295) 2020-06-08 09:24:40 -06:00
Molly Struve
dd1cfd33e0
Remove video_permissions Role Reference From Specs and Code (#8344) 2020-06-08 10:23:53 -05:00
Molly Struve
70ba4eba2f
Spec Speed Up: Memoize Feed objects and Combine some Tests (#8305) 2020-06-08 17:15:34 +02:00
dependabot-preview[bot]
9cadeaaac3
Bump sprockets from 4.0.0 to 4.0.2 (#8327)
* Bump sprockets from 4.0.0 to 4.0.2

Bumps [sprockets](https://github.com/rails/sprockets) from 4.0.0 to 4.0.2.
- [Release notes](https://github.com/rails/sprockets/releases)
- [Changelog](https://github.com/rails/sprockets/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rails/sprockets/compare/v4.0.0...v4.0.2)

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

* Fix spec

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: rhymes <rhymesete@gmail.com>
2020-06-08 10:50:36 -04:00
rhymes
9992bdfe92
Replace whitelisted_ips with permissions in Docker init (#8341) 2020-06-08 16:16:02 +02:00
dependabot-preview[bot]
ee090316a2
Bump rubocop from 0.84.0 to 0.85.0 (#8329)
* Bump rubocop from 0.84.0 to 0.85.0

Bumps [rubocop](https://github.com/rubocop-hq/rubocop) from 0.84.0 to 0.85.0.
- [Release notes](https://github.com/rubocop-hq/rubocop/releases)
- [Changelog](https://github.com/rubocop-hq/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop-hq/rubocop/compare/v0.84.0...v0.85.0)

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

* Bump rubocop from 0.84.0 to 0.85.0 (Update vendor/cache)

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-06-08 10:10:56 -04:00
Molly Struve
c40f787aaa
[deploy] Make Video Permission a Valid Role (#8333) 2020-06-08 09:05:26 -05:00
Molly Struve
86ea55f23d
Flaky Spec Fix: Bulk Delete SQL Spec (#8332) 2020-06-08 09:42:45 -04:00
dependabot-preview[bot]
a89b191cdc
Bump honeybadger from 4.6.0 to 4.7.0 (#8326)
* Bump honeybadger from 4.6.0 to 4.7.0

Bumps [honeybadger](https://github.com/honeybadger-io/honeybadger-ruby) from 4.6.0 to 4.7.0.
- [Release notes](https://github.com/honeybadger-io/honeybadger-ruby/releases)
- [Changelog](https://github.com/honeybadger-io/honeybadger-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/honeybadger-io/honeybadger-ruby/compare/v4.6.0...v4.7.0)

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

* Bump honeybadger from 4.6.0 to 4.7.0 (Update vendor/cache)

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-06-08 09:34:46 -04:00
Michael Kohl
f712a71f8b
[deploy] Clean up BadgeRewarder (#8211)
* Clean up BadgeRewarder

* Undo query change
2020-06-08 15:30:48 +02:00
dependabot-preview[bot]
ee3bbd8f39
Bump rolify from 5.2.0 to 5.3.0 (#8321)
* Bump rolify from 5.2.0 to 5.3.0

Bumps [rolify](https://github.com/RolifyCommunity/rolify) from 5.2.0 to 5.3.0.
- [Release notes](https://github.com/RolifyCommunity/rolify/releases)
- [Changelog](https://github.com/RolifyCommunity/rolify/blob/master/CHANGELOG.rdoc)
- [Commits](https://github.com/RolifyCommunity/rolify/compare/v5.2.0...v5.3.0)

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

* Bump rolify from 5.2.0 to 5.3.0 (Update vendor/cache)

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-06-08 09:29:26 -04:00
dependabot-preview[bot]
faf9573345
Bump faker from 2.11.0 to 2.12.0 (#8322)
* Bump faker from 2.11.0 to 2.12.0

Bumps [faker](https://github.com/faker-ruby/faker) from 2.11.0 to 2.12.0.
- [Release notes](https://github.com/faker-ruby/faker/releases)
- [Changelog](https://github.com/faker-ruby/faker/blob/master/CHANGELOG.md)
- [Commits](https://github.com/faker-ruby/faker/compare/v2.11.0...v2.12.0)

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

* Bump faker from 2.11.0 to 2.12.0 (Update vendor/cache)

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-06-08 09:29:11 -04:00
dependabot-preview[bot]
474968359e
Bump twilio-video from 2.5.0 to 2.5.1 (#8323)
Bumps [twilio-video](https://github.com/twilio/twilio-video.js) from 2.5.0 to 2.5.1.
- [Release notes](https://github.com/twilio/twilio-video.js/releases)
- [Changelog](https://github.com/twilio/twilio-video.js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/twilio/twilio-video.js/compare/2.5.0...2.5.1)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-06-08 09:28:53 -04:00
Michael Kohl
387bf7c1bc
Make Devise.mailer_sender configurable (#8246)
* Make Devise.mailer_sender configurable

* Disable setting default email via internal config

* Also disallow default email param

* Fix spec
2020-06-08 12:02:07 +02:00
Molly Struve
6a139c73ac
Flaky Spec Fixes: User Block and Sitemap Specs (#8314) 2020-06-07 11:36:05 -05:00
ludwiczakpawel
bde51a61a0
Feed Layout Fix (#8282)
* flare tag line height

* .

* fix
2020-06-06 07:28:20 +02:00
Molly Struve
5d22e71ad6
nothing to see here....except maybe reverting a push to master (#8308)
🙈
2020-06-05 20:34:21 -05:00
mstruve
533cab50d6 synchronous roles 2020-06-05 20:02:41 -05:00
rhymes
9215d04f08
[deploy] Routine Rubocop fixes (#8293)
* rubocop -a fixes

* rubocop --auto-gen-config
2020-06-05 18:46:10 -04:00
Ben Halpern
3c840610a1
[deploy] Remove unnecessary bulk from image assets (#8306)
* Remove unnecessary bulk from image assets

* Swap background-image

* Fix test

* Fix test
2020-06-05 17:51:06 -04:00
Ben Halpern
788c3d5a3b
[deploy] Remove miro gem (#8307) 2020-06-05 17:03:09 -04:00
Ben Halpern
143fd1fa71
[deploy] Replace defunct Algorithmia with Miro for color detection (#8296)
* Replace defuncked Algorithmia with Miro for color detection

* Stub robohash
2020-06-05 15:03:26 -04:00
dependabot[bot]
d846349714
[deploy] Bump websocket-extensions from 0.1.4 to 0.1.5 (#8300) 2020-06-05 14:17:37 -04:00
Mac Siri
92eca6f935
[deploy] Enable ActsAsTaggableOn.strict_case_match (#8299) 2020-06-05 13:52:01 -04:00
Matheus Cardoso
e9e950735c
Fix gists sometimes rendered in wrong order (#8205) 2020-06-05 12:23:43 -04:00
Dmitry Maksyoma
cc0254310c
Update docs to shine more light on bin/setup and bin/startup (#8290) 2020-06-05 12:21:53 -04:00
Ben Halpern
01380c16a8
[deploy] Remove STAFF_USER_ID from Envfile (#8297) 2020-06-05 11:47:21 -04:00
Alex
f7430ccd16
[deploy] Add path_redirects table and internal view (#8161)
* Create migrations

* Create PageRedirect model

* Refactor migration and add timestamps

* Add routes for internal/page_redirects

* Add index controller action and view

* Change background color of version in /internal

* Add page_redirect factory and index specs

* Fix specs

* Use ransack for search

* Alphabetize internal sidenav

* Rename spec

* Add edit view with destroy button

* Refactor page_redirect form partial

* Update error messages and fix redirect

* Small fixes and hookup new and create

* Specs FTW

* Fix migration, overridden --> source

* Add PageRedirect model specs

- Validate presence of status

* Update routes

* Code climate fixes

* Add old_slug_url and new_slug_url helper methods

* Prevent updating old_slug, refactor _form

* Add URLs to index view for slugs

* Better spec wording

* Change version to badges and add to edit view

* Update destroy response

* slug --> path 🙈

* Add PageRedirects to seed file

* Fix seed file

* ACTUALLY fix the seed file

* slug --> path in PageRedirect factory

* Remove bug fix from seeds file

* Move menu items to controller constant

* Update source type validation in model spec

* Rename page_redirect --> path_redirect

* Add AuditLog for admin create, destroy, and update

* Remove redundant index

* Cleanup old name of page_redirect

* Remove old model

* Update AuditLog to :internal

* Titleize search placeholder task in internal

* Add comment to explain MENU_ITEMS constant

* Add warning text on edit page about many updates

* Remove default and allow null on source

* Fix comment

* Add path_redirect validations and model specs

- Validate old_path != new_path
- Validate new_path isn't an existing redirect
2020-06-05 10:28:33 -04:00
Ben Halpern
f23ea3d668
Resourcify ChatChannel (#8285) 2020-06-05 15:45:55 +02:00
Michael Kohl
b011cd2086
Also allow Asciinema URLs, not only IDs (#8288) 2020-06-05 15:37:45 +02:00
Mac Siri
1b839d9328
[deploy] Streamline Tag parsing for both editors (#8175) 2020-06-05 08:46:24 -04:00
Molly Struve
4966783e18
Stub Percy.snapshot During Specs (#8286) 2020-06-05 09:25:03 +02:00
rhymes
753bdc5dc8
Add missing unique indexes to notifications (#8273) 2020-06-05 09:19:22 +02:00
Molly Struve
dca570c87f
Remove Explict Gemfile from travis.yml to Allow vendor/cache to be used (#8287) 2020-06-05 09:19:05 +02:00
Jacob Herrington
4ebad8c4bc
Document the usage of Audit:Logger (#8284)
One of the DEV maintainers pointed out that our action logging mechanism
isn't documented anywhere. This add some context for that code!
2020-06-04 21:49:01 -05:00
Molly Struve
8ca8d447b8
[deploy] Add Safety Operator When Handling params[:q] (#8279) 2020-06-04 14:09:09 -05:00
Molly Struve
6e28711961
[deploy] Change Cache Key to Bust Cache (#8280) 2020-06-04 13:49:29 -05:00
dependabot-preview[bot]
16baeb9823
Bump @babel/core from 7.9.6 to 7.10.2 (#8195) 2020-06-04 13:53:59 -04:00
dependabot-preview[bot]
789ad5d41b
[deploy] Bump honeybadger-js from 2.2.1 to 2.2.2 (#8130) 2020-06-04 11:12:00 -04:00