Commit graph

273 commits

Author SHA1 Message Date
Hoang Vo
293ba5231b Fix eslint issues in app/javascript/listings (#4253)
* Fix some eslint and a11y issues

* Add a11y fixed to snapshot

* Fix missing whitespace that cause test fail

* Fix code duplicate

* Config eslint to allows the label as a sibling

* Use 'error' instead of 2 in eslintrc

* Correct propTypes in SingleListing

* Add missing id prop for select

* Add space between two functions

* onKeyPress only register Enter

* Allow space key also to activate action

* Use a common function for three event handlers
2019-10-14 14:23:20 -04:00
Jacob Herrington
742d50f524 Remove unused onboarding files (#4254)
* Remove commented code

* Format onboarding SCSS

* Remove old onboarding files

* Remove tests for deleted React components

* Remove outdated onboarding stories
2019-10-14 09:35:37 -04:00
Karin Hendrikse
7ab10e709a Test: add test for ItemListItem and ItemListItemArchiveButton (#4391) 2019-10-14 08:54:07 -04:00
RakChamp25
e690348824 Refactor: moreConfig.jsx (#4352)
* Refactor: moreConfig.jsx

* Revamp Changes

* Revamp TextField Proptypes

* Fix Text Field and revamp changes

* Removed trailing spaces
2019-10-14 08:44:45 -04:00
samuel-glitch
ea64c42d3a Remove unused import (#4362) 2019-10-11 08:43:50 -04:00
Ben Halpern
0a60faec8c
Add tag rules to article v2 editor (#4339)
* Add tag rules to article v2 editor

* Add bottom phrase to tag dropdown

* Remove console logs

* Remove empty space in css

* Remove commented code and clean up css

* Add type='button' for a11y
2019-10-10 20:19:12 -04:00
RakChamp25
e00e7c3412 Refactor : BodyPreview.JSX (#4348) 2019-10-10 13:21:53 -04:00
Leonid Trofymchuk
5e347a6f94 Simplify key codes expression in Tags component (#4248)
* Simplifying this key codes expression in Tags component

* Refactor KeyboardEvent keyCode to key

* Simplify cyrillic letter regexp

* Wrap condition in 2 lines
2019-10-09 16:50:48 -04:00
Ben Halpern
3db3f6fdc2
Fix gotchas with color preview and some style adjustments and add documentation (#4322) 2019-10-08 21:32:31 -04:00
Saurabh Daware
81e3f65965 Add preview for color changes in profile edit (#4212) 2019-10-08 14:52:07 -04:00
Victoria Fluharty
e111951ceb fixes bug in tag search feature (#4222)
* fixes bug in tag search feature
now allows user to type in full name of tag and it does not disappear
makes other changes to pass eslint failing tests
moves methods around according to eslint tests
makes use of prevState callback method due to eslint tests

* updates handleKeyDown method
removes complex logical expression comparison from !== to !=
changes made due to failing task in pull request

* removes commented out code that I added to test code
updates logic to fix searchResults
removes .filter()

* adds comments to fixed code for clarification
2019-10-08 09:40:53 -04:00
Karin Hendrikse
a9adeee11f [SPEC] Add tests for sidebarUser component (#4301) [ci skip] 2019-10-07 16:01:59 -04:00
Karin Hendrikse
14c9adefd5 Test: add test for opening help window on articleForm (#4237) 2019-10-07 08:49:44 -04:00
Nick Taylor
30cc799240 Mini refactor to make var names clearer. (#4257) 2019-10-06 17:04:14 -04:00
Attila Blascsak
66faaccdd8 Fix lints in notificationSubscriptionHander.js (#4172) [ci skip] 2019-10-04 13:08:59 -04:00
Aswathprabhu
13ac7b43dd Remove code dupes in personalInfoForm (#4156) [ci skip] 2019-10-03 11:21:18 -04:00
Aswathprabhu
eeb6cbd763 Refactoring userDetails.jsx removes user config duplication (#4161) 2019-10-01 17:01:05 -04:00
Aswathprabhu
65394cb8cc Refactoring articleForm.jsx removes code duplication (#4159) 2019-10-01 12:05:57 -04:00
Aswathprabhu
cb84a7c63f Refactoring view.jsx removes code duplication (#4154)
* Refactoring view.jsx removes code duplication

* Updates view jsx test snapshots
2019-10-01 08:41:46 -04:00
Laura Chan
427a8dd45e Fix colorPicker's lints (#4109) [ci skip] 2019-09-27 09:43:51 -04:00
John Curcio
64c9b36a40 Simplify notification un-subscription process (#3870) 2019-09-25 16:52:59 -04:00
Aswathprabhu
144d3a0d6f Refactor userDetails's buttons (#4107) [ci skip]
Remove code duplication
2019-09-25 15:09:20 -04:00
Mario See
3e23b3d568 Limit listing's permitted markdown tags (#3882) 2019-09-25 12:43:29 -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
Jacob Herrington
6ddac027e8 Refactor intro slide component (#3933) 2019-09-23 14:08:58 -04:00
Jacob Herrington
7198a72953 Refactor tags components (#3895) [ci skip] 2019-09-20 10:18:44 -04:00
Ben Halpern
705da8fbde
Switch to CDN for iframe resizer (#4053) 2019-09-17 16:42:46 -07:00
Ben Halpern
1e8954e581
Add iframe resizer content lib (#4019) 2019-09-12 20:14:54 -07:00
Dmitro Pochapsky
d0f615f3af Fix chat.jsx lints (#3889) 2019-09-12 09:30:59 -04:00
rhymes
61494d2343 Images uploads: fix UI for multiple images (#3958)
* Fix spacing of images button in editor v1

* Fix wording for multiple images in editor

* Update JS tests
2019-09-07 10:57:14 -04:00
Akshay Mahajan
c5577f68a3 Reading list: set default reading time to 1 minute (#3927)
* fixes 0 min reading time in reading list by setting the default reading time to 1 min

* Updated PropTypes for article_reading_time & reading_time to number.isRequired. Updated the relevant tests.
2019-09-03 15:50:40 -04:00
Mario See
fda048dc12 Listing Drafts and Deletion (#3540)
* wip init handle draft class and styling

* add draft button

* start splitting up listing row into multile files

* separate tag links

* split location

* fix location

* separate listing row action buttons

* update listing row proptypes to describe listing object

* contact via connect to jsx

* fix default checked

* init draft creation and first publish charge

* fix first publish logic and credit charging

* handle drafts in dashboard filtering

* adjust isDraft bool statement

* hide drafts from main listings feed

* fix expired and draft bools in listing row

* adjust create listing org credits

* internally handle drafts

* adjust listing row

* break down update method

* remove unnecessary logic and shorten lines

* fix logic again woops

* convert input hidden value + submit into one form button submit with corresponding name and value

also adds clear message that drafts do not cost credits

* handle insufficient org credits on first publish

- uses user credits to publish
- similar to bump implementation

* fix sorting for personal and all orgs

* space out some elements

* don't spend original users credit for them

* add delete buttons and delete_confirm and destroy methods

* remove notification removal since listings dont trigger notifications

* move draft message and add draft_params to tests

* Update classified_listings_controller.rb

* update tests

* update snapshot

* add del tests

* add guard preventing free draft publish

* fix draft filter

* update from master and resolve merge conflict in listing preact

* Revert "update from master and resolve merge conflict in listing preact"

This reverts commit 0a34fccf334a2ca0902644b486cb26ead6bef664.

* update column spec

instead of setting and saving

* separate two expectations into their own tests

* split more tests into single expectations

* change to unless bumped_at? instead of if nil

* Fix listing draft edge cases and styling

* Add title tags to listings pages
2019-09-01 13:54:54 -04:00
Mario See
3cf6a2d4bc Add singleListing specs (#3883) [ci skip] 2019-08-30 14:49:20 -04:00
Ben Halpern
9259a70ab8
Modify onboarding slides (#3864) 2019-08-28 11:05:57 -04:00
Mario See
47c2885810 Listings set custom expiry date (#3770)
* add expire_on column to classified_listings

* add expire_on to valid listing params

* add expire_on to model

* add expire date to new listing form

* add field in edit form

* add expiry dates to dashboard

* update expiry date in listing toolkit

* WIP unpublish job and test

test still has to run properly

* add job to class name

* change job to rake task

* revert snap change

* delete migration file

will add new one and revert schema changes to rename column

* reset schema

* add new migration to schema 'expires_at'

* change expire_on to expires_at
2019-08-23 17:33:50 -04:00
Ben Halpern
76bedc6b23
Add onboarding variants and update variant display ratio (#3812) 2019-08-23 12:48:29 -04:00
Ben Halpern
40559a0457
Add random variants to onboarding for a/b testing (#3742)
* Add random variants to onboarding for a/b testing

* revert listings dashboard snapshot
2019-08-18 18:30:22 -04:00
Bolarinwa Balogun
41aff162cc Allow upload of multiple images at a time (#3599)
* Allow upload of multiple images at a time

* Update schema.rb
2019-08-18 15:03:14 -04:00
Theau Poulat
e0a7c7cc6e Onboarding : fixed bug that prevented toggle by clicking on label (#3725)
* toggle click bug fixed

* updated snapshot
2019-08-16 11:41:00 -04:00
Jacob Eubanks
180935bd37 Delete unused, commented-out code (#3722) 2019-08-15 12:24:48 -04:00
Andy Zhao
0f46b0deed Add Stack Exchange Liquid tag (#3637)
* Add Stack Exchange Liquid tag

* Add Stack Exchange/Overflow tag

* Convert to integers

* Add better error handling

* Make all links open in new tab

* Adjust names and refactor a bit

* Use key for every API call

* Add new lines to end of svg files

* Add better error handling

* Fix edge case where input is not numeric

* Finalize Stackexhange tag design and functionality

* Fix css typo

* Update snapshots

* Fix snapshot back
2019-08-14 15:01:47 -04:00
Ben Halpern
321560b751
Fix linting (#3714) 2019-08-13 20:32:01 -03:00
Jacob Herrington
97d04df965 Add place holder alt text to markdown link (#3687) [ci skip] 2019-08-12 11:57:06 -04:00
Bolarinwa Balogun
4dd90c5dd1 Fix upload overlap with editor/help page (#3640)
* Fix upload overlap with editor/help page

* Update test snapshot
2019-08-07 15:35:28 -04:00
Mario See
36535e546d Listing Dashboard: Handle expired listings (#3442)
* wip filter active and expired listings

* add published attribute to listings json

* add expired class to listings row

* filter through state

* make span button tabbable

* remove unused state

* update snapshot test

* add indicator and styles for expired

* linting errors

* clean up link

* remove function argument

* Update listingDashboard snapshot
2019-07-29 12:42:32 -04:00
Ben Halpern
ee00b460bf Add getunopenedchatchannels to onboardingredirect (#3565) 2019-07-29 09:33:36 -04:00
Andy Zhao
9f34dcd0eb Make window.currentUser available globally (#3550) 2019-07-26 19:26:47 -04:00
Ben Halpern
640ada4948
Tiny adjustments to copy and functionality of onboarding (#3549) 2019-07-26 16:56:44 -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
Kitten King
6290451273 Fix Typos (#3510) 2019-07-22 12:56:48 -04:00