Commit graph

5579 commits

Author SHA1 Message Date
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
dc48886b7d
[deploy] Add If Statements to Skip Migrations If Index Exists (#8236) 2020-06-02 11:43:50 -05: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
c837e7968a
[deploy] Only load Pages Rake in Development (#8233) 2020-06-02 09:22:02 -05:00
Molly Struve
139c7fc686
[deploy] Ignore Unfound Elasticsearch Docs and Records (#8225) 2020-06-02 08:32:16 -05:00
rhymes
948e984ef3
Add unique index to comments - part 6 (#8214) 2020-06-02 11:30:43 +02:00
Fernando Valverde
fd639c2c15
pages:sync rake task for easier local coding of HTML Page (#8190)
* pages:bind rake task for local coding of HTML Page

* Tweaked task description

* Adds tests and enhancements to the task

* Replaces fixture with tmp file

* Adds check to avoid any side effects in production

* Removes clunky test

* Removes check for Test ENV (no longer in use)

* Adds reference to Pages in docs
2020-06-02 11:23:39 +02:00
Peter Frank
9f362dee08
Swap sponsorships link (#8228)
* Update link on sponsors page

* Update "become a sponsor" link on homepage
2020-06-02 09:01:54 +02:00
Joe Doss
4ebb0d39ac
Set --disable-march-tune-native when building sassc. (#8229)
* Set --disable-march-tune-native when building sassc.
  https://github.com/sass/sassc-ruby/issues/146

* Let's ignore the .gems folder when building a Container.

* Let's purge the dnf cache!
2020-06-01 22:25:47 -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
Ben Halpern
fb6685ec1b
[deploy] Change default fetch format in cloudinary links (#8226) 2020-06-01 17:53:04 -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
dependabot-preview[bot]
753cc49062
Bump lint-staged from 10.2.6 to 10.2.7 (#8198)
Bumps [lint-staged](https://github.com/okonet/lint-staged) from 10.2.6 to 10.2.7.
- [Release notes](https://github.com/okonet/lint-staged/releases)
- [Commits](https://github.com/okonet/lint-staged/compare/v10.2.6...v10.2.7)

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-01 13:57:24 -04:00
dependabot-preview[bot]
52ac57399f
Bump @percy/agent from 0.26.7 to 0.26.8 (#8196)
Bumps [@percy/agent](https://github.com/percy/percy-agent) from 0.26.7 to 0.26.8.
- [Release notes](https://github.com/percy/percy-agent/releases)
- [Changelog](https://github.com/percy/percy-agent/blob/master/CHANGELOG.md)
- [Commits](https://github.com/percy/percy-agent/compare/v0.26.7...v0.26.8)

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-01 13:57:08 -04:00
Ridhwana
02109e8e9a
feat: update the DEV Digest to be fully dynamic (#8213) 2020-06-01 13:56:29 -04:00
dependabot-preview[bot]
5fd308c3c0
[deploy] Bump aws-sdk-lambda from 1.41.0 to 1.42.0 (#8199)
* Bump aws-sdk-lambda from 1.41.0 to 1.42.0

Bumps [aws-sdk-lambda](https://github.com/aws/aws-sdk-ruby) from 1.41.0 to 1.42.0.
- [Release notes](https://github.com/aws/aws-sdk-ruby/releases)
- [Changelog](https://github.com/aws/aws-sdk-ruby/blob/master/gems/aws-sdk-lambda/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-ruby/compare/v1.41.0...v1.42.0)

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

* Bump aws-sdk-lambda from 1.41.0 to 1.42.0 (Update vendor/cache)

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-06-01 11:58:58 -05:00
rhymes
e48dde56cc
[deploy] Temporarily raise read_timeout of Github::OauthClient (#8220) 2020-06-01 18:16:34 +02:00
rhymes
70dc2429bc
Add timestamps to broadcasts (#8181)
* Add timestamps to broadcasts

* Update schema version
2020-06-01 18:11:38 +02:00
rhymes
552c581412
Revert "[deploy] Upgrade nvm to use node 12.17 (#8209)" (#8219)
This reverts commit 3233558c5d.
2020-06-01 11:54:47 -04:00
Molly Struve
38634e5316
[deploy] Optimization: Remove Comment Count From Aysnc user_data (#8174) 2020-06-01 10:38:57 -05:00
dependabot-preview[bot]
23d7fa6ac1
[deploy] Bump twilio-ruby from 5.35.0 to 5.36.0 (#8202)
* Bump twilio-ruby from 5.35.0 to 5.36.0

Bumps [twilio-ruby](https://github.com/twilio/twilio-ruby) from 5.35.0 to 5.36.0.
- [Release notes](https://github.com/twilio/twilio-ruby/releases)
- [Changelog](https://github.com/twilio/twilio-ruby/blob/master/CHANGES.md)
- [Commits](https://github.com/twilio/twilio-ruby/compare/5.35.0...5.36.0)

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

* Bump twilio-ruby from 5.35.0 to 5.36.0 (Update vendor/cache)

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-06-01 10:36:27 -05:00
dependabot-preview[bot]
91acad3231
Bump mini_racer from 0.2.10 to 0.2.14 (#8203)
* Bump mini_racer from 0.2.10 to 0.2.14

Bumps mini_racer from 0.2.10 to 0.2.14.

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

* Bump mini_racer from 0.2.10 to 0.2.14 (Update vendor/cache)

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-06-01 10:35:26 -05:00
Nick Taylor
a72831b952
Import jest-axe matchers via setupFilesAfterEnv config property (#8217)
* Now expect is extended for jest-axe via the jest setupFilesAfterEnv config property.

* Renamed a test setup file for jest.
2020-06-01 16:37:32 +02:00
Molly Struve
699f9c8144
[deploy] Optimization:Use Scope and current_user to Get Notification Count (#8177) 2020-06-01 09:27:46 -05:00
dependabot-preview[bot]
a3c62df266
Bump dogstatsd-ruby from 4.8.0 to 4.8.1 (#8200)
* Bump dogstatsd-ruby from 4.8.0 to 4.8.1

Bumps [dogstatsd-ruby](https://github.com/DataDog/dogstatsd-ruby) from 4.8.0 to 4.8.1.
- [Release notes](https://github.com/DataDog/dogstatsd-ruby/releases)
- [Changelog](https://github.com/DataDog/dogstatsd-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/DataDog/dogstatsd-ruby/compare/v4.8.0...v4.8.1)

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

* Bump dogstatsd-ruby from 4.8.0 to 4.8.1 (Update vendor/cache)

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-06-01 09:26:35 -05:00
dependabot-preview[bot]
317377cca9
Bump blazer from 2.2.2 to 2.2.4 (#8204)
* Bump blazer from 2.2.2 to 2.2.4

Bumps [blazer](https://github.com/ankane/blazer) from 2.2.2 to 2.2.4.
- [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.2...v2.2.4)

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

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-06-01 09:26:11 -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
rhymes
3233558c5d
[deploy] Upgrade nvm to use node 12.17 (#8209) 2020-06-01 09:48:16 -04:00
Gagan Lokesh
3b188d349a
Fix database seeding issue (#8191) (#8192)
Error description: `NoMethodError: undefined method `limit' for nil:NilClass`
2020-05-31 13:30:33 -05:00
Molly Struve
8e0828d86b
[deploy] Optimization: Remove Unused Fields From Async user_data, optimize a couple other methods (#8173) 2020-05-31 13:21:32 -05:00
Molly Struve
e1b99b1b96
[deploy] Generate Random Health Check Tokens on App Setup (#8178)
Co-authored-by: rhymes <rhymesete@gmail.com>
2020-05-30 14:11:02 -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
Molly Struve
b6a88778ad
Optimization:Remove followed_organization_ids from Async user_data (#8176) 2020-05-30 11:40:21 +02:00
Ben Halpern
5ad7d6ee4e
Update copy on editor help (#8166) 2020-05-30 11:30:35 +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
Ben Halpern
9de9c57c63
Remove unnecessary "action-space" for non-signed-in users (#8159)
* Remove published-at for narrow screens

* Action space

* revert published-at-thing
2020-05-29 13:48:14 -04:00
dependabot-preview[bot]
927c0429c0
[deploy] Bump @babel/plugin-transform-react-jsx from 7.9.4 to 7.10.1 (#8126)
Bumps [@babel/plugin-transform-react-jsx](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-react-jsx) from 7.9.4 to 7.10.1.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.10.1/packages/babel-plugin-transform-react-jsx)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-05-29 11:56:32 -05:00
dependabot-preview[bot]
5f6b770395
Bump twilio-video from 2.4.0 to 2.5.0 (#8127)
Bumps [twilio-video](https://github.com/twilio/twilio-video.js) from 2.4.0 to 2.5.0.
- [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.4.0...2.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-05-29 11:56:14 -05:00
Molly Struve
d93c987246
Dependabot/bundler/rspec rails 4.0.1 With Vendor Cache (#8144)
* Bump rspec-rails from 4.0.0 to 4.0.1

Bumps [rspec-rails](https://github.com/rspec/rspec-rails) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/rspec/rspec-rails/releases)
- [Changelog](https://github.com/rspec/rspec-rails/blob/master/Changelog.md)
- [Commits](https://github.com/rspec/rspec-rails/compare/v4.0.0...v4.0.1)

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

* Bump rspec-rails from 4.0.0 to 4.0.1 (Update vendor/cache)

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-05-29 11:53:28 -05:00
ludwiczakpawel
a161d3ce31
[deploy] Redesign article editor (#7524) 2020-05-29 11:59:37 -04:00
Mac Siri
e812f995fe
[deploy] Remove redundant ActsAsTaggableOn::Taggable::Cache (#8102) 2020-05-29 10:27:13 -04:00
Mac Siri
25c1f9210f
Remove redundant include of CloudinaryHelper (#8136) 2020-05-29 10:26:46 -04:00
Molly Struve
15d2dd0b3a
Remove cached_followed_tag_names From Async User Data (#8148) 2020-05-29 10:24:26 -04:00
Michael Kohl
c3f3575dcf
Make DB seeding idempotent (#8153) 2020-05-29 10:21:00 -04:00