Commit graph

1223 commits

Author SHA1 Message Date
Michael Kohl
02f86fedd7
Allow admins to delete users without emails (#6530) [deploy]
* Allow admins to delete users without emails

* Guard against blank email addresses
2020-03-10 22:20:36 +01:00
Ben Halpern
923afed4e4
Move math around parenthases in score_experience_level (#6569) [deploy]
* Move math around parenthases in score_experience_level

* Clean up tests

* Remove flash notice from comments form
2020-03-10 14:14:08 -04:00
Liz Fong-Jones
239edd5204
use beeline 2.0 (#6568) [deploy] 2020-03-10 12:35:15 -04: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
Michael Kohl
8ab7a3fb6c
API: Remove reactions onboarding (#6529)
* Move reactions onboarding to internal API

* Don't add reactions onboarding to internal API

* Remove obsolete worker
2020-03-10 10:25:16 -04:00
Mac Siri
8e4905522d
Implement KatexTag (#6237) [deploy]
* Install Katex gem

* Add Katex stylesheet and spec

* Implement basic error handling

* Remove comment

* Create more spec

* Update approval file

Changes is due to turning off RedCarpet's superscript feature

* Add instruction to _editor_guide_text

* Serve our own KaTeX css

* Apply Rhyme's suggestion

* Limit Katex's css use

* Update spec

* Add spec

Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2020-03-09 17:58:54 -04:00
Molly Struve
7df5e6cfae
Rename feed method to correct name (#6557)
* rename method to correct name

* fix spec
2020-03-09 16:59:38 -04:00
Ben Halpern
5bd042e7d6
Prune old field tests for ongoing tests (#6540) [deploy] 2020-03-09 16:22:42 -04:00
Josh Puetz
a01d787301
Create comment ranking feed experiment (#6511) [deploy]
* Create more comments feed experiment

* Hook up experiment, rename

* Remove flakey test assertion
2020-03-09 14:20:02 -05: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
3556950322
store flare tag as a hash in Elasticsearch and add spec for putting json into ES (#6538) 2020-03-09 12:06:31 -04:00
Vaidehi Joshi
99c87d7a17
Replace WELCOMING_USER_ID with mascot_user_id (#6484) [deploy]
Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
2020-03-09 08:08:53 -07:00
Ben Halpern
1f81d1f225
Allow tag mods to approve posts even if they mod just one tag (#6525) [deploy] 2020-03-08 15:42:38 -04:00
rhymes
21fca3e0f2
Comments API: hide deleted and hidden comments (plus docs) (#6482) [deploy]
* Modernize index test

* Hide comments body_html and user info if the comment is either deleted or hidden

* Shorten lines a bit

* Freeze repeated strings

* Document all /comments

* Document /comments/{id}
2020-03-07 09:02:10 +01:00
Ben Halpern
4eb0080eee
Let mods mark articles that require approval as approved. (#6513) [deploy]
* Initial work to add approval to regular mod flow

* Add article_approvals controller and tests

* Add check for moderatable being article
2020-03-06 19:49:41 -05:00
Molly Struve
761a961fc6
fix banish user spec (#6515) [deploy] 2020-03-06 19:16:45 -05: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
Michael Kohl
183c24ca59
Show hidden comments on article mod page (#6493) 2020-03-06 16:12:07 -05:00
Andy Zhao
478d1b36a5
Hide banished users vomit confirmations and delete vomit reactions on banish (#6507) [deploy]
* Update to hide only banished users

* Refactor and move into a model method

* Delete vomits on banished users

* Add tests for banishing users
2020-03-06 15:35:30 -05:00
Molly Struve
731b89ca26
Index users into elasticsearch (#6489) [deploy] 2020-03-06 14:12:02 -05:00
Michael Kohl
8df0a72ce7
Move onboarding tags from public to internal API (#6329)
* Move onboarding tags from public to internal API

* Fix typo

* Undo wrong chang
2020-03-06 19:34:31 +01:00
Michael Kohl
0fd6c948d1
Move followings to internal API (#6494) 2020-03-06 19:33:26 +01:00
Josh Puetz
e2f190512b
Guarantee articles in main article feed (#6490) [deploy]
* Adjust feed offset, remove time limits for main feed

* Improve offset construction readability
2020-03-06 12:29:07 -06:00
Ben Halpern
2a1a675175
Changed shecoded preview template (#6475)
* Changed shecoded preview template

* Added a test for social preview template with multiple campaign tags

* feat: update some css properties to make it closer to the design (i think)

* Update to relative units

* Update spec

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2020-03-05 18:26:28 -05:00
Vaidehi Joshi
10cee2ec5c
Add a mascot_user_id to SiteConfig (#6483) [deploy]
* Add a mascot_user_id to SiteConfig

Also allow it to be updated from /internal/config pages.

Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>

* Add spec for updating mascot_user_id

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
2020-03-05 12:44:59 -08: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
039ac2e856
Remove Shipping Fields from Users (#6477) [deploy] 2020-03-05 13:41:09 -05:00
Mac Siri
b0a873316f
Fix missing thumbs down image (#6151) 2020-03-05 12:30:26 -05:00
rhymes
c8c5088fbd
API: Access unpublished listings only if you are the owner (#6458) [deploy]
* Access only unpublished listings if they belong to the user when authenticated

* Make sure we never send unpublished listings in the index

* Update API docs

* oops

* Remove unused preloading as this loads a single item
2020-03-05 11:28:31 +01: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
Ben Halpern
d2bd9e95ae
Add more tag weight/more random variant (#6451) [deploy] 2020-03-04 12:44:52 -05:00
Ben Halpern
1a95597ccd
Fix style issues on liquid tag embed page (#6445) [deploy] 2020-03-04 10:40:34 -05: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
Josh Puetz
6d7cbfff1f
Restore featured story on timeframe pages for logged out users (#6427) [deploy]
* Restore featured story on timeframe pages for logged out users

* Handle arrays and empty collections when finding featured article
2020-03-04 08:01:24 -06:00
Ben Halpern
883264c8ab
Do not render or link to empty rss feeds (#6429) [deploy]
* Do not render or link to empty rss feeds

* Fix tests up
2020-03-03 21:37:51 -05:00
Alex
832f59ff6d
Search ClassifiedListings frontend code (#6372) [deploy]
* Add /search/classified_listings route

* Add classified_listings search controller action

* Add spec for /search/classified_listings request

* Begin implementing frontend code

* Add debounce to classified_listings search

* before_action to format page & per_page as Integer

* Use new fetchSearch helper to fix codeclimate

* Refactor to reduce listingSearch function length

* Refactor into separate updateListings function

* Move updateListings function outside class

* Move page size to constant

* Add brackets to conditionals

* Add comment for tags param

* Add JS doc

* Move params logic/cleanup to search_controller

* Move listingIDs to const

* Rename remove_blank_params & move to before_action
2020-03-03 14:13:40 -08:00
Molly Struve
5389b34268
remove redundant search specs (#6421) 2020-03-03 12:53:06 -05:00
Ben Halpern
1dc1723709
Add field test gem to establish a/b testing (#6283) [deploy]
* Initial field test spec work

* Clean up specs

* Fix codeclimage

* Cleanups

* Update names

* Rename and remove need to pass logged in status

* Leadup to prod: two experiments

* Move test logic to controller and add tests

Co-authored-by: Josh Puetz <josh@grorichpuetz.com>
2020-03-03 10:21:29 -05:00
Michael Kohl
4e1ccf4a3a
Add .present? check (#6302) 2020-03-03 09:34:17 -05:00
Molly Struve
3703ba3111
Create Feed Content index for Articles and Podcast Episodes and User Index (#6418) [deploy] 2020-03-03 08:00:16 -05:00
Alex
26ed296475
Add published field to ClassifiedListing Search (#6412) [deploy]
* Add published field to ClassifiedListing

* Add back query_conditions conditional

* Don't allow searches for unpublished listings

* Fix comment typo...oops!
2020-03-02 13:56:07 -08: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
Anna Buianova
b36d2e72ff
Started moving sponsorships to /internal (#6355) [deploy]
* Started moving sponsorships to /internal

* Moving sponsorships to /internal

* Improved /internal/sponsorships

* Added destroying sponsorships to /internal

* Rename sponsorships creator in internal
2020-03-01 12:48:47 -05:00
Nick Taylor
f6e99dec8b
Nickytonline/homepage main feed component (#6164) [deploy]
* wip

* Removed reference to cached_tag_list as the feed enpoint only returns tag_list now.

* Removed reference to cached_properties.

* Updated <CommentsCount /> and <TagList /> to support additinal className

* wip

* wip

* Undid init scrolling for Algolia articles

* Converted homePageFeed.jsx to an ERB template to access Sprockets.

* Now the homePageFeed.jsx files is an ERB so it can load Sprockets assets.

* wip

* Removed accidental commit of debugger statement in ERB.

* Now different feed time frames are loaded based on the homepage feed tab clicked.

* Prevent default Algolia paging when on the homepage.

* Added a tiny comment about feed time frame.

* Now feed loads properly for each time frame on home page.

* prop name refactor.

* Reneabled default Algolia scrolling.

* On the homepage, we no longer overwrite article HTML with Algolia data for initial articles.

* Assumption is the proper URL for main_image of featured article will be sent in the feed.

* Fixed Google Analytics for featured article.

* No longer need the new-feed ID for checking if we're on the homepage.

* Trying to make codeclimate happy.

* wip

* Removed reference to cached_tag_list as the feed enpoint only returns tag_list now.

* Removed reference to cached_properties.

* Updated <CommentsCount /> and <TagList /> to support additinal className

* wip

* wip

* Undid init scrolling for Algolia articles

* Converted homePageFeed.jsx to an ERB template to access Sprockets.

* Now the homePageFeed.jsx files is an ERB so it can load Sprockets assets.

* wip

* Removed accidental commit of debugger statement in ERB.

* Now different feed time frames are loaded based on the homepage feed tab clicked.

* Prevent default Algolia paging when on the homepage.

* Added a tiny comment about feed time frame.

* Now feed loads properly for each time frame on home page.

* prop name refactor.

* Reneabled default Algolia scrolling.

* On the homepage, we no longer overwrite article HTML with Algolia data for initial articles.

* Assumption is the proper URL for main_image of featured article will be sent in the feed.

* Fixed Google Analytics for featured article.

* No longer need the new-feed ID for checking if we're on the homepage.

* Added postcst episodes to <Feed /> state.

* Breaking up Article.jsx to make codeclimate happy.

* wip

* Created the <TodaysPodcastEpisodes /> and <PodcastEpisode /> components.

* Fixed issues with some components that were updated for the <FeaturedArticle />

* Added tests for <FeaturedArticle />

* Barreled up <FeaturedArticle />

* Added Storybook stories for <FeaturedArticle />

* Featured articles don't display org, so removed that test.

* Added proper today's podcasts components to feed.

* Converted some leftover ERB + removed pro checkmark as it doesn't exist yet.

* Now logic is same as master for feed timeframe.

* Updated <FeaturedArticle /> snapshots.

* On frontpage, bookmark button state is managed by Preact components now.

* bookmarkedFeedItems is now a prop on <Feed />.

* Fixed logic check for initializing reading list icons.

* Now <Article /> and <FeaturedArticle /> receive a bookmarkClick prop.

* Removed beginnings of scroll handler in <Feed /> as we're using what's there already for now.

* Removed logic to not show main image on other time frame feeds as it was not correct.

* Fixed issue with 0 rendering when no podcast episodes in feed.

* Converted <SaveButton /> to a stateful component.

* wip - <Feed /> render prop now passes bookmarked feed item ID set and a click event.

* Moved FEED_ICONS to an export so it's easier to use JSX/JS in <Feed />

* Moved <Feed /> into article components.

* Now reading list save buttons work properly in Preact components.

* Fixed issue with Save buttons in Algolia paging/<Feed />

* Updated snapshots.

* Took <Feed /> out of articles barrel file as jest was trying to import FEED_ICONs which is an ERB template.

* Now the Preact feed is dynamically imported.

* Now the Preact <Feed /> only loads for a logged on user.

* Fixed <FeaturedArticle /> so that the save button behaves properly now.

* Updated article stories for Storybook.

* Putting this back to the order it was because I've removed my code changes for this block.

* Fixed when renderFeed is imported for a logged on user.

* Add podcasts to feed and render home from server

* Add padding to feature laoding div

* Update tests

* Add more loading articles

* Fix conflicts

* Add readinglist javascript to initscrolling

* Ensure first article is one with image

* Organize feed items outside of feed instead of in it

Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
Co-authored-by: Josh Puetz <josh@grorichpuetz.com>
2020-02-28 14:14:47 -05:00
Alex
00bced6179
Refactor search specs to use index_documents helper (#6365) [deploy] 2020-02-28 11:08:46 -08:00
Ridhwana
0f9c9d2738
Sanitisation of Ads (#6361) [deploy] 2020-02-28 13:20:34 -05:00
rhymes
2b31a9b9ee
Allow different casings to be specified for syntax highlighting (#6354) 2020-02-28 12:36:27 -05:00