Commit graph

688 commits

Author SHA1 Message Date
Anna Buianova
c07eb8d9cd Define Doorkeeper::Application association (#4065) [ci skip] 2019-09-19 10:28:55 -04:00
Mac Siri
e6e57c8835 Fix mention's inconsistent hyperlink (#4051)
* Upgrade mention parsing logic

* Avoid hardcoded link in spec
2019-09-18 14:15:06 -07:00
Anna Buianova
0a16bf934a Added association between webhook_endpoints and oauth apps (#4060)
* Added association between webhook_endpoints and oauth apps

* Limit webhooks access by oauth_app_id when authorized by doorkeeper

* Use rails route helpers in webhooks api test
2019-09-18 13:25:40 -07:00
Oleksii Filonenko
8d9bad372b Move index.delay.delete_object calls to ActiveJob (#4028)
* Move index.delay.delete_object calls to ActiveJob

* Rename {Algolia,Search}::RemoveFromIndexJob

* Update queue_as for Search::RemoveFromIndexJob
2019-09-17 14:10:38 -07:00
Anna Buianova
ce93c436a7 Implement API endpoint for user's webhooks (#4013) 2019-09-17 13:24:44 -04:00
Anna Buianova
78472d1529 Send only public events to the webhook endpoints #3715 (#4046)
* Dispatch an event only when a published article is created

* Skip sending events about drafts updates

* Skip sending events when a draft is destroyed

* Fix article request spec

* Slight refactoring
2019-09-17 08:00:04 -07:00
Mac Siri
64f70fff8f
Use build_stubbed in Policy specs (#4017) [ci skip] 2019-09-13 11:38:58 -04:00
Ben Halpern
4076a74cdf
Disallow banned users from updating profile, add noindex to page (#4018)
* Disallow banned users from updating profile, add noindex to page

* Fix user profile tests
2019-09-12 19:24:57 -07:00
Mac Siri
5fba3bd4b9
Improve test speed (#3957) [ci skip] 2019-09-12 16:17:20 -04:00
Ben Halpern
d9634150d8
Add new mod links and tooling (#4009)
* Add new mod links and tooling

* Adjust mod page copy, test
2019-09-12 00:11:01 -04:00
Anna Buianova
2d04488f4d Dispatch events only to the corresponding user endpoints (#4008)
* Dispatch events only to the corresponding user endpoints

* Specify user for dispatch webhook event test to be sure

* Fix webhooks specs
2019-09-11 15:33:11 -04:00
Jacob Herrington
59e7c104f2 Remove commented code and tests (#3989) [ci skip] 2019-09-09 14:51:02 -04:00
John Curcio
1a8132f892 Fix encoding of special characters on organization page rendering (#3944) 2019-09-09 14:13:23 -04:00
Andy Zhao
c9a116db42 Fix edge case for rewarding when unpublished (#3987) 2019-09-09 12:33:50 -04:00
rhymes
b6c27f34fa Use a sortable unique ID for the event_id (#3972) 2019-09-09 10:15:12 -04:00
Mac Siri
14263b287d
Make markdown's mention work with italic (#3868) 2019-09-09 09:23:06 -04:00
Anna Buianova
4c9a40be41 Dispatch events to the webhook endpoints #3715 (#3872)
* Start with webhooks: table and model

* Start with webhooks api

* Start with webhooks api

* Webhook::Event class and events list

* Remove commented callbacks

* Start with sending events to webhook endpoints

* A couple of tests for Articles::Creator

* Send event to webhook endpoint on article destroy

* Dispatch event on article update

* Dispatch event when an article updated from admin

* Spec for the webhook job

* One more test for the dispatch event job

* Integration-like spec for event dispatching to webhook endpoints when creating an article

* Use Addressable::URI to parse endpoint url

* Add oj as a faster fast_jsonapi backend

* Renamed serializers

* Move article serialization out of a model

* Don't allow to create a webhook event with invalid type

* Add fields for ArticleSerializer

* Fix webhook event job specs

* Specify timeout when dispatching events

* Fix webhook job spec

* Change webhook events queue name

* Change serialized article fields for the dispatchable events

* Include user data when serializing an article for webhook event

* Moved decorating out of Webhook::DispatchEvent, fixed most specs

* Fix route in ArticleSerializer

* Move Article decoration to Webhook::PayloadAdapter

* Refactor image url helpers to avoid including helpers into serializer

* Fix specs

* Default url options for production
2019-09-07 13:17:45 -04:00
rhymes
f7d6874956 Paginate notifications (#3948)
* Use offset instead of page and explain things

* Make load more button work

* Add tests for admin view

* Restore the previous logged out behavior

* Modernize initNotifications.js

* Revert "Modernize initNotifications.js"

This reverts commit 4a112b797d7911c4ab63ad0c0a07111b4e7abe25.

* Fix elements presence errors

* Change load-more-button to only appear if 7 or more posts (and some notification copy adjustments)
2019-09-07 11:54:30 -04:00
Andy Zhao
8a4030c25d Revert changes as a hotfix (#3964) 2019-09-06 11:54:35 -04:00
rhymes
69c8b24c34 Send JSON 404 response to API error routes (#3959)
* Fix an issue where API 404 calls got the HTML 404 page in response

* Use keyword for consistency
2019-09-06 10:18:50 -04:00
rhymes
2e5a847ab8 API: /api/articles/me defaults to published articles (#3937)
* /api/articles/me defaults to published articles

We want to make it explicit to retrieve unpublished articles, this change defaults `/api/articles/me` to only published articles, also adds `/api/articles/me/published`, `/api/articles/me/unpublished` and `/api/articles/me/all` to make requests more explicit.

* Refactor /me logic into a case switch
2019-09-04 14:02:13 -04:00
Andy Zhao
e25d2eaec9 Escape raw tags in codeblocks properly (#3790) 2019-09-04 08:33:46 -04:00
not-a-patch
6b7d45baed Update article specs to include missing dependent: :destroy (#3873) [ci skip] 2019-09-03 17:38:13 -04:00
rhymes
676cf002bd Webhooks: API fixes and docs (#3901)
* Fix webhook API and add POST /api/webhooks docs

* Document GET /api/webhooks/:id

* Fix DELETE /api/webhooks/{id} and document it

* Add proper 404 specs
2019-09-03 10:41:23 -04:00
Mac Siri
5e75bf3aaa
Update PingAdmins to show triggering event (#3853) 2019-09-03 10:23:25 -04:00
Jacob Herrington
07944755ff Fix rubocop lints (#3922) [ci skip] 2019-09-03 10:09:48 -04:00
rhymes
77e34a726d Fix flaky listings specs (#3899)
* Fix flaky listings specs

* Fix another flaky test
2019-09-02 13:23:41 -04:00
Mario See
fda048dc12 Listing Drafts and Deletion (#3540)
* wip init handle draft class and styling

* add draft button

* start splitting up listing row into multile files

* separate tag links

* split location

* fix location

* separate listing row action buttons

* update listing row proptypes to describe listing object

* contact via connect to jsx

* fix default checked

* init draft creation and first publish charge

* fix first publish logic and credit charging

* handle drafts in dashboard filtering

* adjust isDraft bool statement

* hide drafts from main listings feed

* fix expired and draft bools in listing row

* adjust create listing org credits

* internally handle drafts

* adjust listing row

* break down update method

* remove unnecessary logic and shorten lines

* fix logic again woops

* convert input hidden value + submit into one form button submit with corresponding name and value

also adds clear message that drafts do not cost credits

* handle insufficient org credits on first publish

- uses user credits to publish
- similar to bump implementation

* fix sorting for personal and all orgs

* space out some elements

* don't spend original users credit for them

* add delete buttons and delete_confirm and destroy methods

* remove notification removal since listings dont trigger notifications

* move draft message and add draft_params to tests

* Update classified_listings_controller.rb

* update tests

* update snapshot

* add del tests

* add guard preventing free draft publish

* fix draft filter

* update from master and resolve merge conflict in listing preact

* Revert "update from master and resolve merge conflict in listing preact"

This reverts commit 0a34fccf334a2ca0902644b486cb26ead6bef664.

* update column spec

instead of setting and saving

* separate two expectations into their own tests

* split more tests into single expectations

* change to unless bumped_at? instead of if nil

* Fix listing draft edge cases and styling

* Add title tags to listings pages
2019-09-01 13:54:54 -04:00
Michael Tharrington
5cdd3e2f10 Update Email Copy for internal/reports (#3867) 2019-08-30 09:58:30 -04:00
Jean-Michel Fayard
4af02c8a48 Support for runnable kotlin snippets #3776 (#3801) 2019-08-29 16:06:17 -04:00
Anna Buianova
bfdf636dcf Implement webhook & API endpoints #3715 (#3783) 2019-08-29 10:23:41 -04:00
Ben Halpern
67a8dbcd04
Add hashtags to linkedin body (#3866) 2019-08-28 14:49:31 -04:00
Ben Halpern
9259a70ab8
Modify onboarding slides (#3864) 2019-08-28 11:05:57 -04:00
Ben Halpern
208bbb3757
Improve mod roundrobin notification and internal tooling (#3855)
* Improve mod roundrobin notification and internal tooling

* Fix tests
2019-08-27 21:54:09 -04:00
cyrillefr
369aeb9130 Fix comment deletion bug (#3732)
Fix bug where deleted comment still appears on user's profile
2019-08-27 17:07:09 -04:00
John Curcio
0f2ae535c8 Removes temp .received file (#3731) (#3821) 2019-08-25 12:30:27 -04:00
Ben Halpern
3443fdf2bd
Create endpoint for liquid tag embed (#3813) 2019-08-23 17:42:04 -04:00
Anna Buianova
9b04654e3b Refactor articles creation (#3797)
* Refactor articles creation

* Create article from /admin via a service for consistency

* Move articles destroy logic into Articles::Destroyer
2019-08-23 14:43:29 -04:00
Ben Halpern
76bedc6b23
Add onboarding variants and update variant display ratio (#3812) 2019-08-23 12:48:29 -04:00
John Curcio
6dbb588d37 Add android and ios apps download page (#3736) (#3798)
* Add android and ios apps download page (#3736)

* Adhere to Rubocob's style guide
2019-08-22 21:04:58 -04:00
Ben Halpern
a287263875
Remove listings privileges from banned users (#3784) 2019-08-21 16:44:27 -04:00
Ben Halpern
04a810d739
Fix video image redirect issue (#3778) 2019-08-20 13:18:38 -04:00
Anna Buianova
5deb668ecd Rubocop fixes (#3774) 2019-08-20 10:32:26 -04:00
Andy Zhao
e0da0ac955 Fix for multi-image upload to handle single imgs for comments (#3771)
* Fix for multi-image upload to handle single imgs for comments

* Remove additional multiple oops
2019-08-19 18:15:35 -04:00
Ben Halpern
40559a0457
Add random variants to onboarding for a/b testing (#3742)
* Add random variants to onboarding for a/b testing

* revert listings dashboard snapshot
2019-08-18 18:30:22 -04:00
Bolarinwa Balogun
41aff162cc Allow upload of multiple images at a time (#3599)
* Allow upload of multiple images at a time

* Update schema.rb
2019-08-18 15:03:14 -04:00
Jess Lee
66a4424f5b Sponsorship Updates (#3719)
* show blurb for tag sponsors

* check that sponsorhip is live and account for expiration time

* automatically add expiration date to tags

* update tag offering

* rewrite tag auto expiration

* night mode compatibility for sponsor logos

* fix spec

* update specs

* Small css adjustment
2019-08-16 14:54:26 -04:00
cyrillefr
30828cf0f7 Move delayed calls for update analytics to Active job (#3603)
* Move delayed calls for update analytics to Active job

  - add job + job spec
  - refactoring

* update namings+specs due to requested changes after review

* Fixes on analytics job spec + minor refactor of service
2019-08-16 12:41:37 -04:00
Andy Zhao
0f46b0deed Add Stack Exchange Liquid tag (#3637)
* Add Stack Exchange Liquid tag

* Add Stack Exchange/Overflow tag

* Convert to integers

* Add better error handling

* Make all links open in new tab

* Adjust names and refactor a bit

* Use key for every API call

* Add new lines to end of svg files

* Add better error handling

* Fix edge case where input is not numeric

* Finalize Stackexhange tag design and functionality

* Fix css typo

* Update snapshots

* Fix snapshot back
2019-08-14 15:01:47 -04:00
Ben Halpern
d1760c4d08
Fix mention notification to mention proper user (#3721) 2019-08-14 14:43:21 -04:00