Commit graph

2273 commits

Author SHA1 Message Date
Molly Struve
36aed0458e create social preview for comment that is missing commentable (#5171) [deploy] 2019-12-19 11:14:37 -05:00
Matheus Azzi
662a99ade3 Remove unnecessary reaction call (#5122) [deploy]
Clicking the button to follow people on search page was erroneously
triggering a reaction request, thus not having the reactable_id.

We've updated the handlers not to trigger it.
2019-12-19 11:03:34 -05:00
Molly Struve
4a2e55ff06
Return not_found Response If Video's Related Article is Not Found (#5169) [deploy] 2019-12-19 09:41:59 -06:00
Jacob Herrington
00dd84f9e1 Add a default message to badge award action (#5160)
* Add a default message to badge award action

Because:
 - The only badges routinely awarded manually use the same message
 - Right now, unfriendly/unsafe UI can result in an error notification

The only badges that are currently awarded manually (afaik) have the
message "Congrats!!!" so for the time being, if a message is not
supplied to the UI, it will simply use the "Congrats!!!" message as a
default.

That being said, I'm not totally convinced this message won't work for
the long term. Generally, if we are awarding badges by hand, I'd imagine
we'd want a specific message explaining why we are doing that, or just
be okay with "Congrats!"

After talking with Peter about it, the longer term goal should be to
move badge messages into the database so they can be modified in the app
and not hardcoded. That also make sense regarding the effort to
genericize the app eventually.

* Test Badge notifications
2019-12-19 10:38:57 -05:00
Anna Buianova
dcfa6d29b8 Fix Rubocop lints (#5155) 2019-12-19 10:09:37 -05:00
Molly Struve
b5614a34e2
Dont Raise Error For Incorrect Liquid Tags (#5089) [deploy] 2019-12-18 11:23:39 -06:00
Ben Halpern
63f228c57c
Skip serviceworker logic for Twitter iOS referrals (#5159) [deploy] 2019-12-17 15:21:17 -05:00
Jacob Herrington
d98f8237bd Add view for managing organizations (#5149) [deploy]
* Add view for managing organizations

This adds only an index and show action for the internal/organizations
page. Eventually we'll flesh this out with features to automate the more
mechanical org management tasks.

* Use instance variable for search query

* Convert multiple expects into one

* Add pagination to organizations

* Add search spec for organizations

* Use size over count
2019-12-17 12:07:11 -05:00
Ben Halpern
4349843c05
Frontend bug fixes (#5158) [deploy]
* Frontend bug fixes

* One line fix
2019-12-17 10:56:51 -05:00
Molly Struve
1a76fa03d7 Return ActionController::RoutingError error when Invalid Format is Requested (#5140) [deploy]
* Return ActiveRecord::RecordNotFound error when an invalid format is requested

* raise ActionController::RoutingError when template is not found
2019-12-17 10:00:12 -05:00
Lucas Hiago
1d97f32285 Refactor UserPolicy (#5095) 2019-12-17 09:45:08 -05:00
Ben Halpern
7684c1e8b9
Add edge caching to shell (#5146) [deploy]
* Add edge caching to shell

* Add tests for shell
2019-12-16 19:08:59 -05:00
Ben Halpern
4eb0477223
Fix feedback_messages styling (#5147) [deploy] 2019-12-16 19:00:21 -05:00
Ben Halpern
07a7e9c075
Monkeypatch method to ensure https redirect (#5145) [deploy] 2019-12-16 18:15:14 -05:00
Dan Ingenthron
12dae72b72 Refactor/lint onboarding slides (#4240) 2019-12-16 17:22:59 -05:00
Ben Halpern
3d0ae601fb
Remove unnecessary catch (#5144) [deploy] 2019-12-16 15:28:11 -05:00
Abner Soares Alves Junior
536c62da89 Refactor all has_enough_credits to enough_credits (#5119) 2019-12-16 15:00:59 -05:00
Ben Halpern
1e34a2d8f9
Move navbar rendering JS inline (#5141) [deploy] 2019-12-16 14:48:02 -05:00
Ben Halpern
500ec5d3b0
Guard for presence of page-content in JS (#5138) [deploy]
* Guard for presence of page-content in JS

* Modify offline states sw

* Change from skipping . to skipping .js and .css

* Bump static cache version
2019-12-16 14:02:59 -05:00
Ben Halpern
630c1b7425
Migrate to streaming app shell via serviceworkers (#5020) [deploy]
* Initial work for streaming app shell way of using serviceworkers

* Close in on serviceworker adjustment finalization

* Add docs and loading indicator

* Remove useless code

* Don't run on API

* Update app/javascript/contentDisplayPolicy/hideBlockedContent.js

* Fix small details

* Don't run serviceworker.js code in test env

* Fix JS in serviceworker

* Move private keyword to proper place in async controller

* Change shell_version to HEROKU_SLUG_COMMIT

* Update caching config

* Add test for async_info/shell_version
2019-12-16 12:21:33 -05:00
Jacob Herrington
35ede32be7 Internal bulk badge awarder (#5110) [deploy]
* Move admin specs

These tests should probably be grouped together, so I moved them into a
directory called "internal"

This also encourages some additional internal tests.

* Add an internal badges controller

* Add internal view for running BadgeRewarder task

Because:
  - Peter is currently running this rake task from Heroku and this is
  going to make his workflow easier
  - It's a step towards having a decent tool under internal for managing
  badges (though I'd hesitate to call this decent)

This change adds a view and controller action to award badges in
batches, it's an improvment over the current workflow that Peter is
using, but it's still very rough around the edges.

We could definitely improve this with some error handling around the way
the BadgeRewarder works, but for now this is a net gain over how Peter
has been doing this task. I think it's worth merging as is and future
work to improve the experience and reliability of this tool can be
prioritized against other tasks.
2019-12-16 11:31:37 -05:00
John Curcio
145c76bc08 Fix fullscreen button issue by allowing popups (#5115) [deploy] 2019-12-16 08:26:07 -05:00
James George
f03867f77d refactor: use Array.includes instead of indexOf (#5117) 2019-12-16 08:10:44 -05:00
Ben Halpern
b599b66ce1
Cosmetic adjustment + code cleanup for article/mod page (#5105) [deploy]
* Cosmetic adjustment + code cleanup for article/mod page

* Remove br tags and clean up css
2019-12-15 17:43:24 -05:00
Molly Struve
9912bbcdb8
Asynchronously Update Algolia after a PageView Update (#5076) [deploy] 2019-12-13 14:07:33 -06:00
Molly Struve
d6e513e1ac Default return all user notifications if filter is unknown (#5103) [deploy] 2019-12-13 14:35:53 -05:00
Molly Struve
cc808251ee Remove unused aggregation reaction cache (#5104) 2019-12-13 13:18:44 -05:00
Spencer
82f5bb9cdd Mod tooling: add tags via /mod refactor (#5017)
* mod view form changes

* add error validation for removal tag

* add error validation to tag_list count

* re-render tag_adjustment form errors

* refactor admin delete adjusted tags form

* add prompt to tag adjustment form select

* front end validations to add/remove tag_adjustment

* allow tag_mod to undo own tag adjustment

* update/add specs

* update send spec

* update tag adjustment spec
2019-12-13 13:02:45 -05:00
Nick Schwaderer
b7bb7b473c Respond to xml request with error on Articles#feed (#5077) 2019-12-13 12:30:26 -05:00
Ben Halpern
9682394831
Remove unnecessary notifications fragment cache (#5083) [deploy] 2019-12-13 11:37:55 -05:00
Bolarinwa Balogun
8c6adac7ba Remove special characters in tags for articles created via API (#4239) [deploy] 2019-12-13 11:29:02 -05:00
Anna Buianova
05fe308f5b Removed old user indexing code (#5102) 2019-12-13 10:44:12 -05:00
Molly Struve
aa9361798d
Return not_found response rather than trying to authorize a nil object (#5093) [deploy] 2019-12-13 09:39:40 -06:00
Lucas Hiago
d1a89eab15 Refactor method in articles.rb (#5094) 2019-12-13 08:23:19 -05:00
Molly Struve
c8e712b6c8 remove caches for html that contains no external requests (#5098) 2019-12-13 08:22:27 -05:00
Jacob Herrington
b34ae9b7d9 Remove dead code (#5090) [deploy] 2019-12-12 12:19:55 -06:00
Molly Struve
dc5ec4e52f
Use find_or_create_by to avoid duplicate records (#5092) 2019-12-12 12:01:15 -06:00
Molly Struve
6ba2853168 Ensure that we have a slug and owner before attempting to lookup an article (#5079) 2019-12-11 13:19:45 -05:00
Jacob Herrington
145db47a3a Add single resource admin concept (#5069) [deploy]
* Add a trait for single_resource_admins to users factory

* Add single_resource_admin authrization for Growth view

* Expand GrowthController test coverage

* Add single resource admin workaround to models

* Add single resource admin to additional views
2019-12-11 13:17:55 -05:00
Anna Buianova
bbc5f95d86 Fix Algolia deserialization errors by indexing by record_type and id rather than AR object (#5063) [deploy] 2019-12-11 11:49:35 -06:00
Molly Struve
2d6d611634 switch back to update_column to improve performance (#5074) [deploy] 2019-12-10 18:38:04 -05:00
Andrew Sverdrup
2af033fca9 Add Next Tech Liquid Tag (#4958) [deploy]
* Add liquid tag for Next Tech

* Add liquid tag for Next Tech

* Use project share URL in liquid tag.

* Update docs and specs with share token URL.
2019-12-10 15:19:30 -05:00
Andy Zhao
71157c993e Hide comment feature (#4944)
* Add MVP of hide comment feature

* Slight copy adjustments

* Remove unused file oops

* Fix strange styling issues

* Add hide/unhide comment specs

* Authenticate user for hide/unhide

* Add tests for hide/unhide functionality

* Remove opacity CSS for hidden comments

* Fix hidden comment explanation logic

* Fix some styling issues

* Fix hiding top level comment logic

* Show only hidden comments in permalink and not thread

* Hide subtree properly if hidden comment

* Fix weird CSS issue

* Properly hide comments for permalink view

* Show children comments in permalink view

* Add tests for comment hiding visibility

* Remove superfluous code and adjust copy

* Remove some more logical duplication

* Add dedicated article column for any comments hidden

* Add reload in test
2019-12-10 15:09:47 -05:00
Molly Struve
98b832155f Ensure remember_user_token is present for Fastly with specs (#5065) 2019-12-10 15:01:26 -05:00
Molly Struve
3f8a6caa72
Use find_or_create_by when updating a pageview and use update in case of creation (#5066) [deploy] 2019-12-10 13:48:50 -06:00
James Turner
b4507f21d4 Update itemprop to use mainEntity (#5060) 2019-12-10 14:43:24 -05:00
Ben Halpern
c746da3a5e
Remove unused "Edit" button as follow-on to #5056 (#5071) [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

* Remove edit button and modify css
2019-12-10 14:15:56 -05:00
Molly Struve
7c650dcb1c
Remove RedisRailsCache and replace with Rails.cache (#5059) [deploy] 2019-12-10 13:11:08 -06:00
Sarthak Sharma
4db5399ee8 Feature🚀: Ability to Delete Messages realtime (#5056)
* 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
2019-12-10 13:58:34 -05:00
rhymes
9c05e618db Improve speed of model tests by around 50/60 seconds (#5016) 2019-12-09 16:33:48 -05:00