Commit graph

197 commits

Author SHA1 Message Date
Ben Halpern
e9252bcd10
Fix podcast NaN time issue (#5513) [deploy] 2020-01-14 15:30:11 -05:00
rhymes
ff7532b3db Handle liquid tag errors in comments form (#5485) [deploy]
* Handle liquid tag errors in comments form
* Do not hide Pundit::NotAuthorizedError errors
2020-01-14 14:10:05 -05:00
Ben Halpern
c0a7c17054
Modify podcast design details and functionality (#5472) [deploy]
* Modify podcast design details and functionality

* Adjust play button size

* Add heroku slug commit to some cache keys
2020-01-14 13:56:47 -05:00
Ben Halpern
5812ecc383
Open /connect sidecar links in iframe (#5203) [deploy]
* Use iframe for connect sidecar

* Modify css of lefthand sidebar

* Add proper sidecar markup

* Update tests
2019-12-21 15:46:36 -05:00
Matheus Azzi
662a99ade3 Remove unnecessary reaction call (#5122) [deploy]
Clicking the button to follow people on search page was erroneously
triggering a reaction request, thus not having the reactable_id.

We've updated the handlers not to trigger it.
2019-12-19 11:03:34 -05:00
Ben Halpern
1e34a2d8f9
Move navbar rendering JS inline (#5141) [deploy] 2019-12-16 14:48:02 -05:00
Ben Halpern
500ec5d3b0
Guard for presence of page-content in JS (#5138) [deploy]
* Guard for presence of page-content in JS

* Modify offline states sw

* Change from skipping . to skipping .js and .css

* Bump static cache version
2019-12-16 14:02:59 -05:00
Andy Zhao
71157c993e Hide comment feature (#4944)
* Add MVP of hide comment feature

* Slight copy adjustments

* Remove unused file oops

* Fix strange styling issues

* Add hide/unhide comment specs

* Authenticate user for hide/unhide

* Add tests for hide/unhide functionality

* Remove opacity CSS for hidden comments

* Fix hidden comment explanation logic

* Fix some styling issues

* Fix hiding top level comment logic

* Show only hidden comments in permalink and not thread

* Hide subtree properly if hidden comment

* Fix weird CSS issue

* Properly hide comments for permalink view

* Show children comments in permalink view

* Add tests for comment hiding visibility

* Remove superfluous code and adjust copy

* Remove some more logical duplication

* Add dedicated article column for any comments hidden

* Add reload in test
2019-12-10 15:09:47 -05:00
Ben Halpern
90892bf692
Modify cache rate for additional_content_boxes (#4968) [deploy] 2019-11-29 17:07:22 -05:00
shaneblackburn
9d7817b025 Disable like button b/w click & backend response (#4869) [deploy] 2019-11-21 12:31:40 -06:00
John Curcio
157a6f1ef1 Add pagination to followers and following page in dashboard (#258) (#4375) [deploy]
* Add infinite scroll to followers list (#258)

* Refactor fetchNext function for clarity (#258)

* Sepparate following tab into multiple tabs to support infinite scroll (#258)

* Add infinite scroll to following pages (#258)

* Add tests to infinite scroll api

* Refactor dashboard loading text

* Refactor infine scroll function

* Fix duplicated entries problem in infinite scrolling

* Switch randomized attributes to sequential to avoid InvalidRecord error

* Add acceptance tests for infinite scroll

* Remove unused following method

* parameterize limit per page for followers and followings

* Split follows endpoint into followers and followings

* Authenticate user with api key in followers and followings

* Split followers endpoint into users and organizations

* Add redundant html to sublist partial

* Speed up infinite scroll tests

* Refactor api json responses to use partials

* Authenticate api user before follows create

* Resolve conflicts on scrolling js

* Improve partials organization and fix organization username bug

* Improve readability of unauthorized test

* Use let! to create scrolling test data

* Fix not working podcasts link

* Refactor initScrolling to remove linting errors

* Fix codeclimate coding style issue

* Test tags forms and podcasts hyperlinks

* Fix eslint issue with double equals

* Improve before_action usage and readability
2019-11-20 18:21:18 -05:00
Mac Siri
d2373b5678
Add Clipboard polyfill (#4824) [deploy] 2019-11-20 11:32:30 -05:00
Andy Zhao
85d8f52789 Hide a blocked user's content [deploy] (#4678)
* Hide blocked users' content appropriately

* Use RESTful create route

* Update functionality to block the user

* Fix specs for new route

* Use const instead of var

* Add noopener and noreferrer

* Remove caching for blocked user ids

* Add new rule for lack of noopener noreferrer

* Update snapshot
2019-11-04 14:47:26 -05:00
Dhananjay
81b171efa8 Fix Lints in initializeBaseUserData (#4612) [ci skip] 2019-10-31 14:44:34 -04:00
Jenna Pederson
77270290da Use named function so duplicate event handlers are discarded (#4655) [ci skip] 2019-10-30 13:26:14 -04:00
Allen Br
9fa97ff642 Hide report-abuse on current_user profile (#4460) [ci skip] 2019-10-23 14:57:36 -04:00
José Chaves Neto
f9f7e1813b refactor initializeTouchDevice (#4415) 2019-10-22 11:26:11 -04:00
Colby Melvin
fca98d952d Fix scrollheight calculation bug (#4279) [ci skip] 2019-10-18 16:41:24 -04:00
José Chaves Neto
67089f50ff Refactor initializeTimeFixer.js (#4416)
* refactor initializeTimeFixer.js

* apply feedback

* apply review

* fix bugs
2019-10-17 08:05:45 -04:00
Yash Dave
d307ce7469 Fix JavaScript Console errors in /Comments sub-page of any article (#4446)
* Fix JavaScript Console errors in /Comments sub-page of any article

- Make use of `document.body.contains()` to check if the element is present before trying to Add or Remove Event listeners or assign attribute values to the same.

* Implement recommendations for changes

- Switch String.match() to Regex.test() in order to have consistent Boolean return.
- Switch if(document.body.contains(element)) to if(element) as no need to check if the element is in visible context, only whether present or not.

* Implement recommendations for changes

- Switch String.match() to Regex.test() in order to have consistent Boolean return for isIOSDevice().
- Switch if(document.body.contains(element)) to if(element) as no need to check if the element is in visible context, only whether present or not.
2019-10-16 09:06:28 -04:00
Gabe Dunn
1c1a2e44fb update muteUnmute to use ternaries instead of if/else to avoid duplicated code (#4442) 2019-10-15 17:12:27 -04:00
José Chaves Neto
3161ab3214 Fix 'use strict' lints (#4414) [ci skip] 2019-10-14 13:46:15 -04:00
Jeremy Schuurmans
ddabcb9d38 remove unused variable and querySelector method (#4359) 2019-10-11 09:28:57 -04:00
Jeremy Schuurmans
96eb1a070a Fix ESLint errors in initializeBodyData.js (#4267)
* fix use global form of use strict error

* fix errors involving functions being used before being defined

* fix undefined function and == errors

* fix redeclared variable name error

* use arrow functions to fix unnamed function warnings

* specify global function at top of file instead of disabling line in eslint, change meta variable name
2019-10-10 13:17:16 -04:00
Yash Dave
e7c4310211 Fix eslint issues in initializeSettings.js (#4329)
- eslint configuration moved comments to a seperate line
  in pre commit hook allowing the eslint-disable-line to
  not work correctly.
- switched to eslint-disable-next-line to fix the same
2019-10-09 16:05:07 -04:00
Yash Dave
d125d94cbb Fix lint in initializeCommentPreview.js (#4320) [ci skip] 2019-10-09 14:35:37 -04:00
Yash Dave
350e43e62b Fix lint in initializeCommentDate.js (#4319) [ci skip] 2019-10-09 14:33:52 -04:00
Sagar Choudhary
1aa0d95de3 Refactor: initializeDashboardSort.js (#4313)
* Refactor: initializeDashboardSort.js

* change: onchange method to native js eventListener
2019-10-09 10:32:27 -04:00
Yash Dave
fd1b003334 Refactor/fix initializeCommentDropdown.js (#4318)
* Fix eslint issues in initializeCommentDropdown.js
- file was already compliant, just needed to add
  'use strict'.

* remove unnecessary eslint rule
2019-10-09 08:19:08 -04:00
Sagar Choudhary
a8b61bf781 Refactor: initializeCreditsPage.js (#4312) [ci skip] 2019-10-08 12:33:28 -04:00
Yash Dave
49fbf280c3 Refactor initializeArticleReactions.js (#4303)
* Refactor initializeArticleReactions.js
- Refactors file according to eslint rules
- Add showModal and sendHapticMessage to globals
  in eslintrc.js
- Shorten initializeArticleReactions() by distributing
  parts of it into jumpToComments() and requestReactionCounts()
- requestReactionCounts() makes an ajax request to get the
  reaction counts
- jumpToComments() jumps to comments element directly if the
  element jump-to-comments is present

* Fix reactionOnClick function to work correctly
- Move sendHapticMessage and showModal global declaration to file
- name function on reaction button on click as addReactionOnClick
  which then calls reactToArticle()
2019-10-08 08:41:43 -04:00
rhymes
c8abbe9d60 Pro: memberships (#3461)
* Add ProMembership model

* Implement ProMembershipsController#create

* Implement basic ProMembershipsController#show

* Add ProMembership to ledger

* Populate user history after pro subscription is created

* Add fields for expiration notifications

* Add ProMemberships::ExpirationNotifier to notify users of expiring memberships

* Add tasks for recurring jobs to notify users of expiration

* Add auto_recharge column to ProMembership

* Add ProMemberships::Biller (incomplete)

* Fix specs

* Add ProMembership to Administrate

* Fix spec

* Add has_enough_credits? to User and Organization

* Add Payments::Customer class

* Finish ProMembership::Biller functionality

* Fix ProMemberships::Creator check for credits

* Disable destroy actions for ProMembershipsController

* Correctly authenticate ProMembershipsController actions

* Make sure only pro user's history can be indexed

* Add ProMembershipsController#update action for auto recharge

* Use regular AR to save new credits and add touch to the purchaser

* Clarify Pro membership create policy

* Display information about an existing pro membership

* Add UI to show page

* Add system test for Pro membership creation

* Implement edit membership

* Make sure users with pro memberships can access history and dashboard pro

* Fix padding issue

* Show a different text for a user that has credits but not enough for Pro

* Move Pro Membership functionality inside settings

* Update Pro Membership link in email notifications

* Bust all relevant caches

* Add the Pro checkmark around the website

* Use Users::ResaveArticlesJob instead of delay

* Add/remove user from pro-members chat channel

* Use the appropriate Pro checkmark

* Remove unfinished pro elements

* Remove checkmark JS
2019-09-24 10:38:54 -07:00
Ben Halpern
b1b408e61c
Add more variation to home feed (#4069)
* Add more variance to home feed

* Fix array typo

* Fix up watercooler spec

* Fix up blackbox spec
2019-09-19 12:58:11 -07:00
Ben Halpern
d9634150d8
Add new mod links and tooling (#4009)
* Add new mod links and tooling

* Adjust mod page copy, test
2019-09-12 00:11:01 -04:00
rhymes
80e6cf4801 Notifications: increase efficiency and fix pagination offset issue (#3986)
* Increase efficiency and fix pagination offset issue

Right now we filter recently aggregated notifications at runtime, which worked before when there was no pagination, but now filtering is not a good idea combined with offset pagination because it throws off the calculations.

The filtering should be done in the SQL query before paginating, which is what we've switched to. I added a bunch of scopes to make the code clearer as well.

To avoid nesting tags I've also updated the HTML and the JS logic to insert it in the right place.

* Add explanation for hiding the load more button for new users
2019-09-10 09:43:45 -04:00
rhymes
f7d6874956 Paginate notifications (#3948)
* Use offset instead of page and explain things

* Make load more button work

* Add tests for admin view

* Restore the previous logged out behavior

* Modernize initNotifications.js

* Revert "Modernize initNotifications.js"

This reverts commit 4a112b797d7911c4ab63ad0c0a07111b4e7abe25.

* Fix elements presence errors

* Change load-more-button to only appear if 7 or more posts (and some notification copy adjustments)
2019-09-07 11:54:30 -04:00
Nick Taylor
45368132b0 Fix JS Lints (#3815) 2019-08-26 18:01:12 -04:00
Nick Taylor
39618f66a2 Fixed some more Frontend Lint Issues (#3792)
* Removed a file that is not used.

* Fixed some lint issues

* Fixed some more lint issues
2019-08-23 10:21:28 -04:00
Ben Halpern
a934968190
Add dropdown and report-abuse for users (#3788)
* Add dropdown and report-abuse for users

* Move script to JS area
2019-08-21 16:43:52 -04:00
Andy Zhao
e0da0ac955 Fix for multi-image upload to handle single imgs for comments (#3771)
* Fix for multi-image upload to handle single imgs for comments

* Remove additional multiple oops
2019-08-19 18:15:35 -04:00
Ben Halpern
dd41f7ddf5
Redesign series style (#3768) 2019-08-19 15:26:21 -04:00
Ben Halpern
0b64407b81
Ensure anonymization of IP in GA (#3734) 2019-08-16 14:06:02 -04:00
Ben Halpern
5d380f93cb
Track success of DEV Shop ads (#3589)
* Add basic display ad event tracking

* Finalize client-side eventlistening functionality
2019-07-31 13:44:47 -04:00
Ali Spittel
52c60ce37e Feature/refactored onboarding (#3333)
* set up refactored onboarding

* create onboarding page

* add in first slide and change slide functionality

* fix test suite

* profile refactor

* profile refactor

* refactor to api

* add checkbox fields

* add checkbox fields

* remove puts

* add basic css

* add styling

* add redirect

* hide back and next at first and last slides

* test refactored onboarding

* test refactored onboarding

* remove article edits

* Fix schema

* Add deleted file back in

* Add default value for checked_t&c column

* Adjust HTML structure to keep nav buttons in place

* Fix ESLint issues on Onboarding.jsx file

* Handling for undefined or empty followedTags on getUserTags

* Fix codeclimate issues

* Fix codeclimate issues

* Fix more codeclimate issues

* Fix more codeclimate issues

* Update Onboarding snapshots

* Uncheck the CoC and T&C checkboxes on render

* Update snapshots

* Return false instead of raising error

* Update spec to use new onboarding

* Redirect to onboarding if haven't seen it yet

* Prevent redirect to onboarding from /signout_confirm

* Use assign_attributes instead of saving twice

* Move COC and T&C checkbox page to second slide

* Add 'go back to original page' functionality

* Reuse ready prototype logic

* Keep track of the last visited onboarding page

* Fix email subscription bug

* Fix overflow issue for tags page

* Remove height to prevent page container scrolling

* Check for CoC and T&C for displaying onboarding

* Add InstantClick redirect and preserve referrer in client

* Fix async update + check by using localStorage

* Turn off onboarding for tests

* Finalize design for onboarding

* Finalize design for onboarding

* Make bulk follows during onboarding

* Fix bulk follow test
2019-07-26 15:53:32 -04:00
Anna Buianova
445bb0952c Open a page in a new tab w/o warning when playing a podcast #2958 (#3499) 2019-07-18 09:51:08 -04:00
Mac Siri
e28aaecca4
Make xhr request's method dynamic for archiving. (#3335) 2019-07-15 14:40:01 -04:00
rhymes
1f97669e66 Credits ledger (#3395)
* Add #purchase to Credit

* Assigns spent credits to the listing

* Add Credits::Ledger and use it

* Localize ledger datetimes

* Add organization to the ledger

* Add tests for ledger

* Remove unused class

* Fix scope error

* Compare UTC times

* Fix broken specs

* Wrap listing create in a transaction

* Wrap listings bump into a transaction

* Avoid microseconds issue with datetimes in tests

* Use .detect instead of .select.first

* Fix spec description
2019-07-09 10:11:18 -04:00
Nick Taylor
4edf4a646f JS: Refactor & Fix Lint (#3082) 2019-07-01 14:04:25 -04:00
rhymes
2bf54edb9c Pro: History (#3220)
* Add base history support

* Add tags and ranking and make it work

* Fix styling

* Add article title and text excerpt to the index

* Add pagination support

* Debounce the search to 300ms

* Show history only to pro users

* Use routing helpers instead of hardcoding

* Raise the page size to 100

* Remove console log

* A bit of regrouping
2019-06-18 14:58:24 -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