Commit graph

1646 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
ludwiczakpawel
39295c0bea
Layout updates (#8107)
* flare tag line height

* .

* init

* widgets

* widgets lists

* new tabs on home

* instantclick

* .

* rethinking css

* .

* .

* empty space

* campaign widget

* .

* merge

* .

* update layout

* fix sidebars on home page

* .

* fix onboarding x

* spec

* test

* test

* better handling ads

* .

* spec

* card styling

* .

* i dont know what have i broken
2020-06-04 16:12:17 +02:00
Molly Struve
97fecd6703
Display Jobs Banner if User searches jobs or job (#8259)
* Display Jobs Banner if User Searches jobs or job

* Add period to end of sentence

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>

* reword site config description

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>

* Change SiteConfig display field name to display_jobs_banner

* dont forget the specs

Co-authored-by: Andy Zhao <17884966+Zhao-Andy@users.noreply.github.com>
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2020-06-04 15:17:23 +02:00
Ernesto Tagwerker
9ea3a8c67d
Upgrade to Rails 6.0 (#7658)
* Add dual booting logic to Gemfile

This might be helpful for the Rails 6.0 upgrade project.

* Add more than one gemfile to Travis' configuration

We want to see how the application behaves with more than one Rails versions:

- Gemfile -> Rails 5.2
- Gemfile.next -> Rails 6.0

This will help us figure out what needs to be addressed before migrating to Rails 6.0.

If you want to read more about this technique (dual booting) you can check out this page: https://www.fastruby.io/blog/upgrade-rails/dual-boot/dual-boot-with-rails-6-0-beta.html

* Fix joins

* Upgrade Gemfile.next.lock

* Make sure we're installing the correct versions of gems

* Add Rails 6 notes

* Update rubocop in Gemfile.next.lock

* Fix organization spec

* Fix page_views_spec

* Add Rails 6 and run rails app:update

* Remove some tricks

* Remove Gemfile.next for now

* Fix .content_type deprecation

* Fix deprecation of .where.not NAND/NOR behavior

* Fix deprecation of parameterized emails

* Fix specs

* Remove next flag for now

* Fix spec (hopefully)

* Add wait_for_javascript

* Fix spec, thanks @maestromac!

* Try without wait for javascript hack

* Remove unnecessary bin/update

* Remove file that snuck in the rebase

* Update the vendored gems

* Replace migrate+db:setup with db:prepare

* Update vendored gems

* Fix Gemfile.lock and update vendored stuff

* Fix Gemfile.lock to be the same as master's minus the changes

Co-authored-by: rhymes <rhymesete@gmail.com>
2020-06-04 11:54:25 +02:00
Julianna Tetreault
d2d46c5f47
Allow Admins to Delete Broadcasts (#8258) [deploy]
* Add #destroy to Broadcasts::Controller and destroy route to routes.rb
  * Adds destroy method w/ corresponding flash messages to controller
  * Adds destroy route to Broadcast routes in routes.rb

* Add destroy button to internal/broadcasts edit view
  * Adds destroy action to broadcasts/edit.html.erb
  * Adds deletion confirmation to broadcasts/edit.html.erb

* Add tests around deleting broadcasts in broadcasts_spec.rb

* Adjust #destroy in Broadcasts::Controller to be a conditional

* Add an exclamation point to #destroyin Broadcasts::Controller
2020-06-03 15:15:27 -06:00
Fernando Valverde
b722c428da
Adds explicit quality params to cloudinary helper calls when specifying format (#8253) 2020-06-03 17:13:37 -04:00
Julianna Tetreault
7af4ee034f
Enforce Uniqueness for Broadcast Titles (#8239) [deploy]
* Add uniqueness validation to broadcast titles in broadcast.rb

* WIP: properly test title uniqueness in broadcast_spec.rb

* Add unique index for title and type_of on Broadcasts
  * Adds a unique index to the Broadcasts table
  * Adds broadcast.rb to .rubocop_todo.yml

* Resolve merge conflicts

* Add spec around duplicate broadcasts in broadcasts_spec.rb

* Adjust broadcast to be inactive in broadcasts_spec.rb
2020-06-02 15:43:59 -06:00
Sarthak Sharma
40dc8d1349
[deploy] 🚀 Feature: Chat Channel Request manager for mods (#7904)
* Feature 🚀 : Ability to delete messages in chat channels

- Sending message ID to frontend
- Deleting Message
- Use pusher to delete message realtime

* Minor Bug 🐞: Show message action only for current user

- User can delete or edit their own messages

* Test cases added

* Bug 🐞: Update message id for receiver

Message id was not sent to receiver by pusher

* Refactoring🛠: Message controller refactoring

* Test Cases📝 : Specs for Delete message added

* Feature 🚀 : Ability to edit messages

* Test Cases📝 : Specs for Edit message added

* 🐞 Channel List bug in mobile view

* changes in joining request responses

* 🛠  Request Managers Frontend ready

* changes in routes for adding and removing remembership

* 🚀 New routes implemented for request manager

* fix issues

* changes in api for remove membership

* Merge conflict resolved

* 🐞 Channel List bug in mobile view

* changes in joining request responses

* 🛠  Request Managers Frontend ready

* changes in routes for adding and removing remembership

* 🚀 New routes implemented for request manager

* fix issues

* changes in api for remove membership

* 🛠Optimizing for CodeClimate

* 🛠Optimizing again for CodeClimate

* 🛠Optimizing again 2 for CodeClimate

* 🛠 Added more test cases

* 🛠 Optimizing code

* 🛠 vscode file changed

* 🛠  Updated schema as requested

Co-authored-by: Parasgr-code <paras.gaur@skynox.tech>
2020-06-02 17:23:56 -04:00
Molly Struve
e3223f9a3f
Stub pro? on user instead of using real role (#8235) 2020-06-02 10:42:18 -05:00
Joe Doss
6406b0727b
Allow localhost or 127.0.0.1 to access api/health_checks without health-check-token (#8231)
* This change allows access to api/health_checks if you are coming from localhost
or 127.0.0.1. Pretty sweet huh?

The reason for this change is because I want to easily get to these healthcheck
end points from localhost without having to get the health-check-token beforehand.

Buttttt.... this addition has some issues. You can spoof the host header pretty
easily:

https://daniel.haxx.se/blog/2018/04/05/curl-another-host/

I thought about doing `return if !request.ssl? && request.local?`

to check of the request was over https or not. Any localhost healthcheck we do
directly to puma will be over http. Checking for TLS seemed like a logical next
check, but since we force https on the edge and not necessarily from the edge to
Puma the Host header can still be spoofed to get at these end points.

More info on host header attacks and what Rails 6 is doing about it:

https://github.com/rails/rails/issues/29893

While I do think it is a good idea to protect these healthcheck end points from
the outside world, I do want to be able to get to them easily locally. WWYD?

* Fix Health Check spec by stubbing request

Co-authored-by: mstruve <mollylbs@gmail.com>
2020-06-02 11:29:04 -04:00
Molly Struve
f2632a3f6b
[deploy] Remove All Notification Count Helper Classes (#8221) 2020-06-02 09:48:02 -05:00
Molly Struve
139c7fc686
[deploy] Ignore Unfound Elasticsearch Docs and Records (#8225) 2020-06-02 08:32:16 -05:00
Francisco Quintero
3b939f6b9f
[deploy] Add Reddit Liquid Tag (#8111)
* Implement Reddit liquid tag

* Set reddit content in locals

* Change Reddit liquid tag content layout

I decided a UI similar to the Stack Exchange tag would be better.

Now the Reddit tag looks a bit similar.

* Add tests for RedditTag

* Add reddit liquid tag example to docs

Also emphasize notice about compilation of article when using any
liquid tag

* Parse markdown text reddit content for RedditTag

* Display date RedditTag post was published

* Remove file location comments

* Change order of conditional for Reddit liquid tag

Sometimes the attribute `post_hint` might be null and neither condition
would apply.

* Add example to use Reddit liquid tag

* Change reddit svg icon for Reddit liquid tag

* handle and verify status of Reddit links

Here we make sure the passed link is a valid one in terms of URI composition (e.g. protocol)
but also that the URL is one that points to existing content in Reddit.

If the URL isn't returning anything but a successful response code (200) then
we treat it as an invalid one.

* Do not use VCR for RedditTag specs

The generated cassette for this tag was really huge (6000+ lines).

Using mocks (as in the MediumTag spec) still does the job and without
that huge VCR file.

* Remove index line from schema.db

* Improve RedditJsonFromUrlService

- Change User-Agent in requests to one read from app configuration
- Remove Reddit URL check by making a GET request
- Add regexp to validate URL looks like a Reddit URL

* Move RedditJsonFromUrlService methods to RedditTag

Also changed the way the request was being mocked. Previously, it was by
mocking the service class now I'm mocking HTTParty directly and returning
the JSON structure Reddit uses.
2020-06-01 18:52:07 -04:00
Molly Struve
fe96375110
Set Redis URL that will not be reused in specs (#8227) 2020-06-01 16:46:23 -05:00
Molly Struve
eda0a78d47
Add Health Check Endpoint for Cache (#8222) 2020-06-01 15:19:56 -05:00
Michael Kohl
780d254690
[deploy] Fix badge count update after merge (#8210) 2020-06-01 14:01:46 -04:00
Ridhwana
02109e8e9a
feat: update the DEV Digest to be fully dynamic (#8213) 2020-06-01 13:56:29 -04:00
Molly Struve
699f9c8144
[deploy] Optimization:Use Scope and current_user to Get Notification Count (#8177) 2020-06-01 09:27:46 -05:00
Josh Puetz
f165c47b34
Add feature flag support to Pages (#8149)
* Add 'feature_flag' field to pages table, form

* Add 'exist?' to FeatureFlag

* Test for feature flag when loading custom pages

* Refactor FeatureFlag.enabled? to check both boolean and user gates

* Ugly test fixes

* PR feedback and refactoring

* PR refactor: don't require database table!
2020-06-01 09:23:19 -05:00
Ridhwana
af6d2325e6
Site configuration improvements (#8157)
* feat: alphabetize the site config page

* chore: move twitter hashtag into social media and rename Mailchimp list ID's to Newsletter

* chore: reorder the site config

* fix: don't show a broken image when the value does not exist

* if there are 3 or more parameters lets move it to its own method

* chore: empty line

* fix: seems like we couldn't update the token

* chore: amend the test to mimic the order on the site config

* chore: oops - add back the welcome_notifications_live_at
2020-05-30 11:42:27 +02:00
Julianna Tetreault
fa3caaf513
Enqueue feed_customization_notification (#8160)
* Set notification_enqueued to true in #send_feed_customization_notification

* Fix typo in generator_spec.rb

* Add comment about enqueuing notification in generator.rb

* Update app/services/broadcasts/welcome_notification/generator.rb

Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>

Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
2020-05-29 13:08:46 -06:00
Vaidehi Joshi
a4be185720
Leverage announcement broadcasts (#8150) [deploy]
* Differentiate between welcome + announcement broadcasts

* Allow admins to filter between these two types in the `/internal/broadcasts` UI.
* Ensure that the index endpoint fetches the correct Broadcast models.

* Only allow one Announcement broadcast to be created at a time

* Also add some `announcement` and `welcome` scopes on the `Broadcast` class.
* Add flash[:success] messages in BroadcastsController.

* Add some tests for Announcement broadcast validations

* Remove unused active_announcement_params method

* Order Broadcasts by title, optimization improvements

* Fix missing closing tags in broadcast specs
2020-05-29 11:38:41 -07:00
Ben Halpern
064dd26df4
[deploy] Change text in failing PUBLISH test (#8162) 2020-05-29 13:48:30 -04:00
ludwiczakpawel
a161d3ce31
[deploy] Redesign article editor (#7524) 2020-05-29 11:59:37 -04:00
Mac Siri
25c1f9210f
Remove redundant include of CloudinaryHelper (#8136) 2020-05-29 10:26:46 -04:00
rhymes
689fb6efb6
Routine rubocop fixes (#8137)
* Update gems

* rubocop -a

* rubocop --auto-gen-config
2020-05-29 11:56:52 +02:00
Ridhwana
1a40e10df8
Update the tag moderation email (#8048)
* feat: update the tag mod text

* feat: channel slug

* feat: updates

* feat: update text

* chore: change
2020-05-28 17:46:41 +02:00
Molly Struve
14c2372ae7
[deploy] Add API Key to API Write Throttle (#8110) 2020-05-28 09:45:01 -05:00
Molly Struve
8a4c2c1cb4
[deploy] Add App, Database, and Search Health Check Endpoints (#8071) 2020-05-28 08:33:31 -05:00
Mac Siri
8521eab94a
Update .simplecov (#8078) 2020-05-27 14:37:21 -04:00
Molly Struve
dc76c891c6
[deploy] Comment out Percy Code Failing Specs (#8077) 2020-05-27 10:12:28 -05:00
Julianna Tetreault
6cf177c3e4
Add download_app Welcome Notification (#8067)
* Add download_broadcast to generator.rb
  * Adds memoized download_broadcast method
  * Adds send_download_notification method
  * Adds send_download_notification to call method

* Add download_app to broadcasts.rb and seeds.rb
  * Adds download_app broadcast info and copy to factory
  * Adds download_app copy to seeds

* Add specs around #send_download_app_notification in generator_spec.rb

* Fix quotes around copy

* Remove extra space within copy
2020-05-27 08:14:47 -06:00
Michael Kohl
7f75f99560
[deploy] Rename classified listings (#7910)
* Change models and related files

* Update controllers and specs

* More renaming

* Seek and destroy, I mean search and replace

* Round up the stragglers

* Ground control to Major Travis...

* More fixes

* PR feedback

* Various fixes

* Rename view

* Fix list query builder

* Unify request specs

* Fix some API spec errors

* Fix remaining API specs

* Make spec conform to API

* Fix leftover problems

* Fix JS tests

* Fix column name in select

* Fix API specs

* Fix search specs

* Paging Mr. Travis
2020-05-27 13:35:09 +00:00
rhymes
acb35afe03
Add unique indexes - part 4 (#8059)
* Rubocop unique index cop needs a static list of columns

* Add unique index on organizations secret

* Add unique index on chat_channel_memberships chat_channel_id

* Add unique index to chat_channel slug

* Add unique index to badge_achievements badge_id
2020-05-27 09:29:20 +02:00
Ben Halpern
e39f5b04d1
[deploy] Render recently updated search preambled to sidebar (#8060)
* Render recently updated search preambled to sidebar

* Refactor

* Fix typo

* Mess with test
2020-05-26 18:34:27 -04:00
rhymes
0976132425
[deploy] RSS feed: add article tags as categories (#8046) 2020-05-26 15:51:33 -04:00
Ben Halpern
cd18d2f436
[deploy] Add alternate comment-oriented feed algos (#8042) 2020-05-26 13:23:03 -04:00