Commit graph

54 commits

Author SHA1 Message Date
Juliano Pereira Lima
18531f34cd
Refactor listings/listings.jsx (#6992) 2020-05-11 14:42:55 -04:00
Maja Komel
f210ef9f67
[deploy] Remove correct tag when deselecting on listings page (#7530) 2020-04-28 18:27:58 -04:00
Sai Bhargav
2d20d67594
[deploy] Fix listing tags bug (#7533)
* Fix listing tags bug

* Fix failing specs

* Fix failing specs

* Fix failig spec

* Fix failing specs

* Refactor code

* Fix failing specs

* Support AND/OR queries based on params

* Add tag_boolean to search params
2020-04-28 16:04:09 +02:00
Sujith
28d24854c6
Modal not closing while choosing tag filter (#7497)
* modal not closing while choosing tag filter

Modal did not close upon choosing the filter tag.

* improved if condition  referring codeclimate

refactored if condition by declaring a static array list for checking target id exist in the array list

* removed unwanted function

Removing a function added by me
2020-04-26 12:55:34 +02:00
Michael Kohl
9df68f3920
Use new classified listing categories (#7250)
* Add ClassifiedListingCategoryModel

* Add data update script for classified listing categories

* Refactor and fix specs

* Resolve conflict

* Incorporate PR feedback
2020-04-23 10:06:58 +07:00
Michael Kohl
2d2cc65465
Use correct attribute for rendering tags in listings (#6741) [deploy]
* Use correct attribute for rendering tags in listings

* Update test
2020-03-21 11:46:23 +01:00
Nick Taylor
ccf7e6e5bf
Upgrade to webpacker/webpack 4 and Babel 7 (#6664)
Upgraded to webpacker 4/webpack 4 and Babel 7
2020-03-17 08:20:36 -04:00
Gonzalo Ricco
c8be3f4cc1
Keep old listings visible until the new ones populated (#6577) 2020-03-11 16:53:53 +01:00
Juan Vasquez
d461d83540
Fixed listings/dashboard/rowElements/location.jsx eslint error (#6491)
* Fixed listings/dashboard/rowElements/location.jsx eslint error

* Update app/javascript/listings/dashboard/rowElements/location.jsx

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

Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
2020-03-09 17:39:22 -04:00
Vaidehi Joshi
a66dc2693a
Refactor debounce usage into debounceAction util (#6506)
* Refactor debounce usage into debounceAction util

* Allow debounceAction's config to be merged, allow for named arguments

Also clean up the documentation as necessary!
2020-03-09 17:38:39 -04:00
Alex
832f59ff6d
Search ClassifiedListings frontend code (#6372) [deploy]
* Add /search/classified_listings route

* Add classified_listings search controller action

* Add spec for /search/classified_listings request

* Begin implementing frontend code

* Add debounce to classified_listings search

* before_action to format page & per_page as Integer

* Use new fetchSearch helper to fix codeclimate

* Refactor to reduce listingSearch function length

* Refactor into separate updateListings function

* Move updateListings function outside class

* Move page size to constant

* Add brackets to conditionals

* Add comment for tags param

* Add JS doc

* Move params logic/cleanup to search_controller

* Move listingIDs to const

* Rename remove_blank_params & move to before_action
2020-03-03 14:13:40 -08:00
Zachary Dixon
cf2af6c2dc
Add dropdown menu to listings (#4184) [deploy]
* Resolves 2826, add dropdown menu to listings

* Fixed dropdown position

* Refactored single listing

* Revert schema.rb to master

* Fixed tests
2020-02-18 18:08:39 -05:00
Bolarinwa Balogun
54d8762af2 Chat: Remove Report Button from user's own profile sidebar (#4604) [deploy]
* Remove Report Button from user's own profile sidebar

* Update UserDetails test file to include window

* Uncomment code and Add tests

* Resolve issue with display property change persisting

* Update snapshot

* Uncomment line of code
2019-12-02 16:35:47 -05:00
Mike Rogers
39a774dc98 Listings Page: Adding spacing around the word must (#4732) 2019-11-06 10:26:15 -05:00
Morgan Adams
c986e02044 fix 'Contact via Connect' checkbox to be checkable (#4617) 2019-11-01 16:50:23 -04:00
Nick Taylor
68e94f524b Refactored to use a common <OrganizationPicker /> component (#4470)
* Refactored to use a common <OrganizationPicker /> component.

* Small refactor to organization <option />s.

* Renamed files from OrgSettings* to OrganizationPicker*

* Brought orgsettings inline to article form.

* Brought orgsettings inline to listings form.

* Rename onBlur to onToggle for org picker instances. Ooops.

* Updated <OrganizationPicker /> test.
2019-10-24 17:27:16 -04:00
José Chaves Neto
9e6c64fa83 Fix eslint errors in listings/elements/title.jsx (#4496) [ci skip] 2019-10-23 14:21:47 -04:00
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
Nick Taylor
30cc799240 Mini refactor to make var names clearer. (#4257) 2019-10-06 17:04:14 -04:00
Mario See
3e23b3d568 Limit listing's permitted markdown tags (#3882) 2019-09-25 12:43:29 -04:00
Jacob Herrington
7198a72953 Refactor tags components (#3895) [ci skip] 2019-09-20 10:18:44 -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
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
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
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
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
Ben Halpern
47eaa9ece1
Adjust listings social image and add "About Listings" button to show page. (#3468)
* Adjust size and contrast for listings social preview

* Add about listings button and modify listings css
2019-07-12 16:40:39 -04:00
Mario See
1fcd6bb77b Fix location link in listing (#3464) 2019-07-12 13:02:12 -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
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
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
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
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
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
Mohammadjavad Raadi
2e8eda4974 Fixes Listing Items Spacing Inconsistency and Content Overflow Issue #2846 (#3011) 2019-05-31 09:02:32 -04:00
Ben Halpern
995d4eb1e2
Add pagination to listings (#2775) 2019-05-09 14:58:26 -04:00
derekenos
5f63a7d253 Enable Escape key to close opened listing modal (#2768) 2019-05-09 14:21:35 -04:00
Andy Zhao
bb75ee3fc6 WIP Add proper error handling when creating a listing (#2755)
* Add proper error handling when creating a listing

* Remove accidentally committed stylesheet

* Make error text

* Preserve input values if the submission is invalid
2019-05-07 18:25:25 -04:00
Andy Zhao
b33b59ec96 Remove listings' body_markdown's line-breaks (#2742) 2019-05-07 14:54:49 -04:00
Ben Halpern
35fe810b51
Add default tags for listings dropdown and misc other changes (#2719) 2019-05-06 14:52:52 -04:00
Ben Halpern
9e7dbf8356
Update JS listings form and other tweaks (#2697) 2019-05-05 10:14:07 -04:00
Andy Zhao
e9b4b4b8c8 WIP Add modal for single listings (#2688)
* Add new line at the bottom of the file

* Fix some linter errors

* Add overlay and links to single listings

* Clean up some code

* Add escape key functionality to quit overlay

* Lint some code

* Add modal functionality

* Update styling for modal

* Fix some linter warnings

* Preserve the correct link all the time
2019-05-04 19:39:49 -04:00
Jess Lee
a6d92c702b Add report abuse link to listings (#2684)
* add report abuse link

* add listings category on abuse form

* include listings category
2019-05-04 09:06:42 -04:00
Andy Zhao
5f74ccb01e Make "create listing" button work with InstantClick (#2676)
* Make create listing work with instantclick

* Prevent autocomplete from extensions
2019-05-03 11:33:16 -04:00
Andy Zhao
07796e769a Move new listing form to Preact (#2674)
* Fix typo

* Use preact for new listing form

* Send proper max tag amount in error msg

* Add styles back in for edit page
2019-05-03 10:17:12 -04:00