Commit graph

220 commits

Author SHA1 Message Date
Mario See
1fcd6bb77b Fix location link in listing (#3464) 2019-07-12 13:02:12 -04:00
Sushant Bajracharya
01d1d1bcea Make the Preview button dynamic (#3317) 2019-07-10 19:14:14 -04:00
Mario See
699d8703c9 Make listing dashboard sortable (#3421) 2019-07-10 18:24:53 -04:00
Mario See
11be56f38c Add location to listings (#3370)
* add location to classified_listings

create rails migration and ran rake db:migrate

* add faker city to seed

* add location to index json

* add location as searchable attribute in algolia

* add form text field for adding location to new listing

* add location to dashboard json

* add location field for editing listings

* add location to listing_params in controller

* add location to single listing view

* add location to listing row in dashboard

* add location to dashboard test

* adjust listing dashboard row spacing

* reduce character limit

* reduce lines of conditional html elements

* compress listing card const

* fix form call for location in edit page

* update snapshot in dashboard

* add location length validation in listing model

* shorten limit and update location in edit page
2019-07-10 12:45:41 -04:00
Mac Siri
90f54773dc
Fix GistTag & RunkitTag preview issue (#3388) 2019-07-09 15:58:08 -04:00
rhymes
209b0ba607 History and reading list refactoring (#3338)
* Make readingList testable

* Make history and readingList more similar

* Extract ItemListTags component

* Simplify load next page logic

* History and reading list load more should be the same

* Extract ItemListLoadMoreButton component

* Use the same exact CSS for both

* Use empty instead of 0

* Extract ItemListItem component

* Remove unnecessary else

* Same search function

* Use a common module to group related functionality

* Extract loadNextPage and fix load more button presence logic

* Extract toggleTag

* Refactor toggleStatusView and pass page

* Added additional tests
2019-07-02 09:22:21 -04:00
Bolarinwa Balogun
bd360c7cf4 Make item count 'empty' instead of '0' when reading list is empty (#3320) 2019-06-28 07:55:43 -04:00
Mario See
4e75108d8b Fix escape key handling and add space in single listing view (#3306)
* add space and handle escape key down

* properly handle escape
2019-06-26 09:58:48 -04:00
rhymes
7da7a16d8d Pro: add referrers to dashboard and single article stats (#3295)
* Reorganize PageViewsController

* Add domain and path to PageView model

* Add before_create callback to populate domain and path

* Add list of referrers to AnalyticsService

* Add referrers to the UI

* Remove useless referrers card and tweak table line height

* Add referrer stats to article stats page

* Add not null and empty default to domain and path

* Refactor JS analytics client

* create_list is a step back here

* Revert "Add not null and empty default to domain and path"

This reverts commit bc02440076047a887c65d300bccd4661ecc8ffd0.

* Add index on domain concurrently

* Make the script more robust
2019-06-25 13:58:09 -04:00
Bolarinwa Balogun
bc54f30365 Add Item Count to Reading List Header (#3162) 2019-06-25 09:41:28 -04:00
rhymes
e3c2bf08e6 Deduplicate history items (#3279) 2019-06-25 08:42:01 -04:00
Ben Halpern
dcbb188cf1
Add pinned articles box to profiles (#3269)
* Initial pins work

* Add pin box to profiles

* Fix test snapshot spacing and optimize svg

* Fix listings spacing
2019-06-24 15:18:29 -04:00
Thanawat Senawat
6fc17a29cb Feature/reading list loadmore button (#3221)
* Add Load More Button to Reading List

* Set state showLoadMoreButton is false
2019-06-20 13:33:02 -04:00
rhymes
55634ad68f Display stats for organization article (#3232)
There was a bug where the frontend was not passing the organization id to the backend, and thus the fetching of the stats failed for organization articles.

This also adds a bit of error handling for `fetch` API
2019-06-19 09:17:35 -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
Mario See
9e616de9f8 Listings Dashboard (#3014)
* init wip react components

* wip add dashboard to listing views

- create a html.erb view to hold listing/dashboard with javascript_pack_tag
- create listingDashboard.jsx in packs
- create listingDashboard component and dashboard folder with smaller components
- added view to controller and routes

* slowly adding some formatting

adjusted styling, info

* remove listing body from dashboard

* add some styling and adjust info

* wip adding org listings

* wip multi org in dashboard

* adjust for multi org

* add styling and better multi org support

* comment out bump and delete -- save for upcoming PR

* reduce lines

* listing form has link to listings dashboard instead of listings

* adjust header boxes flex direction for mobile

* fix organization id query

* WIP testing

needs more rigorous tests

* finalize tests
2019-06-18 14:52:59 -04:00
Ben Halpern
d33cc055dd
Adjust notification subscriptions JS and css (#3165) 2019-06-14 18:54:42 -04:00
Ben Halpern
e130400e9e
Finalize UI for all types of notification settings (#3164) 2019-06-14 18:28:38 -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
rhymes
6960b89f28 Dashboard Pro: support InstantClick and show org analytics (#3102)
* Fix JS lint issues

* Do not rely on globals

* Use InstantClick to make transitions work in the pro dashboard

* Fix eager loadings and remove unused queries

* Refactor drawChart

* More consistency in naming

* Display correct analytics for organization
2019-06-12 09:40:42 -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
Daniel Compton
f75aef42f9 Add a space between "Change meta tag" and canonical_url (#3063)
Without the space, this shows up as "Change meta tagcanonical_url".
2019-06-07 21:15:32 -04:00
briwa
7c254dc8bf Remove an extra @ in Connect (#3040) [ci skip] 2019-06-04 14:43:37 -04:00
Ben Halpern
119d0f69d6
Finalize multi-org features (#3041)
* Finalize multi-org features

* Fix credits count issues

* Only show org list if multiple orgs on dashboard

* Add check for organizations to JS
2019-06-04 13:56:22 -04:00
Andy Zhao
47d9ec27fb Allow users to belong to multiple orgs (#2583)
* Allow user to have many orgs

* Allow users to handle multi orgs in settings

* Make rounded buttons inline

* Add multi org function to dashboards

* Fix merge conflicts

* Fix mistake in merge conflict fix oops

* Display the correct membership level

* Fix accessibility issues

* Display organizations for article editors

* Handle submitting org id with preact editors

* Make listings work with multiple organizations

* Allow listings to have multiple orgs on create

* Display the correct number of credits for each org

* Move script tag to Webpack

* Allow multi orgs for purchasing and viewing credits

* Use OrganizationMembership as authorization check

* Display multiple organizations for notifications

* Allow dashboard to be viewable under multi-orgs

* Remove unused method

* Add multi-org functionality for article editors

* Show pro dashboard buttons for member+ org levels

* Leave the correct organization

* Allow article API to change org id

* Add left-out authorization method oops

* Make nav buttons a bit more clear

* Fix merge conflict

* Fix adding org id for /api/articles and tests

* Fix tests for org policy

* Use proper logic for displaying org members

* Update org actions with new authorization

* Use correct org when creating a listing

* Remove additional payment charge oops

* Mark org notifications as read with authorization

* Remove deprecated post_as_organization attribute

* Use new org_admin syntax

* Remove deprecated org logic for article create and update

* Default all RSS posts to not belong to any org

* Render org_member page for guest users

* Update org policy spec to work with multi orgs

* Use org_membership for org traits and move identity code

* Use org_member trait

* Update to work with multi-orgs

* Validate article's org_id if param org_id is blank

* Make  a let variable

* Remove unnecessary eager load for credits

* Fix HTML structure and org logic for non-org users

* Update credits spec for multi-org

* Add test for failed payment when purchased by org

* Lint listings_spec

* Test that the listing was created under the user

* Add tests for POST /listings multi-org

* Use double quotes for classes

* Fix /manage and a few other multi-org bugs

* Fix test for multi org

* Use correct method SQL exists? not Rails exist?

* Fix reads spec for multi-org

* Fix org_controller actions to work with multi org

* Test only multi org and not old usage and fix leave_org

* Fix org showing user profile img test for multi-org

* Fix org logic for users with no orgs

* Remove switch org functionality

* Update tests and add hidden param for org id

* Redirect to the specific organization

* Test other org button actions

* Use settings_notice instead of legacy notice and refactor

* Fix weird extra end issue prob from merge conflicts

* Test for with new flash key

* Fix user_views_org tests for multi-org

* Test for new flash message

* Update snapshot with new a11y html

* Move styling to stylesheet

* Add site admins functionality

* Move org_member? method in user model and refactor

* Use unspent_credits_count for organizations

* Add tests for /listings/new and minor bug fixes

* Use .present? in case of empty array

* Fix a lingering deprecated method

* Use greater than 1 for random numbers

* Add tests for counting spent and unspent credits
2019-06-04 09:30:52 -04:00
Ben Halpern
10151f9f4c
Fix close modal click action (#3018) 2019-06-01 10:00:42 -04:00
Mario See
8359ab555f Add reading time to reading list (#2929)
* init

- add reading_time to reactions
- make migration
- add to algolia index in reaction model
- add method in reaction model to define reading time based on reactable reading time

* add time to front end

* Revert "Return errors instead of raising an exception on ArticleCreation (#2922)"

This reverts commit 09a99d93a3.

* Revert "init"

This reverts commit 53650ebcc3c93c54e396977f7c34f7aa35a589c4.

* Revert "Revert "Return errors instead of raising an exception on ArticleCreation (#2922)""

This reverts commit e8cf1f3a290dd06b937247e3ff7593e7c7036553.

* Update reaction.rb

* remove duplicate searchableAttribute
2019-05-31 16:45:29 -04:00
Ben Halpern
1775f42cc4
Finalize DEV Connect for listings (#3016) 2019-05-31 15:22:59 -04:00
Mario See
19b46a86e2 Add messaging option in listings (#2854)
* add prop for message modal method

* clean up comments from open inbox method

* add inbox type to listing model author

* add sample methods for opening message modal in listings and listing modal

* only show for users with open inbox and hide for self

* use contact_via_connect instead of inbox_type

* fix edit listing to include contact via connect attribute

* wip send message method

* adjust message styling

* change id name

* update destination

* remove unused methods
2019-05-31 13:48:45 -04:00
rhymes
36ad407c1d Fix zen mode's global key bug (#2969) 2019-05-31 13:33:29 -04:00
briwa
b301bf8def fix(article): scroll to top when inserting image (#2998) 2019-05-31 10:29:42 -04:00
Mohammadjavad Raadi
2e8eda4974 Fixes Listing Items Spacing Inconsistency and Content Overflow Issue #2846 (#3011) 2019-05-31 09:02:32 -04:00
Curtis Maloney
8d50956f1a Optimise images (#2966) 2019-05-30 17:37:10 -04:00
briwa
4f31c6d07a fix(reading-list): even spacing for Save and Bookmark span (#3000) 2019-05-29 11:19:01 -04:00
rhymes
38aa45c8e3 Cleanup bodyPreview component (#2980) [ci skip] 2019-05-28 23:55:37 -04:00
Ben Halpern
37fabd08b1
Fix some connect bugs with wrong url and remove some dead code (#2953) 2019-05-24 12:19:59 -04:00
Ben Halpern
e3400a2dc2
Make home page listings minimizeable (#2928) 2019-05-21 17:17:28 -04:00
rhymes
09a99d93a3 Return errors instead of raising an exception on ArticleCreation (#2922) 2019-05-21 15:18:02 -04:00
Ben Halpern
ec900a3146
Add safe navigation within chatchannelmemberships and remove some console.logs (#2903) 2019-05-20 13:20:06 -04:00
Ben Halpern
70580d0265
[WIP] Connect misc improvements/debugs (#2880)
* WIP Connect misc improvements/debugs

* Modify tests and update snapshots

* Change GitHub sidecar copy
2019-05-20 10:08:51 -04:00
Ben Halpern
bd22edc73c
Add visual indicator for chat channel more details (#2477)
* Add visual indicator for chat channel more details

* Don't show block button in non-direct context
2019-05-17 11:10:07 -04:00
Ben Halpern
fb6904f86d
Fix up articles controller (#2855)
* Fix up articles controller

* Update request specs

* Add proper post_under_org tests

* Remove create_job_opportunity

* Add user profile back in
2019-05-16 13:56:26 -04:00
rhymes
941ab4178b Articles API: create and update (#2844)
* Add system test to create article from the editor

* Move article creation from API to app controller

* Fix system test to edit posts

* Move article update from API to app controller

* Rewrite create article API using API key

* Add main_image and canonical_url to allowed creation params

* Rewrite update article API using API key

* Fix tests and have Comments API inherit from API
2019-05-16 12:26:24 -04:00
Tim Lange
2837e5430a Refactor Onboardings (#2475) 2019-05-15 17:51:19 -04:00
Ben Halpern
dd20e70f12
Simplify article show page reactions (#2827)
* Simplify article show page reactions

* Clean up styling and adjust zen mode logic

* Remove unused variables

* Update app/views/articles/_actions.html.erb

Co-Authored-By: Nick Taylor <nick@iamdeveloper.com>

* Small style mods

* Slight padding change

* Finalize new show page button design
2019-05-15 10:32:36 -04:00
Ben Halpern
166e26bdf9
Move webcomponents-loader to lib and clean out some dead code (unrelated) (#2838) 2019-05-14 22:00:46 -04:00
Benny Powers
5f9a8a7501 Add click-to-copy to article share dropdown (#1579) 2019-05-14 17:45:40 -04:00
Ben Halpern
3f7ef59d23
Fix text that says publishing for v1 (#2831)
* Fix text that says publishing for v1

* Remove currently in beta text in settings
2019-05-14 14:08:32 -04:00
Ben Halpern
ab344801db
Fix localstorage key (#2815) 2019-05-13 15:27:42 -04:00