Commit graph

375 commits

Author SHA1 Message Date
rhymes
f2b0be2043
Add Slack messengers: part 2 (#6916)
* Add Slack::Messengers::ArticlePublished

* Add Slack::Messengers::ReactionVomit

* Add Slack::Messengers::CommentUserWarned

* Add missing URL helpers

* Add Slack::Messengers::ArticleFetchedFeed

* Remove callback condition

* Build, don't create
2020-04-03 17:00:06 +02:00
Molly Struve
44d0be9c76
[deploy] Setup User Elasticsearch Doc Syncing (#7049)
* sync related Elasticsearch docs when a user is updated

* check for changes in all user nested keys

* put user fields into a constant for easy access
2020-04-03 10:07:32 -04:00
Vaidehi Joshi
a3d12e03a3
Add set_up_profile notification, check for active broadcasts (#7054) [deploy]
* Replace current onboarding notification with set_up_profile welcome notification

Also ensure that only "active" set_up_profile welcome notification is sent, and that "inactive" ones are ignored.

* Notify only if broadcast active, log error if broadcast not found

* Reports to Honeybadger if an active broadcast cannot be found

* Reorganize order of generator specs

* Ensure welcome_broadcast can be written to in spec

* Remove redundant spec
2020-04-02 15:56:29 -07:00
Molly Struve
ef358c0213
[deploy] update articles when touched by reactions (#7001) 2020-04-01 13:26:56 -05:00
jituraj98
e2edf960dc
[deploy] Connect: move settings to sidecar iframe, improve invitations and remove experimental features (#6903)
* 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

* Move channel settings to sidecar

* added spec for chat_channels_memberships_controller.rb (#6539)

* added spec for chat_channels_memberships_controller.rb

* simplified record not found error for membership

* error message formatting updated

* added error key in flash message

Co-authored-by: jitendra <jitendrarajpurohit@skynox.tech>

* Refining "Move sidecar to iframe" branch (#6634)

* added spec for chat_channels_memberships_controller.rb

* simplified record not found error for membership

* error message formatting updated

* added error key in flash message

* 🐞 Bug Fix: Open sidecar of clicking @all

* 🐞 Bug Fix: adding space after selecting the username from suggestion box

* added remove channel member functionality for moderators

* 🔩 Small Tweaks: Hover issue fixed

* 🐞 Bug Fix: Remove sidecar toggle on @all tag (for now)

* updated manually constructed urls with rails path helpers

* mod users cannot remove members of other channel

Co-authored-by: jitendra <jitendrarajpurohit@skynox.tech>

* 🚀 Finalising the connect group/channel feature.  (#6829)

* added spec for chat_channels_memberships_controller.rb

* simplified record not found error for membership

* error message formatting updated

* added error key in flash message

* 🐞 Bug Fix: Open sidecar of clicking @all

* 🐞 Bug Fix: adding space after selecting the username from suggestion box

* added remove channel member functionality for moderators

* 🔩 Small Tweaks: Hover issue fixed

* 🐞 Bug Fix: Remove sidecar toggle on @all tag (for now)

* updated manually constructed urls with rails path helpers

* mod users cannot remove members of other channel

* mod members can now invite user who have left the channel

* 🐞 Bug Fix: Ability to open sidecar on mention all properly

* Eslint Changes

* send email notification on inviting user feature added

* 🛠  Email design enhancements for channel invitation

* send invitation to mod user added from internal

* 🛠  Gif changes for Mod

* spec fixed

* inviter name issue fixed

* 🚀 Open sidecar when automatically if you use link from email

Co-authored-by: jitendra <jitendrarajpurohit@skynox.tech>

* review changes

* added spec for channel_invite_email

* Bug🐞: Design problem with sidecar after merge

* Bug🐞: Design problem with invitation alert box

* replaced instance variables with local variable

* Bug🐞: Wrong css classes fixed

* Bug🐞: Edit option bug

* yarn.lock file updated

* code review changes

* updated manually constructed urls with rails path helpers in spec

* user name url issue fix in invite email

* user url corrected

Co-authored-by: Sarthak Sharma <7lovesharma7@gmail.com>
Co-authored-by: benhalpern <bendhalpern@gmail.com>
2020-04-01 12:13:26 -04:00
Molly Struve
ed90ddad10
Index Reading List Reactions (#6953)
* Index reactions when they are created and updated, remove when destroyed

* update reading list reactions when related article fields are updated

* create indexable method and use for indexing to elasticsearch
2020-03-31 12:23:43 -04:00
rhymes
a58596f25f
Correctly save Tweet reply ids (#6951) 2020-03-31 11:09:19 +02:00
rhymes
4baa9d3165
Remove job_opportunities table (#6932) 2020-03-30 12:08:10 -04:00
rhymes
118762ca9b
Some RSpec fixes (#6757)
* Fix spec/uploaders/profile_image_uploader_spec.rb

* Additional ordering based fixes

* Fix spec/requests/comments_spec.rb

* Fix spec
2020-03-24 13:16:19 -04:00
Molly Struve
3087d3d4d8
Index comments into FeedContent index (#6791) [deploy] 2020-03-24 09:24:20 -05:00
Andy Zhao
57d9d72c10
Update call to action box text styling (#6795)
* Use constant for type_of_user

* Add comment for clarity

* Remove legacy inline styles

* Move comment above the render
2020-03-24 10:49:37 +01:00
Mac Siri
0195d1be5b
Create specs for users/edit.html.erb (#6739)
* No longer create identity in User factory

* Create view specs for users/edit.html.erb

* Update broken specs

* Make identities transient an explicit array
2020-03-20 11:29:20 -04:00
Fernando Valverde
14c13cb33b
Adds Podcast Episode metadata as JSON to avoid scraping the HTML (#6727) [deploy]
* Adds Podcast Episode metadata as JSON to avoid scraping the HTML

* Uses app_url helper instead of app_protocol_and_domain string interpolation for podcastImageUrl

* Adds podcast_episode#mobile_player_metadata, cleans eslint/codeclimate mess I made & adds tests

* Removes an extra line to fix codeclimate

* Removes unnecessary return
2020-03-20 10:28:24 -04:00
Ben Halpern
bff4050c35
Add dynamic monthly sitemaps (#6704) [deploy]
* Initial sitemap work

* More sitemap progress

* Remove files

* Finalize monthly sitemap

* Update spec/models/organization_spec.rb

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

* Clean up approach

* Change tests

* Fix test not sure what problem was

Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
2020-03-19 17:20:23 -04:00
Molly Struve
7085082781
Add class_name to Elasticsearch ID field for Feed Content (#6729) [deploy] 2020-03-19 16:14:42 -05:00
rhymes
a333da23d1
Move dev/mascot account to class methods (#6694) 2020-03-18 14:42:40 +01:00
rhymes
20fd8cdb92
Replace observers with callbacks and remove rails-observers (#6675)
* Add test for vomit reactions ping

* Remove reaction observer

* Add tests for new published article ping

* Remove reaction observer

* Remove comment observer

* Fix specs

* Remove rails-observer gem
2020-03-18 09:58:36 +01:00
rhymes
b8b321c13d
Fix VCR warnings and use initializers (#6672) 2020-03-17 15:51:07 +01:00
Andy Zhao
d08f830d86
Add response templates model and table (#6615)
* Add response templates model and table

* Add missing factory oops

* Remove response templates on delete

* Remove moderator_id column from comments for now

* Use constants and add spec for response templates
2020-03-16 09:52:03 +07:00
rhymes
86129395eb
Cleanup tag validation a bit (#6604)
* Cleanup tag validation a bit

* Use symbols
2020-03-12 15:41:08 +01:00
Vaidehi Joshi
502bef156e
Allow an article's main_image to be removed (#5687) [deploy]
Currently, we don't allow users to remove the `main_image` of an article once it has been set. It can be changed, but never removed.
This change allows the `main_image` to be removed by checking for the `cover_image` key in the frontmatter that is sent along in the article's markdown. This means that a user should be able to remove the image associated with an article by removing the value of `cover_image:` from their frontmatter.
2020-03-10 08:29:59 -07:00
Ben Halpern
0817e2ac9e
Create implicit experience level rating vote upon creating of readinglist reaction (#6522) [deploy]
* Do not render or link to empty rss feeds

* s

* Move calculation to worker

* remove xit test

* Also allow implicit rating votes in comments

* Fix alignment issue

* Remove comment logic
2020-03-10 10:59:49 -04:00
rhymes
c7503fd0b1
Fix scripts startup check for development mode (#6520)
* Fix scripts startup check for dev mode

* Update doc
2020-03-09 17:15:21 +01:00
Molly Struve
82526989fc
Index Articles and Podcast Episodes to Elasticsearch (#6488) [deploy]
* Index Articles and PodcastEpisodes to Elasticsearch

* add callbacks to podcast episodes and specs

* refactor and clean up serializers
2020-03-06 16:39:36 -05:00
Molly Struve
731b89ca26
Index users into elasticsearch (#6489) [deploy] 2020-03-06 14:12:02 -05:00
Alex
35651b26e5
Remove Algolia from Comments (#6464) [deploy]
* Remove Algolia from comments

* Remove more references to ordered_comments index

* Remove more references to Comments Algolia index

* Fix index_worker_spec
2020-03-05 11:30:25 -08:00
Molly Struve
067cab1689
create searchable specs and remove redundant specs from AR models (#6450) [deploy] 2020-03-04 15:09:53 -05:00
Julianna Tetreault
f6478fb7cc
Replace peform_enqueued_jobs with sidekiq_perform_enqueued_jobs in specs (#6454)
* Replace peform_enqueued_jobs with sidekiq_perform_enqueued_jobs in specs

* Fix typo in reaction_spec
2020-03-04 11:39:48 -07:00
rhymes
f3e76e7fe5
Improve API docs for articles, add listings to it and fix bugs (#6413) [deploy]
* Fix articles index state param values

* Update Articles API docs

* Fix ClassifiedListing.cost_by_category with invalid category

* Add docs for GET|POST /listings and fix bugs

* Document PUT /api/listings/:id

* Add docs for /listings/category/{category}

* One variable down

* Improve listings update error handling
2020-03-04 15:30:02 +01:00
Michael Kohl
4e1ccf4a3a
Add .present? check (#6302) 2020-03-03 09:34:17 -05:00
Andy Zhao
a3728cfa4c
[deploy] Add EmailAuthorization model (#6335)
* Add EmailAuthorization model

* Add model file oops

* Add comment for uuid type

Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2020-03-02 12:14:24 -05:00
Gonzalo Ricco
5d22cdef79
Prevent deadlocks with article-collection updates. (#6371) [deploy]
When an article is updated the associated collection is touched along with all its articles. This creates a deadlock where two transaction(nested) lock the article that was updated.
With this commit the collection wll be touched after the article updates transaction has been commited. Doing so we have two sequential transactions.
2020-03-02 09:38:15 -05:00
Ridhwana
0f9c9d2738
Sanitisation of Ads (#6361) [deploy] 2020-02-28 13:20:34 -05:00
Michael Kohl
32e30c8844
Mailchimp resubscribe (#6256)
* Re-subscribe user to newsletter by setting MC status to pending

* Add guard clause and new spec

* Make trait name more explicit

* Fix guard clause and spec
2020-02-27 15:48:38 -05:00
Alex
037b2fa432
Fix pagination on Search::ChatChannelMembership (#6328) [deploy]
* Fix pagination logic

* Fix typo slig --> slug

* Add spec for returning empty Array vs nil

* Add spec for pagination

* Change expectation of test for empty Array
2020-02-27 09:56:05 -08:00
rhymes
2fcdb9bcaa
Use DataUpdateScript.scripts_to_run? in development (#6309) 2020-02-26 13:34:16 -05:00
Molly Struve
8f0bfa5e08
Implement Search for Chat Channels with Elasticsearch (#6282) [deploy] 2020-02-26 11:06:38 -05:00
Anna Buianova
057b1c7664
Fix Sponsorship validations to take expiration date into an account (#6276)
* Fix Sponsorship validations to take expiration date into an account

* Use prettier times in sponsorship specs
2020-02-25 16:41:28 -05:00
Alex
da259107bd
Refactor logic to index to Elasticsearch (#6286) [deploy]
* Refactor logic to index to Elasticsearch

* Rename worker argument to object_class

* Change to .constantize for better error messaging
2020-02-25 11:06:42 -08:00
Spencer
010c61a44a
Allow comments without a commentable to be edited and destroyed (#5945) 2020-02-25 13:45:50 -05:00
rhymes
33a11adca8
Various optimizations (#6249) [deploy]
* Pluck over map
* Explain why map makes sense there
* Refactor reactions controller a bit and iterate only once
* Use group by instead of N counting queries
* More positive
* Simplify BufferedArticlesController
* Less queries for MailchimpBot
* Use Rails instead of SQL
* Build comment_ids only when needed
2020-02-25 13:42:24 -05:00
rhymes
cf11268949
Add logging to data scripts runner (#6201) 2020-02-25 13:41:43 -05:00
Gonzalo Ricco
0b03240e5b
Add rescue InvalidURIError in mastodon_url validation (#6174) [deploy] 2020-02-24 19:13:40 -05:00
Matej Minárik
89dd843a50
Fix Flaky Comment Spec (#6250) 2020-02-24 18:48:45 -05:00
rhymes
168f5c597c
Bump Twitter to 7.0 and refactor TwitterBot (#6246) [deploy] 2020-02-24 08:34:41 -05:00
Molly Struve
318ee32cdd
Add worker for removing Elasticsearch docs (#6213) [deploy] 2020-02-21 08:13:36 -05:00
rhymes
bc385ae6d5
Switch decorators to Rails builtin decorations - take 2 (#6125) [deploy]
* Revert "Revert "[deploy] Switch decorators from Draper to Rails builtin decorations (#6040)" (#6122) [deploy]"

This reverts commit d438349550.

* Enable serialization for decorators

* Refactor and test default home feed serialization

* Improve spec

* Applied @vaidehijoshi suggestions

* Applied @citizen428 suggestions

* Make CodeClimate happy

* Cleanup stories_index_spec.rb

* Refactor UserDecorator#cached_followed_tags to loop less
2020-02-19 15:30:53 -05:00
Molly Struve
e752ff98af
Index ChatChannelMemberships to Elasticsearch (#6162) [deploy] 2020-02-19 14:29:16 -05:00
Juan Vasquez
c50c59c250
Prevent save on invalid canonical url (#6093) [deploy] 2020-02-19 13:55:27 -05:00
Alex
8d7b95ea15
Index ClassifiedListings to Elasticsearch (#6132) [deploy]
* Add ClassifiedListingEsIndexWorker & spec

* Update ClassifiedListing model

- Add es index methods (inline and async)
- Index ClassifiedListing to es after_commit
- Add serialized_search_hash
- Update model specs for new methods
- Add serializers referenced in new model method

* Update specs

* Create DataUpdateScript to index ClassifiedListings

* Fix formatting

* Fix codeclimate :/

* Use match_array instead of keys.sort

* Change find_by! to find

* Update spec

* Update mappings for ClassifiedListing

* Update specs

* Implement refactor with Searchable module
2020-02-19 09:55:37 -05:00