Commit graph

6779 commits

Author SHA1 Message Date
Molly Struve
f2b59cc882
Optimization:Only Enqueue UpdateMainImageBackgroundHexWorker If Main Image Changes (#10325) 2020-09-14 11:37:38 -05:00
rhymes
f0b124cc26
[deploy] Add unique index on articles user_id, title and body_markdown (#10284)
* Add unique index on articles user_id, title and body_markdown

* Add test
2020-09-14 16:11:12 +02:00
rhymes
f6e24bc85b
Stop pinging sitemap tools locally (#10314) 2020-09-14 16:10:52 +02:00
rhymes
83d37df4d7
[deploy] Cleanup articles with duplicate user_id, title and body_markdown (#10273)
* Add script to delete draft articles

* Add script to de-duplicate published articles

* Ignore NotificationSubscription, Notification and RatingVote
2020-09-14 15:38:53 +02:00
Takuma
b6200c8414
[deploy] Fix SiteConfig's default of authentication_providers field (#10310) 2020-09-14 08:18:13 -05:00
Vaidehi Joshi
abe2489394
Hide active broadcasts from /connect routes (#10312)
Fixes https://github.com/forem/forem/issues/9683.
Also refactors the initializeBroadcast function to handle all
broadcast-related logic, and removes broadcast checks from the articleForm component.
2020-09-14 11:28:18 +02:00
dependabot-preview[bot]
193b93c599
Bump ddtrace from 0.39.0 to 0.40.0 (#10309)
* Bump ddtrace from 0.39.0 to 0.40.0

Bumps [ddtrace](https://github.com/DataDog/dd-trace-rb) from 0.39.0 to 0.40.0.
- [Release notes](https://github.com/DataDog/dd-trace-rb/releases)
- [Changelog](https://github.com/DataDog/dd-trace-rb/blob/master/CHANGELOG.md)
- [Commits](https://github.com/DataDog/dd-trace-rb/compare/v0.39.0...v0.40.0)

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

* Bump ddtrace from 0.39.0 to 0.40.0 (Update vendor/cache)

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-09-14 08:26:58 +02:00
Rafi
7a277ce6b9
Removing duplicate date formatting for listing expiry date in listing dashboard (#10264)
* Duplicate date formatting for listing expiry

* Fixing formatting
2020-09-14 08:25:22 +02:00
dependabot-preview[bot]
691c617b81
Bump css-loader from 4.2.2 to 4.3.0 (#10301)
Bumps [css-loader](https://github.com/webpack-contrib/css-loader) from 4.2.2 to 4.3.0.
- [Release notes](https://github.com/webpack-contrib/css-loader/releases)
- [Changelog](https://github.com/webpack-contrib/css-loader/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/css-loader/compare/v4.2.2...v4.3.0)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-09-14 08:18:03 +02:00
dependabot-preview[bot]
ef7fc28cfd
Bump knapsack_pro from 2.2.1 to 2.3.0 (#10297)
* Bump knapsack_pro from 2.2.1 to 2.3.0

Bumps [knapsack_pro](https://github.com/KnapsackPro/knapsack_pro-ruby) from 2.2.1 to 2.3.0.
- [Release notes](https://github.com/KnapsackPro/knapsack_pro-ruby/releases)
- [Changelog](https://github.com/KnapsackPro/knapsack_pro-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v2.2.1...v2.3.0)

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

* Bump knapsack_pro from 2.2.1 to 2.3.0 (Update vendor/cache)

* Set KNAPSACK_PRO_MAX_REQUEST_RETRIES to 0 for Forks

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: mstruve <mollylbs@gmail.com>
2020-09-14 11:39:20 +07:00
Michael Kohl
7b729bbf06
[deploy] Move video_duration_in_minutes_integer to serializer (#10268)
* Move video_duration_in_minutes_integer to serializer

* Add data update script to reindex video articles
2020-09-14 09:47:54 +07:00
dependabot-preview[bot]
4afa52f591
Bump eslint from 7.8.1 to 7.9.0 (#10305)
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-09-13 22:31:15 -04:00
rhymes
b90bbdd87a
[deploy] Fix URL.domain in development by correctly loading authentication providers (#10296) 2020-09-13 16:49:18 -05:00
dependabot-preview[bot]
0fba78a611
[deploy] Bump sidekiq-unique-jobs from 6.0.22 to 6.0.23 (#10300)
* Bump sidekiq-unique-jobs from 6.0.22 to 6.0.23

Bumps [sidekiq-unique-jobs](https://github.com/mhenrixon/sidekiq-unique-jobs) from 6.0.22 to 6.0.23.
- [Release notes](https://github.com/mhenrixon/sidekiq-unique-jobs/releases)
- [Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v6.0.22...v6.0.23)

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

* Bump sidekiq-unique-jobs from 6.0.22 to 6.0.23 (Update vendor/cache)

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-09-13 16:12:05 -05:00
dependabot-preview[bot]
06d4b83d1c
Bump sidekiq from 6.1.1 to 6.1.2 (#10304)
* Bump sidekiq from 6.1.1 to 6.1.2

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

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

* Bump sidekiq 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-09-13 16:11:50 -05:00
dependabot-preview[bot]
5e0a187bba
Bump husky from 4.2.5 to 4.3.0 (#10303)
Bumps [husky](https://github.com/typicode/husky) from 4.2.5 to 4.3.0.
- [Release notes](https://github.com/typicode/husky/releases)
- [Changelog](https://github.com/typicode/husky/blob/master/CHANGELOG.md)
- [Commits](https://github.com/typicode/husky/compare/v4.2.5...v4.3.0)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-09-13 17:09:07 -04:00
dependabot-preview[bot]
ce52bd6cfd
[deploy] Bump counter_culture from 2.6.0 to 2.6.1 (#10299)
* Bump counter_culture from 2.6.0 to 2.6.1

Bumps [counter_culture](https://github.com/magnusvk/counter_culture) from 2.6.0 to 2.6.1.
- [Release notes](https://github.com/magnusvk/counter_culture/releases)
- [Changelog](https://github.com/magnusvk/counter_culture/blob/master/CHANGELOG.md)
- [Commits](https://github.com/magnusvk/counter_culture/compare/v2.6.0...v2.6.1)

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

* Bump counter_culture from 2.6.0 to 2.6.1 (Update vendor/cache)

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-09-13 14:28:03 -05:00
dependabot-preview[bot]
03744e0e4c
Bump brakeman from 4.9.0 to 4.9.1 (#10302)
* Bump brakeman from 4.9.0 to 4.9.1

Bumps [brakeman](https://github.com/presidentbeef/brakeman) from 4.9.0 to 4.9.1.
- [Release notes](https://github.com/presidentbeef/brakeman/releases)
- [Changelog](https://github.com/presidentbeef/brakeman/blob/main/CHANGES.md)
- [Commits](https://github.com/presidentbeef/brakeman/compare/v4.9.0...v4.9.1)

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

* Bump brakeman from 4.9.0 to 4.9.1 (Update vendor/cache)

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-09-13 14:27:39 -05:00
dependabot-preview[bot]
fec0c0b89a
Bump ahoy_matey from 3.0.4 to 3.0.5 (#10306)
* Bump ahoy_matey from 3.0.4 to 3.0.5

Bumps [ahoy_matey](https://github.com/ankane/ahoy) from 3.0.4 to 3.0.5.
- [Release notes](https://github.com/ankane/ahoy/releases)
- [Changelog](https://github.com/ankane/ahoy/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ankane/ahoy/compare/v3.0.4...v3.0.5)

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

* Bump ahoy_matey from 3.0.4 to 3.0.5 (Update vendor/cache)

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-09-13 14:27:11 -05:00
dependabot-preview[bot]
2565cf939b
Bump jbuilder from 2.10.0 to 2.10.1 (#10307)
* Bump jbuilder from 2.10.0 to 2.10.1

Bumps [jbuilder](https://github.com/rails/jbuilder) from 2.10.0 to 2.10.1.
- [Release notes](https://github.com/rails/jbuilder/releases)
- [Changelog](https://github.com/rails/jbuilder/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rails/jbuilder/compare/v2.10.0...v2.10.1)

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

* Bump jbuilder from 2.10.0 to 2.10.1 (Update vendor/cache)

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-09-13 14:26:50 -05:00
Molly Struve
0cdbf46828
[deploy] Refactor:Remove unused ReadingList Labor methods (#10292) 2020-09-13 13:45:14 -05:00
dependabot-preview[bot]
fcc02ff913
Bump honeycomb-beeline from 2.1.2 to 2.2.0 (#10298)
* Bump honeycomb-beeline from 2.1.2 to 2.2.0

Bumps [honeycomb-beeline](https://github.com/honeycombio/beeline-ruby) from 2.1.2 to 2.2.0.
- [Release notes](https://github.com/honeycombio/beeline-ruby/releases)
- [Commits](https://github.com/honeycombio/beeline-ruby/compare/v2.1.2...v2.2.0)

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

* Bump honeycomb-beeline from 2.1.2 to 2.2.0 (Update vendor/cache)

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-09-13 13:44:56 -05:00
dependabot-preview[bot]
8f3f907313
Bump blazer from 2.2.6 to 2.2.7 (#10308)
* Bump blazer from 2.2.6 to 2.2.7

Bumps [blazer](https://github.com/ankane/blazer) from 2.2.6 to 2.2.7.
- [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.6...v2.2.7)

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

* Bump blazer from 2.2.6 to 2.2.7 (Update vendor/cache)

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-09-13 13:43:10 -05:00
Vaidehi Joshi
0f74206184
Check that nginx is available before pinging it (#10287) [deploy]
* Check that nginx is available before pinging it

Currently, we don't have a good way of knowing whether Openresty is available before
we try to bust an Nginx cache via Openresty's server. This means that we can potentially
make a request to Openresty even when it is unavailable, which causes the app to not be
able to boot up when this code path is called.

This adds a check to make sure that openresty is both configured and available before
trying to bust an Nginx cache or before making additional requests to Openresty.

Closes https://github.com/forem/InternalProjectPlanning/issues/38.

* Add DataDog monitor if Openresty is unavailable
2020-09-11 15:28:03 -07:00
Molly Struve
313bfef28c
[deploy] Feature:Allow for Search by ID for FeedContent (#10289) 2020-09-11 14:45:23 -05:00
Ben Halpern
3a469a99e2
[deploy] Enable admin-configured app_domain (#10206)
* Move app_domain from env var to siteconfig *within app area*

* Fix SiteConfig

* Don't change URL.domain yet

* Not use in fastly cache purge yet

* Session store magoo

* Revert domain issue

* Add SetCookie middleware

* Temporarily remove cookie middleware and release tasks

* Re-enable SetCookieDomain

* Add some more comments, get it ready for testing

* Remove host from url options and temporarily show errors

* Allow forwarded host to be cookie

* Fix typo

* Change invalidAuthenticityToken

* Properly set app domain

* Proper Fastly cache

* Remove config.app_domain

* Remove config.app_domain

* Explicitely set remember_user_token

* More play with cookies

* Fiddle with remember_user_token

* Add remember_user_token changes

* Monkeypatch devise

* Sessions controller

* Include rememberable

* Include rememberable

* Proper cookie monkeypatch

* Proper cookie monkeypatch

* Proper cookie monkeypatch

* Remove extra cookie code

* User sign in tweak

* Close the loop

* Experiment with carrierwave public_url

* Finalize carrierwave monkeypatch

* Remove async controller specs

* Change some tests

* Update domain test

* Remove temporary production.rb change

* modify cookie logic

* Remove unneeded changes

* Remove unneeded changes

* Explicitely pass host

* Fix linting

* Fix social image test

* Add some cookie tests

* Modify article url

* Fix canonical urls

* Fix typo

* Remove sessions controller

* Remove devise monkeypatch

* Add monkeypatch

* Remove elsif

* Update spec/helpers/application_helper_spec.rb

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

* Adjust remember_cookie_sync

* Remember user token experimentation

* Fiddle with devise

* Properly configure devise

* Fix typo

* Fix formatting issue

* Add comment about middleware

* Fix typo

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

* Remove commented-out code

Co-authored-by: Michael Kohl <citizen428@dev.to>
Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
2020-09-11 09:38:34 -04:00
Mac Siri
df245e7e84
Create codeql-analysis.yml (#10276) 2020-09-11 09:46:45 +02:00
Molly Struve
111dc4ea9d
[deploy] Bug Fix: Add New Migration to Remove Active from Profile Fields (#10279) 2020-09-11 08:49:27 +02:00
Joe Doss
a6ae0378c5
Add FOREM_BUILD_SHA and FOREM_BUILD_DATE to the container. (#10278)
In the past it was always useful to have meta data within regards to the SHA and
build date/time. This adds in two new env vars that are written to disk as flat
files and then exported to environment variables when the container starts up.

This motivation comes from this comment:

https://github.com/forem/forem/pull/9987#discussion_r476123829
2020-09-10 21:41:25 -05:00
Molly Struve
3ef7340f05
[deploy] Bug Fix:Update Text Request Email with confirm_delete Link (#10277) 2020-09-10 13:54:30 -05:00
Ben Halpern
244195fc92
Move mailchimp API key to app logic (#10270) 2020-09-10 13:25:55 -04:00
dependabot-preview[bot]
d188886546
Bump @stoplight/spectral from 5.4.0 to 5.5.0 (#10224)
Bumps [@stoplight/spectral](https://github.com/stoplightio/spectral) from 5.4.0 to 5.5.0.
- [Release notes](https://github.com/stoplightio/spectral/releases)
- [Changelog](https://github.com/stoplightio/spectral/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/stoplightio/spectral/compare/v5.4.0...v5.5.0)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-09-10 07:43:22 -04:00
ludwiczakpawel
009c89d843
Organizations profile header redesign (#10258)
* organizations profile header

* merge

* tests

* .
2020-09-10 12:42:36 +02:00
Kevin McGinn
3bce753303
[Documentation] Improvements to Windows installation & startup docs (#10243)
* fix elasticsearch tgz filename in windows docs

* add prereqs to running bin/startup in windows docs

* add tip for Sidekiq errors in app startup docs
2020-09-09 18:19:16 -04:00
Ben Halpern
f275204e1c
[deploy] Proper cache delete_matched (#10267) 2020-09-09 18:18:17 -04:00
Ben Halpern
a1f664ab5b
Fetch GA Tracking ID from SiteConfig (#10262) 2020-09-09 18:17:44 -04:00
Molly Struve
9c7c4e7062
[deploy] Optimization:Increase refresh_interval For Possible High Indexing Indexes (#10215) 2020-09-09 17:07:15 -05:00
Ben Halpern
310df39e27
Include locale in fragment cache key (#10199)
* Include locale in fragment cache key

* Adjust specs
2020-09-09 16:58:04 -04:00
Mac Siri
141df7ba03
[deploy] Bump Rails to 6.0.3.3 (#10266) 2020-09-09 16:16:50 -04:00
Mac Siri
9ebd742712
[deploy] Reintroduce sticky_nav changes (ab81f36 & 7f92855) (#10263)
* Revert "[deploy] Revert removal of unneeded eager load (if needed) (#10179)"

This reverts commit 11c7b148da.

* Revert "[deploy] Revert "Migrate ProfileImage to Images::Profile (#10055)" (#10149)"

This reverts commit 5657067e55.
2020-09-09 15:33:13 -04:00
Julianna Tetreault
751c910291
Give Admins the Ability to Add Co-Authors to Posts (#10252) [deploy]
* Adds second_user_id and third_user_id to Admin::Articles::Controller and Article model
  - Add second_user_id to #update
  - Add third_user_id to #update
  - Add second_user_id to #article_params
  - Add third_user_id to #article_params
  - Add second and third user_ids to :limited_columns_internal_select

* Adds a second_user_id and third_user_id form field to _individual_article.html.erb

* Adds tests around adding a co-author and multiple co-authors to an article in articles_spec.rb
2020-09-09 10:25:25 -06:00
ludwiczakpawel
7630885783
Actions bar overlapping footer (#10259) 2020-09-09 12:23:24 -04:00
Michael Kohl
4ae59b56e3
Add custom profile fields (#10202)
* Add custom_profile_fields table

* Add CustomProfileField model and refactor

* Remove trailing whitespace

* Stop ignoring removed column

* Add explanatory comment

* Update service object

* Fix bug in service object

* Refactor and fix specs

* Increase limit from 3 to 5

* Update comment to reflect code changes
2020-09-09 14:37:15 +00:00
Michael Kohl
0e6dfabea1
Article refactoring (#10256)
* Rewrite query in pure AR syntax

* @citizen428
Use ActiveSupport::Duration instead of manual calculations
2020-09-09 09:47:27 -04:00
ludwiczakpawel
6c3f5d51fe
Drop containers styling (#10203)
* Refactored drag n drop functionality to a hook and component.

* Add the snackbar to the article editor.

* Now you can drag and drop images in the post body content.

* Cleaning up a few things.

* Now post cover images can be dragged and dropped.

* Removed unused empty function.

* Added @testing-library/preact-hooks so that we can test hooks.

* Some renaming, small refactor.

* Added tests

* Added more tests.

* Added more tests.

* Added message about dropping only one image in post body.

* Added message about dropping only one image for cover image.

* put onDrop into it's own meethod.

* More tests.

* Added some API documentation.

* Updated editor help with drag and drop image help.

* drag and drop styling

* .

* revert

* Fixed broken test.

Co-authored-by: Nick Taylor <nick@dev.to>
2020-09-09 09:37:16 +02:00
Rafi
ea74a3d390
Using global util function for displaying date in listing dashboard (#10244)
* Common date util function for listing dashboard

* Making dateTime required

* Fixing typo

* Fixing tests

* Fixing deletion of function in globalThis
2020-09-09 09:35:05 +02:00
Molly Struve
2bc1496bc4
Refactor: Remove Unused Figaro Gem and Temp Rake Task (#10255) 2020-09-09 09:24:32 +02:00
Rafi
327fe14ccb
Fixing id and class of non featured article (#10247)
* Fixing id and class of non featured article

* Adding id

* Removing extra space

* Fixing broken rspec test
2020-09-08 18:38:49 -04:00
Molly Struve
c71f179b28
Bug Fix:Fix Data Update feed_source_url Script (#10253) 2020-09-08 16:15:05 -05:00
Nick Taylor
e2d43c4a73
[deploy] Fixed issue with drag and drop image for cover image in editor. (#10254) 2020-09-08 16:43:23 -04:00