Commit graph

547 commits

Author SHA1 Message Date
Ben Halpern
dcbb188cf1
Add pinned articles box to profiles (#3269)
* Initial pins work

* Add pin box to profiles

* Fix test snapshot spacing and optimize svg

* Fix listings spacing
2019-06-24 15:18:29 -04:00
rhymes
91de529705 Remove code for legacy mentoring feature (#3186) 2019-06-21 17:18:11 -04:00
Andy Zhao
1e61634499 Add backend functionality for muting users you follow (#3240)
* Add backend func. for muting users you follow

* Remove comment

* Add validations and update default value

* Send notifications to followers with all_articles
2019-06-20 11:28:50 -04:00
Ben Halpern
456931f208
Further generalize pages and site Twitter handle (#3177)
* Further generalize pages and site Twitter handle

* Add footer mod change

* Remove giveaways dead code
2019-06-16 00:59:11 -04:00
Ben Halpern
8ae057b06e
Beta polls feature (admin use only for now) (#3176)
* Initial poll features

* Add basic poll functionality

* Finish (maybe) beta poll functionality
2019-06-15 17:33:30 -04:00
Jess Lee
10674aed72 Buffer Listings (#2956)
* add share to buffer button

* wip

* wip

* adds listings to buffer via form

* create migration for buffered timestamp and update seed file

* display when listing was last buffered

* remove annoying spacing

* refactor article script for listings

* social preview wip

* add custom social card for indivdual listings

* add styling

* fix css

* tweak styling

* final css tweaks

* fix branch

* add buffer listings id

* update envfile

* add social previews spec
2019-06-14 19:33:19 -04:00
Andy Zhao
b953f17d0c New Feature: Subscribe to posts! (#3149)
* Add MVP of notification subscriptions

* Add rate limiting for notification subscriptions

* Show modal for logged out users on subscribe click

* Add enter key functionality for checkbox

* Add relationships for notification subscriptions

* Add model test for notification subscription

* Deprecated article mutes in favor of notification subscriptions

* Deprecated comment mutes in favor of notification subscriptions

* Move comment muting tests and logic over

* Merge comment and article muting into subscriptions

* Remove redundant check

* Use database to check for rate limit instead of cache

* Test for subscriptions handling notifications properly

* Fix notification model spec for subscriptions

* Fix tests for subscriptions

* Remove rate limiting

* Properly handle logged out users getting subscription status

* Fix test for new pattern

* Update reserved words

* Add config column to notification subscriptions

* Add logic for top level config and move tests

* Test for top level subscribers getting notified

* Fix logic mistake oops

* Add index and refactor comment_user_ids
2019-06-14 12:03:43 -04:00
Anna Buianova
8605f29b98 Added organization_id index to notifications (#3155) 2019-06-14 09:29:15 -04:00
Anna Buianova
2c05bbc0c1 Change notifications unique indexes #2525 (#3012)
* Notifications unique indexes that take null values into account

* Specify import options for reaction notifications according to the indexes

* Fix specs: notifications have either user_id or organization_id

* Create notifications indexes concurrently
2019-06-13 15:17:50 -04:00
Anna Buianova
f476e11be6 Podcasts validations (#3123)
* Podcasts validations

* Added db constraints for podcast_episodes

* Validate podcast slug uniqueness with usernames and org slugs

* Validate podcast slug uniqueness only if it was changed
2019-06-13 12:45:05 -04:00
Anna Buianova
b630fcad0d Removed fetching podcasts from a callback (#3098)
* Removed fetching podcasts from a callback

* Remove hacks that avoid fetching podcasts while seeding and running tests
2019-06-13 12:23:55 -04:00
rhymes
a8b7f6eea4 Analytics: refactoring for speed improvements (#3072)
* Use proper auth chain before checking parameters

* Refactor AnalyticsController

* Add a bunch of test and rewrite reactions counts with a single query

* Add tests for follows totals

* Use round and add more refactoring

* Add tests to group by day to fallback during refactoring

* Use group by to calculate comments count by day

* Use group by to calculate follows count by day

* Use group by to calculate reactions stats by day

* Use group by to calculate page_views stats by day

* Move calculations per day back in the cached block

* Add a few comments and a little bit of refactoring

* Add indexes (concurrently) for analytics

* Make tests more time robust

* Use a date range cache related to the requesting user or org

* Freezing time in UTC should help when tests are ran on time zones over the day line

* Remove explicit returns

* Page title is escaped, guard against that

* Move Analytics service spec in the proper place
2019-06-10 09:27:39 -04:00
rhymes
7d89a55d76 Disable Podcast episodes fetching during seeding (#3075)
After #3057, that converts from Delayed::Job to ActiveJob, podcast episodes are fetched inline during seeding, which makes the seeding process painfully slow and most of the times unsuccessful.

This PR disables the fetching during seeding. Episodes can be fetched with `rails get_podcast_episodes` task if needed for local testing.
2019-06-10 09:22:00 -04:00
Ben Halpern
b731df44ca
Add badges to key tags (#3074)
* Add badges to key tags

* Adjust vertical-align

* Fix YouTube tag mistake and refactor map to pluck
2019-06-07 19:09:43 -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
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
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
Dana Scheider
b2a8f69f83 Allow archiving of posts (#2798)
* This commit adds the "archived" attribute to the Article model, which will
enable users to automatically filter archived articles/drafts from appearing
on their dashboard. It also adds an ellipsis menu with a link to archive the
article. I've also moved the Mute Notifications button into the ellipsis menu
as well.

* Add ellipsis menu and make it work

* Fix logic error

* Hide ellipsis menus when you click elsewhere on the body

* Extract function to remove duplication

* Ensure that menu is hidden when the ellipsis button is clicked on an open menu

* Ensure that archiving post button works and that 'archived' param is accepted by the controller

* Enable link to toggle showing/hiding archived articles

* Make 'mute' and 'archive' buttons in ellipsis dropdown list work

* Refactor to make Code Climate happy

* Minor JS refactors
2019-05-13 15:40:52 -04:00
rhymes
2e55b9d82f Add a few listings to the seeds file (#2761) 2019-05-08 08:49:52 -04:00
rhymes
5b8befde52 Podcast main_color_hex is required (#2716)
The `rails db:reset` command failed because `main_color_hex` wasn't specified in the `seeds.rb`
2019-05-06 10:00:36 -04:00
Ben Halpern
41d3f7ef39
Add credits counter_culter to users and orgs (#2689) 2019-05-04 10:50:48 -04:00
Ben Halpern
5891b2ea58
Add application "page" model (#2657)
* Generate page model

* Add page model

* Conditionally modify html rendering
2019-05-02 18:24:06 -04:00
Ben Halpern
821d45104a
Create serialized cached user and cached organization for articles (#2658)
* Create cached user and cached organization for articles

* Remove pages table
2019-05-02 14:42:28 -04:00
Jess Lee
5e193fdcd7 Create listings permalink (#2637)
* create listings show route

* add link to listings

* include slug in json

* migrate test environment

* unlink listing title

* fix formatting

* remove slug data from json

* remove auto linting

* fix spacing

* add to algolia index?

* actually add index?

* fix merge conflicts?

* update query
2019-05-02 14:14:40 -04:00
rhymes
56e13d00f0 Upgrade Ruby to 2.6.3 (#2649) 2019-05-02 12:06:18 -04:00
Ben Halpern
f0663d83ca
Add nightmode image (#2640) 2019-05-01 15:14:18 -04:00
Anna Buianova
065ef29e31 Added unique index to notifications #2124 (#2213)
* Added unique index to notifications #2124

* Fix migration + add index to schema.rb

* Shoulda matcher notification unique validation
2019-05-01 13:15:06 -04:00
Justin Lavoie
804758ce34 Fix typo in seed log information (#2631) [ci skip] 2019-04-30 16:10:15 -04:00
Anna Buianova
b50c2d333d Add indexes to classified_listings (#2624) 2019-04-30 09:35:30 -04:00
Corey Alexander
ec388804df Embed Twitch Live Streaming (#2591)
* Get a job created that can create a webhook subscription for a twitch user login

* Remove ngork url

* Refactor add store the access token in the cache

* Get a controller stood up to recieve the webhooks. Now they just need to be processed

* Get User columns added and got webhook controller bones working

* Update the webhook job to use the User

* Add a way for the User to input their Twitch User Name. Plus a linter fix

* Delay webhook registration when profile is updated

* Don't add _ in username

* Use String columns

* Quick fix and add some more requests specs

* Specs for the webhook job

* Get a show page Twitch Live Streams. Just a straight embed of the Twitch Everything Embed UI. Works surprisingly well responsively, and works on all screen sizes

* Fix Gemfile.lock from merge issues

* Add support for expired tokens and add spec

* Add secrets to webhook registration and clean up spec to remove token logic

* Verify webhook secret and spec it

* Add rake task to enqueue webhook registration for all Users. This can be used from Heroku Scheduler

* Update the lease seconds to be for 5 days

* Actually lets do 7 so we can refresh twice a week and try to make sure that we can always miss one

* Hijack the existing Twitch logo instead of making a duplicate one

* Remove comment and replace with log line

* Remove some white space

* Log to Airbrake when webhook errors occur

* Move to passing in an id instead of User object

* Extract logic from Job to Service object

* Capitilize in the view

* Move out of models and into services

* Remove letover stub

* Remove one usage of Faraday

* Use HTTParty for all the HTTP here
2019-04-29 18:11:53 -04:00
Ben Halpern
a711e2246e
Add proper twitch url migration (#2561)
* Add proper twitch url migration

* Change schema version
2019-04-25 17:38:21 -04:00
Bolarinwa Balogun
1578befdf1 Add Twitch to Profile Links (#2557) 2019-04-25 16:14:28 -04:00
Ben Halpern
78138532c8
Classified Listings (#2545)
* Initial classified listings work

* More work on tags

* Additional work finalizing stripe and getting the listings page along

* Finalize-ish listings 🤞
2019-04-24 16:17:01 -04:00
rhymes
783c966c72 Add mailers specs for tracking (#2523)
* Add tracking and missing specs for DigestMailer

* Add tracking and missing specs for MembershipMailer

* Add tracking and missing specs for NotifyMailer

* Add tracking and missing specs for ScholarshipMailer
2019-04-23 12:38:11 -04:00
Andy Zhao
182a787ac4 Add OrganizationMembership model (#2471)
* Remove deprecated analytics role

* Make anchor tag a bit more readable

* Add OrganizationMembership table and model

* Add organization_membership associations

* Add unique indices for user_id and org_id

* Wrap update and create calls in transactions

* Remove specs of deprecated analytics_beta_tester
2019-04-22 14:08:02 -04:00
Ben Halpern
583a772d52
Add inbox guidelines to users (#2473) 2019-04-17 15:49:48 -04:00
Anna Buianova
25cafaae8c Add missing indexes to comments table (#2413) 2019-04-12 06:18:06 -04:00
Jess Lee
f637d9e02b Manage tag and community mod lists in Mailchimp (#2362)
* add moderation email list columns

* automate tag moderator mailing list

* reorder logic for tag mod list

* add community mod list

* remove trusted privileges when reverting a user to a regular member

* automatically make tag mods community mods

* fix merge conflicts

* add community view

* make methods less complex based on code climate sugggestion

* add specs

* refactor tag moderator module

* fix spec
2019-04-10 14:45:06 -04:00
Anna Buianova
f1d371c670 Set users email to nil instead of blank (#2305)
* Set users email to nil instead of blank

* Remove uniqueness validation duplication for users

* Fix organization following test in case the name contains quotes
2019-04-08 19:12:56 -04:00
Ben Halpern
1552df98d2
Add ability for trusted users to suggest social copy for posts (#2306)
* Add ability for trusted users to suggest social copy for posts

* Fix schema

* Fix tests

* Fix test
2019-04-04 17:01:58 -04:00
Mac Siri
7147428821 Update Rails version on README [ci skip] 2019-04-03 14:15:17 -04:00
rhymes
3a53d5797e Upgrade Rails to 5.2.3 (#1408) 2019-04-03 13:08:59 -04:00
Anna Buianova
1a0d4667c5 Unique twitter and github usernames #2061 (#2255)
* Set github and twitter usernames to nil if they are blank

* Verify github and twitter username in the Admin::UsersController (just in case)

* Add unique indexs on users twitter_username and github_username
2019-04-02 18:16:29 -04:00
Anna Buianova
d1db3abc35 Optimize sign in: User (#2237)
* Unique index on users email, conditional user unique validations

* Only uniqueness validations are conditional
2019-04-02 17:12:35 -04:00
Ben Halpern
490645ea92
Add sponsors to sponsors page and add sponsor order field (#2284)
* Add sponsorship page

* Fix schema

* dev => DEV
2019-04-01 18:24:47 -04:00
Ben Halpern
cc0e4b40dd
Allow orgs to be marked as sponsors (#2282)
* Allow orgs to be marked as sponsors

* Remove community sponsor condition
2019-04-01 16:41:25 -04:00
Anna Buianova
4b02fe87a4 Optimize sign in: Identity #2061 (#2231)
* Add unique index to identity

* Conditional uniqueness validations on identities

* Remove redundant Identity specs
2019-03-28 16:10:23 -04:00
Abraham Williams
9cb40e546b Enables Rails cops (#2186)
* Enable Rails cops

* Fix Rails/DynamicFindBy

* Fix Rails/HttpStatus

* Fix Rails/Blank

* Fix Rails/RequestReferer

* Fix Rails/ActiveRecordAliases

* Fix Rails/FindBy

* Fix Rails/Presence

* Fix Rails/Delegate

* Fix Rails/Validation

* Fix Rails/PluralizationGrammar

* Fix Rails/Present

* Fix Rails/Output

* Fix Rails/Blank

* Fix Rails/FilePath

* Fix Rails/InverseOf

* Fix Rails/LexicallyScopedActionFilter

* Add Rails/OutputSafety to TODO

* Add Rails/HasManyOrHasOneDependent to TODO

* Add Rails/SkipsModelValidations to TODO
2019-03-25 09:25:55 -04:00
Abraham Williams
953c555c36 Switch fix-db-schema-conflicts to published version (#2161) [ci skip] 2019-03-21 14:52:49 -04:00
rhymes
116d6b3278 Replace puts with proper logging (#2139) 2019-03-21 13:00:21 -04:00