Commit graph

1567 commits

Author SHA1 Message Date
Andy Zhao
a55bce99ac Cache bust banished users' posts after the posts are deleted (#3044)
* Bust article caches after they've been deleted

* Use less instances of cachebuster class
2019-06-04 15:04:30 -04:00
Anna Buianova
f6bb00a26a Add specs for the PodcastFeed #2952 (#3039) [ci skip] 2019-06-04 14:50:25 -04:00
briwa
7c254dc8bf Remove an extra @ in Connect (#3040) [ci skip] 2019-06-04 14:43:37 -04:00
Ben Halpern
119d0f69d6
Finalize multi-org features (#3041)
* Finalize multi-org features

* Fix credits count issues

* Only show org list if multiple orgs on dashboard

* Add check for organizations to JS
2019-06-04 13:56:22 -04:00
Andy Zhao
47d9ec27fb Allow users to belong to multiple orgs (#2583)
* Allow user to have many orgs

* Allow users to handle multi orgs in settings

* Make rounded buttons inline

* Add multi org function to dashboards

* Fix merge conflicts

* Fix mistake in merge conflict fix oops

* Display the correct membership level

* Fix accessibility issues

* Display organizations for article editors

* Handle submitting org id with preact editors

* Make listings work with multiple organizations

* Allow listings to have multiple orgs on create

* Display the correct number of credits for each org

* Move script tag to Webpack

* Allow multi orgs for purchasing and viewing credits

* Use OrganizationMembership as authorization check

* Display multiple organizations for notifications

* Allow dashboard to be viewable under multi-orgs

* Remove unused method

* Add multi-org functionality for article editors

* Show pro dashboard buttons for member+ org levels

* Leave the correct organization

* Allow article API to change org id

* Add left-out authorization method oops

* Make nav buttons a bit more clear

* Fix merge conflict

* Fix adding org id for /api/articles and tests

* Fix tests for org policy

* Use proper logic for displaying org members

* Update org actions with new authorization

* Use correct org when creating a listing

* Remove additional payment charge oops

* Mark org notifications as read with authorization

* Remove deprecated post_as_organization attribute

* Use new org_admin syntax

* Remove deprecated org logic for article create and update

* Default all RSS posts to not belong to any org

* Render org_member page for guest users

* Update org policy spec to work with multi orgs

* Use org_membership for org traits and move identity code

* Use org_member trait

* Update to work with multi-orgs

* Validate article's org_id if param org_id is blank

* Make  a let variable

* Remove unnecessary eager load for credits

* Fix HTML structure and org logic for non-org users

* Update credits spec for multi-org

* Add test for failed payment when purchased by org

* Lint listings_spec

* Test that the listing was created under the user

* Add tests for POST /listings multi-org

* Use double quotes for classes

* Fix /manage and a few other multi-org bugs

* Fix test for multi org

* Use correct method SQL exists? not Rails exist?

* Fix reads spec for multi-org

* Fix org_controller actions to work with multi org

* Test only multi org and not old usage and fix leave_org

* Fix org showing user profile img test for multi-org

* Fix org logic for users with no orgs

* Remove switch org functionality

* Update tests and add hidden param for org id

* Redirect to the specific organization

* Test other org button actions

* Use settings_notice instead of legacy notice and refactor

* Fix weird extra end issue prob from merge conflicts

* Test for with new flash key

* Fix user_views_org tests for multi-org

* Test for new flash message

* Update snapshot with new a11y html

* Move styling to stylesheet

* Add site admins functionality

* Move org_member? method in user model and refactor

* Use unspent_credits_count for organizations

* Add tests for /listings/new and minor bug fixes

* Use .present? in case of empty array

* Fix a lingering deprecated method

* Use greater than 1 for random numbers

* Add tests for counting spent and unspent credits
2019-06-04 09:30:52 -04:00
Mario See
6bbdb73019 adjust spacing and hide scrollbar (#3027) 2019-06-03 15:00:22 -04:00
Charles Stover
f8e31f6865 https URLs by default (#3019)
This was so upsetting I fixed it on mobile.
2019-06-01 10:16:23 -04:00
Alireza Zekavat Fetrat
4d3203be82 Fixes inappropriate comment header background bug #3020 (#3021) 2019-06-01 10:01:22 -04:00
Ben Halpern
10151f9f4c
Fix close modal click action (#3018) 2019-06-01 10:00:42 -04:00
Mario See
8359ab555f Add reading time to reading list (#2929)
* init

- add reading_time to reactions
- make migration
- add to algolia index in reaction model
- add method in reaction model to define reading time based on reactable reading time

* add time to front end

* Revert "Return errors instead of raising an exception on ArticleCreation (#2922)"

This reverts commit 09a99d93a3.

* Revert "init"

This reverts commit 53650ebcc3c93c54e396977f7c34f7aa35a589c4.

* Revert "Revert "Return errors instead of raising an exception on ArticleCreation (#2922)""

This reverts commit e8cf1f3a290dd06b937247e3ff7593e7c7036553.

* Update reaction.rb

* remove duplicate searchableAttribute
2019-05-31 16:45:29 -04:00
Ben Halpern
1775f42cc4
Finalize DEV Connect for listings (#3016) 2019-05-31 15:22:59 -04:00
Mario See
19b46a86e2 Add messaging option in listings (#2854)
* add prop for message modal method

* clean up comments from open inbox method

* add inbox type to listing model author

* add sample methods for opening message modal in listings and listing modal

* only show for users with open inbox and hide for self

* use contact_via_connect instead of inbox_type

* fix edit listing to include contact via connect attribute

* wip send message method

* adjust message styling

* change id name

* update destination

* remove unused methods
2019-05-31 13:48:45 -04:00
rhymes
36ad407c1d Fix zen mode's global key bug (#2969) 2019-05-31 13:33:29 -04:00
briwa
b301bf8def fix(article): scroll to top when inserting image (#2998) 2019-05-31 10:29:42 -04:00
Mohammadjavad Raadi
2e8eda4974 Fixes Listing Items Spacing Inconsistency and Content Overflow Issue #2846 (#3011) 2019-05-31 09:02:32 -04:00
briwa
b35fc23a82 refactor(svgs): remove empty group tags (#3002)
* refactor(svgs): remove empty group tags

* fix(spec): update liquid tag twitter spec
2019-05-31 08:54:31 -04:00
Anna Buianova
a7332846df Validate on creating a reaction notification (#3010) 2019-05-31 07:30:17 -04:00
Curtis Maloney
8d50956f1a Optimise images (#2966) 2019-05-30 17:37:10 -04:00
Ali Spittel
5dd0341a0c refactor v2 editor guide (#3007) 2019-05-30 17:35:19 -04:00
Jess Lee
c3e2a0c5f1 Add missing instance var for /manage & Bust rails cache on comments (#3004) 2019-05-30 12:23:20 -04:00
cyrillefr
8c52d5c43f Move remove_each notifications method in own job (#2946) 2019-05-29 16:26:18 -04:00
rhymes
a99c072525 Guard bust_comment against nil commentable (#2991) 2019-05-29 14:03:20 -04:00
Anna Buianova
c510f1510c Fix a validation error when creating notifications #2525 (#2999)
* Use activerecord-import upsert to deal with the race condition

* Return a more consistent result form Notifications::Reactions::Send
2019-05-29 11:19:37 -04:00
briwa
4f31c6d07a fix(reading-list): even spacing for Save and Bookmark span (#3000) 2019-05-29 11:19:01 -04:00
rhymes
38aa45c8e3 Cleanup bodyPreview component (#2980) [ci skip] 2019-05-28 23:55:37 -04:00
rhymes
6a626e819d Refactor: fix issues raised by bullet (#2965)
* Preload organization, not user

* Preload users only when needed

* Pre-load podcasts for podcast episodes in API

* Avoid eager loading error by loading rating votes separately

* Preload associations for moderation

* Preload user comments in trees

* Preload organization for non org dashboard and cleanup queries

* Optimize ArticleSuggester to only load N articles at need

* Remove eager loading and pass variables to partials for easier debug

* Reorganize tags validation code and ignore actsastaggableon eager loading issues

* Remove unused eager loading and bring up comments relation

* Preload podcasts when loading podcast episodes

* Fix views specs

* Make sure ArticleSuggester never returns duplicates

* Remove commented code

* Re-trigger build

* Move suggested articles back to view to respect fragment caching
2019-05-28 17:32:53 -04:00
Ben Halpern
d2f296114a
Modify cache key for article sidebar cta (#2993) 2019-05-28 17:18:31 -04:00
Vince Blom
bfc961b3f3 Codepen Links with Underscore Usernames (#2985)
- updates codepen liquid tag regex to allow underscores
- adds test to ensure an underscore in the username field of the link
  is considered valid
2019-05-28 16:32:34 -04:00
Ben Halpern
e1d537c016
Fix css missing (#2992) 2019-05-28 15:24:56 -04:00
Kartikey Tanna
b16fa4f8cc Implemented ActiveJob for badge_achievements#send_email_notification (#2962)
* Implemented ActiveJob for badge_achievements#send_email_notification

* Sending email only if record not nil

As per the review
2019-05-27 09:44:38 -04:00
Mac Siri
6d1638ed68 Unskip all skipped specs (#2941)
* Change all login_as to sign_in

* Unskip comment spec

* Create new specs

* Turn on Webdriver caching

* Set logger for Omniauth in test

* Update editor system spec

* Fix editor approval file

* Update video_controller

* Update TagAdjustmentUpdateService's spec

* Update users api spec

* Update stories_index_spec

* Remove redundant spec file

* Remove residual code

* Change ClassifiedListing spec

* Update NotificationsIndex spec
2019-05-25 11:04:38 -04:00
Thomas Ghysels
732d0e4450 Use consistent colors for inline code, including night theme (#2947) 2019-05-24 12:53:20 -04:00
Ben Halpern
37fabd08b1
Fix some connect bugs with wrong url and remove some dead code (#2953) 2019-05-24 12:19:59 -04:00
Anna Buianova
d3f9050be7 Move updating twitch username to a separate action #2784 (#2866)
* Move updating twitch username to a separate action #2784

* Fix the submit button on the integrations page

* Modify test according to the redirect
2019-05-24 11:13:33 -04:00
Clara
48b9d16e6e Bug/markdown underscores in usernames (#2948)
* Add method into MardownFixer and call in Comment

* Add test

* Escape all underscores in usernames and adapt tests

* Rework regex [WIP]

* Add new idea

* Clean up method and add correct tests
2019-05-24 08:34:14 -04:00
Anna Buianova
a6091fe6c8 Moved notifying followers to a separate ActiveJob #1996 (#2935)
* Moved notifying followers to a service + specs

* Created an ActiveJob for notifiable action notifications

* Call the job from the Notification#send_to_followers

* Refactor creating notifiable action notification

* Handle possible nil followers while sending notifiable action notification

* Use activerecord import to bulk-create notifications

* Set notified_at for the bulk-created notifications

* Move compact to the appropriate place
2019-05-24 07:45:51 -04:00
Jess Lee
8765de85b4 Sort internal/listings by recently bumped listings (#2938) 2019-05-22 15:28:03 -04:00
Mohammadjavad Raadi
1a960cfb44 Fix TwitterTag's video control bug (#2869) 2019-05-22 13:32:37 -04:00
rhymes
3a45bfcc2d API docs: Adjust document and add syntax highlight [skip ci] (#2936)
* Adjust document and add syntax highlight

* Add alt text to images
2019-05-22 12:24:52 -04:00
Jess Lee
65e3cf605c Internal Listings View Enhancement (#2931)
* wip

* add username to listings list view

* add pagination

* small style adjustment on edit page

* add has_many relationship to users and orgs

* add search by username or listing title
2019-05-21 18:28:18 -04:00
Jess Lee
1678489a2b Internal Updates - Bust Cache for Listings and Add Note for Credits (#2908)
* handle cache busting

* add required note when removing or adding credits

* only reindex if listing is published
2019-05-21 17:25:37 -04:00
rhymes
9e14ef2afd Add a proper exception in case of XSS attempt (#2927)
Fixes the generic error message with a proper one
2019-05-21 17:20:39 -04:00
Ben Halpern
e3400a2dc2
Make home page listings minimizeable (#2928) 2019-05-21 17:17:28 -04:00
Ben Halpern
07597d307c
Fix bug to allow users to remove org from article (#2930) 2019-05-21 17:16:16 -04:00
Jess Lee
27bd5ed4e2 add guard to granting credits and add spec (#2926) 2019-05-21 17:14:51 -04:00
Faraz Patankar
e33c376789 use flexbox to align content in onboarding modal (#2910) 2019-05-21 15:41:13 -04:00
rhymes
09a99d93a3 Return errors instead of raising an exception on ArticleCreation (#2922) 2019-05-21 15:18:02 -04:00
rhymes
d517050973 Do not ask to unpublish a draft article (#2920) [ci skip] 2019-05-21 15:17:12 -04:00
rhymes
c2a3d46850 Remove trailing dot from API token message [ci skip] (#2918) 2019-05-21 15:09:27 -04:00
Jess Lee
21f595ea2c Update Slack Notifications (#2870) [ci skip] 2019-05-21 15:06:04 -04:00