Commit graph

2477 commits

Author SHA1 Message Date
Jacob Herrington
3e99fb527f Add StimulusJS and Refactor Internal article_script (#5539) deploy]
* Add StimulusJS 1.1.1

Because:
- Internal will likely need more interactivity going forward
- Vanilla JS and jQuery are great, but aren't quite as organized as we
might like
- Stimulus fits our model of what internal should be (imo)
- Adopting Preact or something with templating would require rewriting a
bunch of erb (that is currently working just fine)

Stimulus is a JavaScript framework that directly compliments turbolinks
and the approach vanilla Rails takes to JavaScript. I've set it up to
specifically be used in the internal views where we are currently using
jQuery and vanilla JS. I think we should chip away at the vanilla JS
currently in place with this, which appears to be both scalable and
pragmatic exactly the sort of tool we want for building our internal
tools.

* Replace crufty article JS with Stimulus

I'm swapping out some of the stuff going on in article_script.erb with
some StimulusJS, it seems like a good test case for Stimulus.

This lets us organize the code a little more intentionally and hopefully
fixes a small performance complaint that Michael had.

* Rename uncommunicative methods

* Add unit tests for Stimulus classes

* Move Stimulus code to javascript/internal
2020-01-24 16:00:24 -05:00
Josh Puetz
7444b315a4 Fix capitalization in settings placeholders (#5707) 2020-01-24 14:08:32 -05:00
Alain Mauri
8dc56dcf32 Remove mentions email notification job (#5708)
* Removed mentions email notification job
  * Removed related specs
2020-01-24 14:06:51 -05:00
rhymes
6ec91b0861 API tags: improve caching and purging (#5673) [deploy]
* Add pagination to /tags and proper caching to /tags and /tags/onboarding

* Correctly purge tags

* Fix broken specs

* Make Travis happy
2020-01-24 13:55:22 -05:00
Alex
4a7ecb2574
Move ExportContentJob to Sidekiq (#5688) [deploy]
* Create ExportContentWorker

* Create ExportContentWorker spec

* Update references to ExportContentWorker

* Fix UserSettings spec for sending email
2020-01-24 10:12:58 -08:00
Lucas Hiago
58439d3652 Change BustHomepageCacheJob to BustHomepageCacheWorker and move to sidekiq (#5581) 2020-01-24 12:59:34 -05:00
Maja Komel
3412af977f Don't raise StandardError for invalid liquid tags when updating comment (#5694)
* Don't raise StandardError for invalid liquid tags when updating comment

* remove text-align styling for alert error
2020-01-24 11:26:55 -05:00
Ben Halpern
8ed94c8fb1
Add conditional to prevent superfluous rerenders in chat compose (#5705) [deploy] 2020-01-24 11:23:48 -05:00
Spencer
49474d516e Allow comments from deleted articles to be viewed (#5199) [deploy] 2020-01-24 11:06:52 -05:00
Lucas Hiago
5aaa80d3a0 Remove Reactions::CreateJob and related spec (#5684) 2020-01-24 09:05:43 -05:00
rhymes
6c24357f16 Use edge caching for API Article show endpoint (#5669) [deploy] 2020-01-23 20:12:58 -05:00
Sarthak Sharma
75608e3e55 Feature🚀: Ability to mention anyone in open chats and notify them (#5460) [deploy]
* 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

* Feature 🚀 : Ability to mention member in Group [Frontend]

* Test Cases📝 : Test Cases added

* Feature 🚀 : Ability to mention member in Group [Backend]

* Bug Fix 🐞: Making messages realtime for open channels

* Feature 🚀 and Bug Fix 🐞: Ability to get notification if mentioned in open messages and increasing message number count

* Feature 🚀 : Ability to remove message count on channel open

* Bug Fix 🐞: Making Notification more reliable by checking if the new message is notified to user or not

* Feature 🚀 : Ability to metion @all and notify them

* Bug Fix 🐞: Minor fixes

* Fews tweaks in code

* Bug Fix 🐞: Feature was not present for Invite only Section

* Bug Fix 🐞: In open channels one can't mention all

* Bug Fix 🐞: Markdown conversion for all only in case of invite only

* Specs added

* Delete schema.rb

* Schema file updated

* Code refactoring

* Further Code refactoring backend

* Further Code refactoring backend

* Bug Fix 🐞: Mention List error problem in switching tabs

* Test Snapshots added

* Feature 🚀 : Ability to mention member in Group [Frontend]

* Test Cases📝 : Test Cases added

* Feature 🚀 : Ability to mention member in Group [Backend]

* Bug Fix 🐞: Making messages realtime for open channels

* Feature 🚀 and Bug Fix 🐞: Ability to get notification if mentioned in open messages and increasing message number count

* Feature 🚀 : Ability to remove message count on channel open

* Bug Fix 🐞: Making Notification more reliable by checking if the new message is notified to user or not

* Feature 🚀 : Ability to metion @all and notify them

* Bug Fix 🐞: Minor fixes

* Fews tweaks in code

* Bug Fix 🐞: Feature was not present for Invite only Section

* Bug Fix 🐞: In open channels one can't mention all

* Bug Fix 🐞: Markdown conversion for all only in case of invite only

* Specs added

* Code refactoring

* Further Code refactoring backend

* Further Code refactoring backend

* Bug Fix 🐞: Mention List error problem in switching tabs

* Test Snapshots added

* Feature 🚀: Ability to navigate through user list with keyboard only

* Bug Fix 🐞: Changing color of group avatars in dark themes

* Bug Fix 🐞: Setup pusher channel for open channels also
2020-01-23 18:06:35 -05:00
Asha Balasubramaniam
656e404097 Remove delayed job that creates podcast episode (#5678) 2020-01-23 17:32:18 -05:00
Vaidehi Joshi
9fb8875085 Use the correct cover image in article form preview (#5660) [deploy]
Fixes #5630, wherein the cover image from the article data was appearing in the preview.
2020-01-23 17:06:06 -05:00
Mac Siri
5f020860af Allow for proper deselect of email_newsletter (#5675) 2020-01-23 16:59:17 -05:00
Alex
0a59e3ea59
Delete Search::RemoveFromIndexJob job and spec (#5676) [deploy] 2020-01-23 13:14:46 -08:00
Asha Balasubramaniam
bc137ff762 Migrate PodcastEpisodes::CreateJob to PodcastEpisodes::CreateWorker for Sidekiq (#5633)
The tests around `Podcasts::Feed` helped catch a bug around the
migration of the podcast episode creation delayed job where the sidekiq
version was passing a string version of item hash to
`Podcasts::CreateEpisode` which was in fact expecting the hash to
contain symbols.
2020-01-23 15:37:43 -05:00
Alex
f6c2f46fbb
Move Search::RemoveFromIndexJob to Sidekiq (#5637) [deploy]
* Create RemoveFromIndexWorker

* Create spec for RemoveFromIndexWorker

* Update RemoveFromIndexJob to RemoveFromIndexWorker

- Update references from the job to the new worker
- Update specs to use the new worker
- Fix spec in comment_spec that causes linter/RuboCop violation

* Remove unnecessary argument nil check

* Update spec for missing data
2020-01-23 11:27:28 -08:00
Sun-Li Beatteay
5bebf628df Update ReadingListItemsController#update to return NotAuthorized (#5658)
* change ReadingListItemsController#update to return NotAuthorized if user_id does not match

* fix spec description

Co-authored-by: rhymes <rhymesete@gmail.com>
2020-01-23 13:22:48 -05:00
Anna Buianova
01456fe029 [deploy] Finalize deleting user associations (#5624)
* Prepare factories and associations for Users::DeleteActivity specs

* Altered user associations, delete the needed associations in Users::DeleteActivity

* Moved and refined user deletion spec

* Removed useless commented user associations

* Refactored BackupData factory

* Refactored ProfilePin factory

* Refactored Reaction factory

* Fixed specs: Keep default _type in factories or specify it in tests

* Ok, notes shouldn't be deleted on user deletion

* Fixed creating reactable for specs

* Specify commentable/commentable_type explicitly when creating data for tests

* Fixed typo in the comments spec

* Removed unnneeded space

* Added aggregate_failures for testing user associations deletion

* Keep feedback_messages while deleting user activities
2020-01-23 11:29:47 -05:00
rhymes
87167de8c5 Use correct cache keys on the articles API index endpoint (#5606) [deploy]
Surrogate keys are about setting expectations on cache purging.

Presently we use a combination of all parameters to set changing surrogate keys depending on the result of the `ArticleApiIndexService`. This approach has two limitations:

- if two set of params lead to the same exact set of articles, we still create two different caches

- deleted articles will remain for 24 hours in the cache because the cache key doesn't take the record keys into account

By simply using record keys we make sure that different params leading to the same result set will share the same cache and that deleted keys won't appear anymore in the cache.
2020-01-23 08:40:19 -05:00
Ben Halpern
52ada1450c
Add guard clause for presence of processed_html (#5638) [deploy] 2020-01-22 15:32:50 -05:00
Michael Kohl
d82bbb874e Add rate limits to admin interface (#5642) 2020-01-22 15:29:27 -05:00
Alex
c3fb23379f Remove IndexJob and spec (#5654) 2020-01-22 15:18:29 -05:00
Alex
75be0d3d23 Remove SlackBotPingJob and spec (#5655) 2020-01-22 15:17:52 -05:00
Nadiya Karachevska
e49b0e81e5 Return 404 NotFound error if ClassifiedListing is not found during delete (#5646) 2020-01-22 13:07:44 -05:00
serena
1297f1cb3e Replace Notifications::NotifiableActionJob with Notifications::NotifiableActionWorker for Sidekiq (#5588) [deploy] 2020-01-22 09:40:55 -05:00
Alex
4e5dc015b3 Move Search::IndexJob to Sidekiq (#5620) [deploy] 2020-01-22 08:24:53 -05:00
Alex
8cc791150c Move SlackBotPingJob to Sidekiq (#5615) 2020-01-22 08:24:33 -05:00
rhymes
09cf6719eb Use honeybadger.js from npm (#5643)
rails-assets.org is often down, and apparently has been down intermittently since yesterday.

In addition to this the only thing the gem does is literally to add `honeybadger.js` to the assets path:

```ruby
gem_path.join('app/assets').each_child.to_a
```

Hence we can ditch the gem and use the library directly.
2020-01-22 08:22:51 -05:00
Michael Kohl
5b35370db8 Introduce BanishedUser table (#5589) [deploy] 2020-01-21 17:15:58 -05:00
Ændrew Rininsland
5bd51f9cf5 Adds 4estate.media to Mastodon instance whitelist (#5625) 2020-01-21 08:59:52 -05:00
Alex
97a3ff8382 Delete unused OrganizationObserver (#5619) [deploy] 2020-01-21 08:04:59 -05:00
Molly Struve
a68e7b5267
Retry more for Articles::UpdateAnalyticsWorker since it can fail due to API rate limit errors (#5618) 2020-01-21 08:00:39 -05:00
Molly Struve
90470584a7
remove unused Algolia module from Tweet (#5617) 2020-01-21 08:00:06 -05:00
Shelley Vohr
b146528aa8 feat: add per-user Open Dyslexic font setting (#5037) [deploy]
* feat: add per-user Open Dyslexic font setting

* Adjust css slightly

Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2020-01-20 18:23:57 -05:00
rhymes
adfe1fac73 Optimize Notifications::Update and it specs (#5417) 2020-01-20 16:55:50 -05:00
Dainius Stankevicius
8c43c3d484 Utilize NewComment::Send in Notification model (#5565) [deploy] 2020-01-20 16:38:42 -05:00
Ben Halpern
ba6c70c2d2 [deploy] Raise not_found for spam-banished users (#5586)
* Raise not_found for banished users

* Move banished logic to decorator
2020-01-20 14:50:22 -05:00
rhymes
7cda85d644 Fix error handling bugs in stackexchange tag (#5490) 2020-01-20 14:43:25 -05:00
Maykon Menezes
ef1eb8d412 Refactor/user bust cache job (#5563)
* Refactor/user bust cache job

* Remove bust cache job old spec
2020-01-20 13:46:15 -05:00
Mukesh Chaudhary
3d14e2e6a6 Replace ProMemberships::PopulateHistoryJob with ProMemberships::PopulateHistoryWorker for Sidekiq 5305 (#5584) 2020-01-20 13:45:21 -05:00
Lucas Hiago
fb5cb7005c Change CreateJob to CreateWorker and move to sidekiq (#5559)
* Create new CreateWorker

* Create new spec for CreateWorker

* Change CreateJob to CreateWorker and move to sidekiq

* Update worker

* Update priority of Reactions Create Worker

* Remove leading spaces from spec
2020-01-20 11:29:13 -05:00
Michael Kohl
511f7418dd Refactor RateLimitChecker (#5521) 2020-01-20 11:27:54 -05:00
Alex
29af0b240a Remove NewFollowerJob and spec (#5569) [deploy]
* Remove NewFollowerJob and spec

* Remove NewFollowerJob from notification_spec
2020-01-20 08:27:33 -05:00
Alain Mauri
1217f1f08d Add mentions send email notifications worker (#5549)
* Added email notification worker for mentions
  * Modified the email generation to after_create_commit
  * Modified Mention model to use the new worker
  * Added tests for the worker
2020-01-20 08:24:42 -05:00
Alain Mauri
18b2b2cb4c Add Follows::CreateChatChannelWorker for Sidekiq (#5458)
* Added a new worker to create chat channels after a follow
* Moved the chat channe creation to after_create_commit hook
2020-01-20 08:23:44 -05:00
Ben Halpern
9fa5d3156a
Add article.comment_score metric calc and tracking (#5560) [deploy]
* Add article.comment_score metric calc and tracking

* Change from gauge to count

* Adjust key and tags
2020-01-19 15:21:19 -05:00
Ben Halpern
24246015bc
Move Chart.js to dynamic import (#5576) [deploy] 2020-01-18 20:46:35 -05:00
Ben Halpern
b3c3f5ab1f
Add onboarding sanetization (#5575) [deploy] 2020-01-18 19:16:23 -05:00