Commit graph

256 commits

Author SHA1 Message Date
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
Molly Struve
834eb51e98
Replace Airbrake with Honeybadger (#5007) [deploy] 2019-12-05 11:29:51 -06:00
Ben Halpern
585d672742
Replace serviceworker-rails gem with custome implementation (#4987) [deploy]
* Customize UserContext in Timber logs

* Replace serviceworker-rails gem with custome implementation
2019-12-03 08:50:56 -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
Ahmad Mahmoud
d3dfc70f5a Fix lint errors in pulltorefresh.js (#4594) [ci skip] 2019-10-30 14:21:09 -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
Luke Inglis
cb87cfd36e Resolve linting issue in app/assets/javascript/sendFetch.js (#4363) 2019-10-14 08:46:27 -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
rhymes
e579b03af1 Add an alt text and some type="button" attributes (#4331)
* Add alt text to rainbow dev logo

* Add type=button to buttons
2019-10-09 13:16:02 -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
Glenn Carremans
179c3150dd [PWA] Add purpose tag to 192x192 (#4220) [ci skip] 2019-10-08 11:31:35 -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
Aswathprabhu
e0287a574c Refactoring sendFetch.jsx removes code duplication (#4157) 2019-10-01 17:03:47 -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
Mac Siri
498b08dbb9
Fix reading time logic (#4049) [ci skip] 2019-09-17 13:17:06 -04:00
Bolarinwa Balogun
8d4aa8b157 Resolve inconsistent reading time estimate (#3328) 2019-09-16 10:05:07 -04: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
Jacob Herrington
81f7f73575 Format console copy (#3888) [ci skip] 2019-09-03 15:59:12 -04:00
Tiger Oakes
92e107e82e Use maskable icons for PWA (#3875) [ci skip] 2019-08-29 18:44:26 -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
Yash Dave
773982e210 Fixes some lint issues (#3786)
Fixes lint issues in /home/yash/GitHub/dev.to/app/assets/javascripts/utilities/
	- browserStoreCache.js
	- checkUserLoggedIn.js
	- createAjaxReq.js
	- getCurrentPage.js
	- getImageForLink.js
	- insertAfter.js
	- localDateTime.js
	- localStorageTest.js
	- preventDefaultAction.js

Signed-off-by: Amorpheuz <mail2ypd@gmail.com>
2019-08-22 15:59:13 -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
Nick Taylor
0147d8bd26 Fixed some lint issues (#3782) 2019-08-21 10:44:23 -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