Commit graph

635 commits

Author SHA1 Message Date
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
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
rhymes
b6b450747e Re-enable hello dev in console (#3615) [ci skip] 2019-08-05 15:37:30 -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
Mac Siri
29e0f5597c Disable use of localStorage when cookie-less (#3322)
* Disable use of localStorage when cookie-less

* Add missing return
2019-06-28 17:11:49 -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
Andy Zhao
b953f17d0c New Feature: Subscribe to posts! (#3149)
* Add MVP of notification subscriptions

* Add rate limiting for notification subscriptions

* Show modal for logged out users on subscribe click

* Add enter key functionality for checkbox

* Add relationships for notification subscriptions

* Add model test for notification subscription

* Deprecated article mutes in favor of notification subscriptions

* Deprecated comment mutes in favor of notification subscriptions

* Move comment muting tests and logic over

* Merge comment and article muting into subscriptions

* Remove redundant check

* Use database to check for rate limit instead of cache

* Test for subscriptions handling notifications properly

* Fix notification model spec for subscriptions

* Fix tests for subscriptions

* Remove rate limiting

* Properly handle logged out users getting subscription status

* Fix test for new pattern

* Update reserved words

* Add config column to notification subscriptions

* Add logic for top level config and move tests

* Test for top level subscribers getting notified

* Fix logic mistake oops

* Add index and refactor comment_user_ids
2019-06-14 12:03:43 -04:00
rhymes
7f2045b250 Pro Analytics: stats for a single article (#3120)
* Add /stats endpoint for articles, opened only to Pro users

* Add analytics to article stats page

* Add stats button to the article page and test stats page
2019-06-13 19:02:09 -04:00
Mac Siri
0af2a0a7dc Update Service Worker and Favicon (#3142)
* Update favicon

* Update ServiceWorker with error logging
2019-06-13 11:39:03 -04:00
Mac Siri
f62bc7faa8 Fix js-breaking webcomponent (#3087)
* Remove webcomponents-loader

* Add unpkg webcomponent-loader

* Update clipboard-copy-element to include @githubscope

* Make WebComponent loading async

* Simplify clipboardCopy
2019-06-10 11:23:42 -04:00
Desi Rottman
18d6ff0d74 Adds bug bounty link to console (#3067) [ci skip] 2019-06-07 13:58:07 -04:00
Ben Halpern
a3a9f51103
Fix improper archive redirect (#3064) 2019-06-06 17:03:59 -04:00
Mac Siri
1ea1a30ca7
Remove js-yaml.js (#3054) 2019-06-05 21:27:39 -04:00
Ben Halpern
80f42a544a
Add noopener to external target blank links (#2923)
* Add noopener to external target blank links

* Add noopener to external target blank links properly

* Fix schema mistake
2019-05-21 13:56:25 -04:00
Ben Halpern
97125dfd6a
Add PWA target blank functionality (#2921) 2019-05-21 13:15:36 -04:00