Commit graph

253 commits

Author SHA1 Message Date
ludwiczakpawel
975ddc61c4
Home Feed Tabs - Crayonsified (#7976)
* flare tag line height

* .

* new tabs on home

* instantclick

* Some JS cleanup for mobile view select event handler.

* eslint cleanup

* select arrow color

* quotes

* quotes

* .

* .

* omg

* .

* finally

* focus visible

Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
2020-05-27 14:48:18 +02:00
Andy Zhao
c42fd3461e
[deploy] Rename positive_reactions_count to public_reactions_count in logic (#7926)
* Rename positive_reactions_count to public_reactions_count

* Add positive reactions count back in so we can remove it

* Use public_category method for reactions

* Add positive_reactions_count in case any old caches rely on it

* Add positive_rxn_count to account for API endpoints

* Remove unused method

* One more spot...

* Add method back in because of caches

* Update specs to match new functionality

* Fix typo

* Remove unused methods
2020-05-26 12:36:28 -04:00
Ben Halpern
cde008c0a9
Add current state to nav bar links properly (#8045) 2020-05-25 12:00:21 -04:00
benhalpern
cca7729198 Add page view tracking to comment permalinks 2020-05-23 14:08:28 -04:00
Molly Struve
1c461f8891
[deploy] Remove Unused Pro Memberships (#7894) 2020-05-20 11:54:30 -05:00
Dmitry Maksyoma
f63c7f9289
Fix Runkit tags not being activated when comment is added (#6767)
* Fix Runkit tags not being activated when comment is added

* Runkit tag activation was ran once, on page load. I've changed it to
  run on on comment preview and submit.
* It was necessary to add a check to skip already activated Runkit
  tags. The code didn't take into account that a tag could be already
  processed, and would just crash.

* Fix Runkit tags and add tests

* Add test for previewing article with Runkit tag

* "Fix CodeClimate not finding waitForRunkitAndActivateTags()

* Refactor a test for readability

* Make Rubocop happy

* Improve test for previewing article with Runkit tag

* Use one method for determining active Runkit tags

* Defer loading of JS from embed.runkit.com

* Add utility function dynamicallyLoadScript(url)

* Switch to dynamic loading of Runkit

* parsed content code block is also hidden now to avoid displaying <code /> block before runkit iframe loads.

* Fix Runkit test

* Remove Runkit script caching in v2 form

* Use <%== instead of .html_safe in v2 form

* Update app/assets/javascripts/utilities/dynamicallyLoadScript.js

Co-authored-by: Nick Taylor <nick@iamdeveloper.com>

Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
2020-05-15 14:27:46 +02:00
ludwiczakpawel
e17cbd3efb
NOT MERGE Add tabs to Crayons and to the notifications page (#7737)
* tabs

* frontned

* notifications tabs

* ntofiications

* .

* doc

* names instead of slugs

* flare tag line height

* .

* js
2020-05-14 11:38:57 +02:00
Josh Puetz
2abe830377
[deploy] Home Page Feed redesign + top comments (#7579)
* feed cards

* frontend

* preactify

* preactify

* .

* fix

* fixing things and adding dropdown

* whoops.

* whoops 2.

* revert body bg color change

* search snippet

* search snippet

* get rid of featured article

* get rid of featured article...

* cover to its own component

* videos

* videos

* reading time

* small-save-filled asset

* author adjustments

* adjustments

* Author --> Meta

* whoops.

* loader

* logged out state

* .

* dropping what's not needed for now

* better name for cover

* get rid of nav overflow

* bringin comments placeholder back

* bringing comments placeholder back

* publish date

* fix

* date

* .

* save button icon

* ghost button

* lets skip the icon for saving for now

* more buttons

* counting logic

* Display top comments on homepage feed

* Comment list and item components

* Remove 'Top Comments' title

* Remove subscribe button, add reading time

* Update snapshots and tests

* Fix article and follower scrolling

* Added reading time

* (Try) to do flare tags

* Button component from Pawel

* More button styles from Pawel

* Comment count style from Pawel

* Handle empty parens for age on older articles

* Dont show 'more comment' button for more than 2 comments

* cover ratio

* flare tag

* cover fix

* fix buttons

* more button fixes

* tags fix

* responsiveness fix

* reading time  + a bit of responsiveness

* Reading time in more places

* snapshots

* default color for flare tag

* Update CommentsList test snapshot with new styles

* fixing search results

* fixing buttons

* Fix podcast card tests by updating snapshots

* Line clamping for top comments

* Reflect save button state after click before mouseout

* Now the entire feed card is clickable. (#7638)

* Now pointer cursor is only on feed posts. (#7727)

* Revert podcast card styling

* Update test snapshot

* merge

* Fix rspec on feed page

* Reduce complexity of class check for feed card clicking

* PR feedback/fixes

* Fix featured article test and snapshot

* Last minute test tweaks

* clean up crayons

* padding issue + empty div

* Correct merge error

* Fix search results tests

* Test fixes and snapshot updates

* themes

* podcasts colors

Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
2020-05-12 07:57:57 -05:00
Mac Siri
3cdac45deb
Create notification page spec (#7702) 2020-05-11 12:15:07 -04:00
Molly Struve
ea1d38d3b8
[deploy] Bulk Fetch Follow Button Data for Users (#7676) 2020-05-08 13:58:58 -05:00
Mac Siri
82ab9f820b
[deploy] Move first-nav-link from dynamic JS to erb (#7698) 2020-05-07 10:23:30 -04:00
Fernando Valverde
8f567524f7
Adds an extra check for Android Native app for playing podcasts (#7651) 2020-05-01 15:04:26 -04:00
Fernando Valverde
96c27ecdc6
[deploy] Android native audio feature support (#7554)
* First commit Android Bridge for Podcasts

* Working Android Bridge controls

* Adds Android metadata message & cleans up a couple longs functions

* Brings back use strict

* Cleans up a bit the conditional for either ios/android native players
2020-05-01 13:09:05 -04:00
Lisa Sy
9de59c4107
Update sidebar filter menu on Notifications (#7394) 2020-04-27 12:17:20 -04:00
rhymes
d87c3dbb18
[deploy] Improve comment posting error handling (#7519)
* Improve comment posting error handling

* Incorporate PR suggestions
2020-04-27 16:54:59 +02:00
Molly Struve
4ab202ab0a
[deploy] Execute Reading List searches in Elasticsearch (#7440)
* Execute Reading List searches in Elasticsearch

* add additional readinglist front tests
2020-04-24 10:30:17 -04:00
Mac Siri
a181a3af3a
[deploy] Remove Onboarding's ClosingSlide (#7443) 2020-04-22 14:08:10 -04:00
Mac Siri
4edf1c5ada
[deploy] Create onboarding task card (#7369) 2020-04-22 11:46:49 -04:00
Fernando Valverde
5dc0ebbb04
Copy to clipboard fixes including support for Android Native Bridge (#7382)
* Adds Clipboard Async API & makes use of Android Native Bridge interface for write post image copy to clipboard

* Checks for clipboard api support before trying to use it

* Adds support for comment dropdown copy link

* Adds AndroidBridge to globals definition
2020-04-21 10:36:49 -04:00
Ridhwana
a2f1a0049f
Removal of morrrre hardcoded dev.to links (#7390)
* feat: remove 90% of hardcoded dev.to links now

* chore: update tests

* chore: implement suggested changes

* chore: update url

* chore: update to use URL helper
2020-04-21 11:50:18 +02:00
Ridhwana
6dbc838bae
[deploy] Update our mailers to be generalized (#7359)
* feat: make the from in the email to be dynamic

* feat: hardcoded mailer dev.to

* feat: oops hardcoded email addresses in the terms

* chore: remove some whitespace

* update editor guide

* feat: new reply email

* feat: new message mailer

* feat: new follower email

* feat: capitalize the button

* feat: rename the link

* feat: capitalize the button

* feat: generalize the urls

* feat: generalise the url

* feat: dynamic DEV

* feat: update the specs

* feat: DEV digest generalisation part 1

* fix: the method is accessed by tag_url and so the default parameter needs to be set at this level and not at self.tag

* fix: use the tag model instance instead of passing through just the tag name (so that we can use tag_url)

* chore: make code climate happy

* chore: more robocop

* feat: add a default url back for self.tag

* test: fix the feedback helper spec

* fix: spec to be general

* fix: oops :(

* refactor: user_settings_path

* chore: use code_of_conduct_path

* chore: robocop

* chore: use connect path

* chore; use the notifications symbol

* chore: misc path

* feat: simplify url

* feat/fix: change the order of the helpers and use user_url

* chore: user_url

* capitalise

* chore: update article path
2020-04-17 15:35:35 -04:00
Fernando Valverde
f2ee0378f9
[deploy] Decorator podcast episode metadata (#7303)
* Moves podcast episode metadata to decorator

* Updates the podcast episode metadata to use image_url

* Syntax tweaks, initializeMedia() fix for initialized audio & brought back use strict
2020-04-17 12:52:11 -06:00
Molly Struve
8340051649
[deploy] properly parse params for feed content searching (#7367) 2020-04-17 12:23:24 -05:00
Molly Struve
2c99424205
[deploy] Execute Feed Searches through Elasticsearch (Round 2) (#7231) 2020-04-17 08:38:07 -05:00
Ben Halpern
2d978696c4
[deploy] Small connect js fixes (#7350) 2020-04-16 20:06:32 -04:00
Andy Zhao
f5ec83653c
[deploy] Finalize and add response templates feature (#7068) 2020-04-16 15:53:29 -04:00
ludwiczakpawel
d646b5e3f3
New sidebar navigation (#7212)
* new sidebar nav

* whoops

* update on reading list badge

* color

* titles + order

* themes

* remove unused images

* tests & fix

* Fix spec

* Fix specs

* sponsors update

Co-authored-by: rhymes <rhymesete@gmail.com>
2020-04-15 18:16:33 +02:00
Ben Halpern
b0a95cdcd7
[deploy] Small design and functionality touches to /connect (#7234)
* Small design and functionality touches to /connect

* Small fixes

* Fix test

* Fix test
2020-04-11 10:56:52 -04:00
Nick Taylor
60d2febc54
Upgraded to eslint 6 and fixed barrel file issue for codeclimate (#7161) 2020-04-08 14:39:06 -04:00
Michael Kohl
eef227113c
[deploy] Fix comment hiding (#7094) 2020-04-07 13:19:39 -04:00
rhymes
841179c673
[deploy] Add ARIA checked attribute to article reaction buttons (#7100)
* Refactor reaction buttons

* Add ARIA attributes
2020-04-06 18:53:09 -04:00
ludwiczakpawel
19da53450e
[deploy] Profile link fix (#7019)
* wtf

* fix

* gitattributes

* test ???
2020-04-02 19:33:17 -04:00
Ben Halpern
6131c4f03c
[deploy] Remove hardcoded banner exit code (#7018)
* Remove hardcoded banner exit code

* Fix issues with html variant name

* Fix html call logic
2020-04-02 12:08:13 -04:00
ludwiczakpawel
3a17fd2aa9
Crayons Cards and Links (#6997)
* updating links

* fixing exisitng links

* reogranizing links

* update variables

* more variable updates

* .

* rename

* themes adjustments

* whoops

* contrast fix for ben

* little fixes
2020-04-02 10:48:18 +02:00
rhymes
f507b8835e
Avoid requesting reaction counts for draft articles (#6931)
* Avoid requesting reaction counts for drafts

* Remove double condition check
2020-04-01 09:24:46 +02:00
Molly Struve
d1fc988ed0
[deploy] Revert "Serve Feed Content From Elasticsearch (#6847)" (#6983)
This reverts commit d7cc1da280.
2020-03-31 16:25:48 -05:00
Molly Struve
d7cc1da280
[deploy] Serve Feed Content From Elasticsearch (#6847)
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
2020-03-31 13:30:36 -05:00
Ben Halpern
46b80329a9
Make notification hide correctly on click (#6895) [deploy] 2020-03-26 16:33:37 -04:00
ludwiczakpawel
209c01037a
Crayons'ifizing Header (#6780) [deploy]
* add tons of colors

* add tons of colors

* moving cheese around and prepping for new theming system

* documenting

* .

* moving theme code to own files

* replacing some variables

* whitespaces

* replacing another batch of variables

* get rid of another variable

* replace loading animation variable with one-fits-all-sizes

* get rid of theme-anchor-color

* remove code colors variables

* another batch of variables replaced

* mostly bringing in variables for haxor theme

* remove invert-image variable for chat

* remove another inver-image variable

* forgot to remove reaction-background variable

* remove border variable

* series

* .

* remove another variable

* remove another variable..

* another batch of variables

* and more...

* header updates

* i forgot to commits things in my PR....

* fix border

* .

* simplifyuing placeholder

* responsiveness

* responsive

* search fix

* fixing prefix-less classes

* increase clickable area

* small style updates for pink theme

* tests

* Fix test

* responsive dropdown

* tiny fixes

* generator rewritten

* dropdown reworked a little

* adjustments

* fix pwa

Co-authored-by: rhymes <rhymesete@gmail.com>
2020-03-26 12:21:53 -04:00
Molly Struve
c62a60abdc
Remove Unused JS file and Algolia References (#6750) [deploy] 2020-03-20 16:33:15 -05:00
Fernando Valverde
14c13cb33b
Adds Podcast Episode metadata as JSON to avoid scraping the HTML (#6727) [deploy]
* Adds Podcast Episode metadata as JSON to avoid scraping the HTML

* Uses app_url helper instead of app_protocol_and_domain string interpolation for podcastImageUrl

* Adds podcast_episode#mobile_player_metadata, cleans eslint/codeclimate mess I made & adds tests

* Removes an extra line to fix codeclimate

* Removes unnecessary return
2020-03-20 10:28:24 -04:00
Molly Struve
c2b9c7a7d0
remove unused followed articles javascript (#6669) [deploy] 2020-03-17 09:44:26 -05:00
Fernando Valverde
0bc7b0ea21
Podcast playback update for iOS app native implementation (#6035) [deploy]
* First experiment with supressing audio playback on native iOS

* Adds load audio message posting

* First version of refactor working on web

* handlePodcastMessages now receives messages sent into JS from native iOS app

* bump back to "v2" local storage key or playback state

* terminatePodcastBar now clears the currentAudioState

* function getMediaState now initializeMedia, fixes audioExistAndIsPlaying for web, better playAudio error management & others

* Fixes bug in playAudio() & clears audioInitialized when no Podcast was initialized

* Codeclimate tweaks

* Reorders functions to comply with codeclimate

* More codeclimate reordering & fixes

* Upgrades the audio bridge messages to JSON instead of strings

* codeclimate doh
2020-03-09 12:09:42 -04:00
Mac Siri
a08d665afa
Change sponsorClickHandler to standard function declaration (#6502) [deploy] 2020-03-06 15:33:20 -05:00
Michael Kohl
0fd6c948d1
Move followings to internal API (#6494) 2020-03-06 19:33:26 +01:00
Ben Halpern
afc8594dd9
Switch from cookies to localstorage for hero banner (#6498) [deploy] 2020-03-06 08:54:36 -05:00
Ridhwana
a91580c4cb
Cookie Expiry for the Campaign Hero Banner and Event Listener update (#6496) [deploy]
* refactor: add an eventListener for click

* chore: oops

* feat: add expiry for the cookie 5 days from now

* chore: update comment

* chore: add strict back
2020-03-06 08:01:35 -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
Ridhwana
55909afdc7
Make Hero Banner closable (#6333) [deploy]
* feat: set up an event handler that will allow close the banner and set a cookie when you've closed it

* feat: return early if the cookie says it shouldn't be shown

* refactor: make the names more general so that they can be applied to other campaigns
2020-02-27 12:06:37 -05:00
Ben Halpern
6bcfa73412
Fix algolia paginate issue and other feed problems (#6281) [deploy]
* Fix algolia paginate issue and other feed problems

* Remove unnecessary limit
2020-02-24 13:14:50 -05:00