Commit graph

350 commits

Author SHA1 Message Date
Andy Zhao
bb75ee3fc6 WIP Add proper error handling when creating a listing (#2755)
* Add proper error handling when creating a listing

* Remove accidentally committed stylesheet

* Make error text

* Preserve input values if the submission is invalid
2019-05-07 18:25:25 -04:00
Andy Zhao
b33b59ec96 Remove listings' body_markdown's line-breaks (#2742) 2019-05-07 14:54:49 -04:00
Andy Zhao
bcdf8d980f Minor adjustments to listings (#2731)
* Add periods for consistency

* Update category cost with potential correction

* Update product cost with potential correction

* Display correct text dependent on purchaser

* Use name instead of org username
2019-05-07 07:03:06 -04:00
Ben Halpern
35fe810b51
Add default tags for listings dropdown and misc other changes (#2719) 2019-05-06 14:52:52 -04:00
Ben Halpern
4bf75a50a0
Remove unnecessary line in reaction algolia (#2717) 2019-05-06 10:39:32 -04:00
Ben Halpern
1ddef633cc
Improve reading list (#2695)
* Initial readinglist adjustments

* Improve readinglist

* Finalize new reading list

* Fix indexing and final finalizations

* Fix tests

* fix tests
2019-05-05 19:19:30 -04:00
Corey Alexander
23ded947e3 Twitch Webhook Fixes (#2692)
* Twitch Webhook Registration Fix

This fixes the broken twitch webhook registration. I previously added
the `to_json` when I was switching to using HTTParty and working through
WebMock. I apparently forgot to test this manually however after and
relied on the specs that had some baked in bad assumptions.

This removes the `to_json` and configures the mocking properly in the
spec setup.

I tested locally that this can now succesfully register for webhooks
with Twitch!

* Fix Webhook verification digesting as well, hardcode the specs for durability

* Refactor to use shorter digest method

* Add cache buster lines from Bens branch
2019-05-05 11:52:43 -04:00
Ben Halpern
fa3f4dcd0f
Fix buffer text not updating (#2699) 2019-05-05 11:51:30 -04:00
Ben Halpern
c76abbbdb3
Allow users to follow podcasts (#2690)
* Allow users to follow podcasts

* Only display podcasts user follows

* Add main_color_hex to factory

* Fix podcast test and modify styles

* Fix tests

* Remove weird test
2019-05-04 15:30:40 -04:00
Ben Halpern
41d3f7ef39
Add credits counter_culter to users and orgs (#2689) 2019-05-04 10:50:48 -04:00
Jess Lee
393acc3ab3 Manage org credits in internal (#2686)
* manage org credits in internal

* reduce cognitive complexity in a method
2019-05-04 10:47:13 -04:00
Jess Lee
a6d92c702b Add report abuse link to listings (#2684)
* add report abuse link

* add listings category on abuse form

* include listings category
2019-05-04 09:06:42 -04:00
Ben Halpern
15ea00328c
Award credits along with badge achievements (#2683) 2019-05-03 15:38:25 -04:00
Jess Lee
ae228cfe1f add method to award and remove credits (#2681) 2019-05-03 13:56:39 -04:00
Jess Lee
4013cf45de update category details (#2680) 2019-05-03 13:54:32 -04:00
Jess Lee
31a02d5c3b Update categories/credits (#2677)
* update categories and credit costs

* fix typo
2019-05-03 12:10:27 -04:00
Andy Zhao
07796e769a Move new listing form to Preact (#2674)
* Fix typo

* Use preact for new listing form

* Send proper max tag amount in error msg

* Add styles back in for edit page
2019-05-03 10:17:12 -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
5e64ae874e
Remove includes user from stories query to reduce num queries and memory (#2662)
* Add profile_image_90 to serialized data on article

* Remove includes user from stories query
2019-05-02 15:58:58 -04:00
Ben Halpern
f12f00decd
Add profile_image_90 to serialized data on article (#2661) 2019-05-02 15:47:22 -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
Ben Halpern
f0663d83ca
Add nightmode image (#2640) 2019-05-01 15:14:18 -04:00
Kobe Raypole
0b93507da6 Extract comment's async methods to jobs (#2596) 2019-05-01 13:59:50 -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
Jess Lee
011e734ee0 Allow admins to remove credits from internal/users (#2635) 2019-05-01 12:49:42 -04:00
Mike Coutermarsh
4c9959f0ff Social Cards Part 2 (#2188)
* Social Cards Part 2

This is a follow up to part 1: https://github.com/thepracticaldev/dev.to/pull/2090.

This PR updates the og:image URLs to use the new social_preview.png urls
added in Part 1.

So that the already generated/cached images do not need to be recreated,
this sets a MIGRATION_DATETIME. Any object that has been updated after
that date will generate a new image

Objects from before that date will not. They will use the new url.

* Fix weird change made by rubocop autocorrect

* Handle organizations + users

* Run CI

* Use time with zone to be explicit about timezone

* Simplify branching in user_social_image_url method

* Fix param alignment + bump migration date
2019-05-01 11:07:25 -04:00
Ben Halpern
158f56bc9d
Add page for users to "manage" their posts after publication (distribution, etc.) (#2627)
* Set up basic /manage route

* Add basic article manage page

* Add tips and finalize permissions for /manage

* Add final test and add manage button to article show

* Update failing specs
2019-05-01 09:00:09 -04:00
Anna Buianova
dd11478659 Change format of the user languages_settings #2369 (#2496)
* Change format of user preferred languages

* Make sure user language settings are set by default

* Add missing expect to the user spec

* Fix users/misc template

* Move existing languages to a constant

* Remove commented user code

* Move languages out of User model

* Update preferred languages accordingly to the available languages

* Set user estimated language only if the language is available

* Fix Portuguese spelling #2582
2019-04-30 17:01:19 -04:00
Anna Buianova
d2d405ad37 Add validation to classified_listings user and organization (#2625) 2019-04-30 09:35:08 -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
rhymes
af83bab2d0 Escape range separator (#2593)
The char "-" in regexp defaults a a separator for a range of character, for example: "a-z", Ruby is smart enough to understand "-_" is no range but it does emit a warning, by properly escaping the char "-" we ensure that no warning or issues can arise in the future.
2019-04-29 14:27:26 -04:00
rhymes
743316b528 Move send new badge achievement notification to ActiveJob (#2474) 2019-04-29 10:51:08 -04:00
Ben Halpern
076047e13b
Add proper filtering for inappropriate tags in listings (#2611) 2019-04-29 09:21:42 -04:00
cyrillefr
c3cb6d9b66 Move moderation notification to Active Jobs (#2550)
- send_moderation_notification in own job
    - that calls a service
    - specs for job + service
    - minor refactoring
2019-04-29 09:21:15 -04:00
Ben Halpern
398aa71ec3
Adjust cache settings and some styling (#2588) 2019-04-27 10:36:37 -04:00
Jess Lee
0383873070 Add credit form to internal/users (#2581)
* add credit form to internal users

* add missing file whoooops
2019-04-26 12:48:00 -04:00
Bolarinwa Balogun
1578befdf1 Add Twitch to Profile Links (#2557) 2019-04-25 16:14:28 -04:00
Anna Buianova
46b1b1d28a Fix lints (#2553) [ci skip] 2019-04-25 07:56:15 -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
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
cyrillefr
f3f8a51e35 Move Welcome Notification to Active Jobs (#2485)
- creation of welcome notification is in own service
  - which is called by an active job

Resolves: #1996
2019-04-22 13:49:18 -04:00
Andy Zhao
4e8787f606 Convert underscores in article slugs properly (#2472) 2019-04-17 12:35:37 -04:00
Ben Halpern
61182b0a69
Allow seo_boostable to better handle nil (#2458) 2019-04-15 13:12:19 -04:00
Ben Halpern
e389757aa4
Modify sidebar seo-boostable cache (#2455)
* Modify sidebar seo-boostable cache

* Modify score needed
2019-04-15 12:20:44 -04:00
Ben Halpern
78f8eb6dbe
Fix seo_boostable for latest (#2451) 2019-04-15 10:48:53 -04:00
Ben Halpern
4b1b137c0f
Fix/augment dashboard and article view count issues (#2449) 2019-04-15 10:24:38 -04:00
Andrew Brown
1168b926c7 be able to sort dashboard articles (#1837) (#2337)
* be able to sort dashboard articles (#1837)

* remember to escape order clause is arel (#1837)

* add back in missing character for created_at (#1837)

* use case statement to avoid threat of injection (#1837)

* write specs to ensure sorting works for dashboard articles (#1837)

* add publish sort options, refactor sort options into articles helper (#1837)

* refactor to use model scope (#1837)
2019-04-15 08:30:09 -04:00
Anna Buianova
d27874adc9 Move estimating user default language to ActiveJob (#2373)
* Move estimating user language logic to a service object

* Call a service from a User#estimate_default_language!

* ActiveJob for estimating default user language

* Call ActiveJob from the User#estimate_default_language

* Handle nil user email when estimating default language

* Switch user.estimate_default_language_without_delay! to estimate_default_language! in specs
2019-04-13 15:54:22 -04:00
Ali Spittel
409c280c10 pinkify DEV (#2425) 2019-04-13 11:25:02 -04:00