Commit graph

445 commits

Author SHA1 Message Date
Ben Halpern
c7d7d55460
[WIP] Move both v1 and v2 editor to v2 preact-driven editor (#2797)
* Initial work on v2

* Initial changes merger

* Work to finalize v1/v2 editor adjustments

* Clean up styling

* Fiddle with form margins

* Fix some tests

* Change video

* skip a couple tests

* Modify tests to work with new code
2019-05-13 12:27:36 -04:00
Glenn Carremans
85e517a821 Fix SpotifyTag (#2791)
- Fix regex for playlist.
- Remove user embed.
- Fix embed height.
2019-05-10 16:18:55 -04:00
Kobe Raypole
509c7a3388 Move async article methods to ActiveJob (#2647) 2019-05-10 12:52:00 -04:00
cyrillefr
ecdbee64ab Move tag adjustment notification to Active Jobs (#2654) 2019-05-10 11:06:29 -04:00
Mario See
62578e4a59 Utilize ERB template in SpotifyTag (#2753) [ci skip] 2019-05-09 19:45:19 -04:00
Mario See
86d8128dd9 Utilize ERB template in CodepenTag (#2748) [ci skip] 2019-05-09 19:33:59 -04:00
Mario See
e0d4329089 Utilize ERB template in SoundcloudTag (#2752) [ci skip] 2019-05-09 16:17:03 -04:00
Mario See
84eb7ceb75 Utilize ERB template in Instagram liquid tag (#2749) [ci skip] 2019-05-09 13:20:22 -04:00
Mario See
20a50fb0f8 Utilize ERB template in Youtube/Vimeo liquid tag (#2728) [ci skip] 2019-05-09 12:44:00 -04:00
rhymes
e626002260 Add alternative texts to images (#2771) [ci skip] 2019-05-09 11:16:03 -04:00
rhymes
4e591fea1c Show localized date/time on hover for articles/comments (#2722)
* Add article decorator published_timestamp

* Use time HTML5 element and refactor date in partial

* Add published_timestamp to Article

Adding `published_timestamp` to the homepage we can then use JS to render the full timestamp localized for the user.

We've also added the timestamp to the index and the API

* Display article published timestamp on hover

* Use time also in the article show page

* Add timestamp to bottom articles as well

* Remove published_timestamp from index because it is not used

* Fix broken specs

* Add more article dates specs

* Refactor date initializers
2019-05-09 11:05:17 -04:00
rhymes
260fe901b8 Refactor Comments::BustCacheJob to use a service (#2655) 2019-05-09 10:10:37 -04:00
Andy Zhao
b1d8786436 Add specs for classified listings creation (#2769) [ci skip] 2019-05-08 15:01:33 -04:00
Mario See
767029bc10 JS Fiddle Liquid tag render to utilize ActionController (#2746) [ci skip] 2019-05-08 13:05:07 -04:00
Mario See
68239c4cf8 Change Runkit liquid tag to utilize ActionController (#2723) 2019-05-07 16:44:20 -04:00
Mario See
b1f97a0657 Change Twitter liquid tag to utilize ActionController (#2721) [ci skip] 2019-05-07 16:40:50 -04:00
Andy Zhao
97040ab603 Remove membership and stripe subscription routes (#2741) 2019-05-07 11:37:21 -04:00
Andy Zhao
d1e4831c4f Add tests for purchasing credits (#2720)
* Use workaround for tests

* Add tests for purchasing credits

* Use the correct current_user

* Wrap parentheses around second condition
2019-05-06 15:27:30 -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
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
Ben Halpern
15ea00328c
Award credits along with badge achievements (#2683) 2019-05-03 15:38:25 -04:00
Mario See
95cb63fe04 Refactor Dev's LinkTag (#2619) 2019-05-03 15:17:14 -04:00
Wes Delp
f08f5fcdbf Customize RSS feed by tag (#2634)
* add tag param and filter

* add tag filter request specs

* order user above tag to maintain existingdefault

* refactor #new for code climate

* add rss feed spec

* move feed tags under explicit route
2019-05-03 11:35:54 -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
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
Mario See
96a0235168 Change DevComment#render to utilize html.erb (#2554) [ci skip] 2019-05-02 12:05:55 -04:00
Westbrook Johnson
e843d9dc96 Add file argument to Stackblitz embed. (#2590) 2019-05-01 16:28:37 -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
Bolarinwa Balogun
44b06ea442 Allow embed single file from Gist tag (#2620) 2019-05-01 10:47:52 -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
Ben Halpern
4b91dd5912
Make a couple changes to Twitch MVP before push (#2622) 2019-04-29 18:53:09 -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
Bolarinwa Balogun
5b0340351b Fix non-english characters delete on tags (#2579) 2019-04-29 17:33:14 -04:00
Anna Buianova
2ea6accec1 Fix name resolving error on export (#2612)
* Fix name resolving error on export

* Fix exporter service spec
2019-04-29 15:37:50 -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
Mac Siri
d1b286a835 Fix inconsistent spec 2019-04-29 13:06:56 -04:00
Bolarinwa Balogun
e04d84bc4c Improve Gist Link Regex (#2592)
* Improve Gist Link Regex

While working with the gist liquid tag, I noticed that valid gist links
were resulting in errors. After looking at `gist_tag.rb`, I noticed
that for a link to be considered valid the gist-id had to be exactly 32
characters which is not always true.

I changed the regex so links with a gist-id of at least one character and
at most 32 characters is considered valid. I decided to continue with
the 32 characters that had previously been used as the upper bound. I
also made a change so links with a github username that starts or ends
with hypens or contains consecutive hypens are considered invalid. The
aforementioned change was based on the validation message from the
create new GitHub account form.

* Change gist_link to gist_links in spec file for Gist tag
2019-04-29 12:24:52 -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
rhymes
04d2bb4190 Remove last remnants of Flipflop (#2585) 2019-04-26 19:26:45 -04:00
Ben Halpern
bfedee0561
Fix some listing/credit bugs (#2584)
* Fix some listing/credit bugs

* Tack on codepen team link fix

* Fix test

* Actually fix test
2019-04-26 19:01:35 -04:00