Commit Graph

404 Commits

Author SHA1 Message Date
Penar Musaraj 550e8347e3
DEV: Refactor bootbox dialogs (#137) 2022-10-17 14:42:40 -04:00
Bianca Nenciu c00e539304
UX: Make styling consistent with everything else (#134) 2022-10-03 16:14:32 +03:00
Angus McLeod aba86e5e25
FIX: Promo code placeholder (#133) 2022-09-23 10:37:28 +02:00
Penar Musaraj 39b7253c08
DEV: Refactor payment plan buttons (#131) 2022-09-14 18:32:22 -04:00
Blake Erickson a78b92ddcc
FEATURE: Add quick access button to user profile dropdown (#130) 2022-08-10 13:05:54 +01:00
Faizaan Gagan 945af4f140
FIX: Allow user to update card details for recurring subscriptions (#123)
* add new route for card update

* create backend route

* update label

* basic functionality working

* ran rubocop

* added rspec tests for functionality

* make payment_method param compulsory

* fixed js linting

* improve client side error handling

* improve server side error handling

* improved update card page UI

* improve button UI for user subscriptions page

* give feedback to user about save status

* remove heading from last column

* fix padding on edit/delete buttons for update table

Co-authored-by: Blake Erickson <o.blakeerickson@gmail.com>
2022-07-05 19:53:27 -06:00
David Taylor d4d92d9653
DEV: Use closure actions (#127) 2022-07-06 00:20:12 +01:00
Faizaan Gagan 392b88265b
FIX: set Discourse consistent styles on Stripe card element (#124)
* FIX: set Discourse consistent styles on Stripe card element

* use correct placeholder color

* applied prettier

* mock update method for cardElement

* minor formatting
2022-06-24 21:18:38 +05:30
discoursebot 9a9b5a79c1
DEV: Update CI setup and fix linting issues (#119)
* DEV: Update CI workflows
* DEV: Update deps
* DEV: Fix template linting

Co-authored-by: discoursebuild <build@discourse.org>
Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2022-06-11 12:54:30 +02:00
Jarek Radosz 98c843b8f2
DEV: Fix imports (#113) 2022-03-07 00:30:01 +01:00
Jarek Radosz d6eaba632d
DEV: Lose the es6 suffix (#112) 2022-03-07 00:20:03 +01:00
David Taylor fa490337ef
FIX: Ensure sidebar class is removed when component destroyed (#111) 2022-02-28 11:51:29 +00:00
Andrei Prigorshnev 45780a1ebc
DEV: migrate routes to the new @action pattern (#102) 2022-01-06 15:32:09 +04:00
Blake Erickson afe6c10452
FIX: html strong tags showing (#97)
We need to use the `html-safe` helper here so to that the html tags in
the translation template are rendered correctly.

See: https://meta.discourse.org/t/211376
2021-12-09 13:30:45 -07:00
Martin Brennan e8621cf5d1
DEV: Update code for eslint object-shorthand-rule (#93)
See 4f7aba06c0
2021-11-10 12:00:39 +11:00
Justin DiRose 5ead25feb6
REFACTOR: Rename s to subscribe (#86) 2021-07-19 19:56:19 -05:00
Justin DiRose 6414a1f6e5
FEATURE: Show/hide campaign banner with goal status (#85) 2021-07-15 15:05:27 -05:00
Jarek Radosz 21d71e09fc
DEV: Fix linting errors (#83)
Template lint errors and broken rubocop linting.
2021-07-04 21:53:55 +02:00
Penar Musaraj 1c104da947
DEV: Use CSS custom properties for colors (#82) 2021-06-24 09:19:56 -04:00
Justin DiRose d660149ad2
UX: Hide campaign button on goal completion (#81) 2021-06-22 11:26:28 -05:00
Justin DiRose eee1adc40f
FIX: New user sessions redirected weirdly on login-required sites (#80) 2021-06-22 10:04:02 -05:00
haroldus- 0b2c8bd513
fix strong (#78) 2021-06-22 09:22:35 -05:00
Jordan Vidrine beb73b58f3
FEATURE: Add fireworks + gradient animation to campaign success banner (#77) 2021-06-21 09:01:35 -05:00
Jordan Vidrine 787c5550c6
FEATURE: Add ability to use custom background image (#76)
* FEATURE: Add ability to use custom background image

* Prettier
2021-06-18 10:20:54 -05:00
Justin DiRose 8ab7a63167
FEATURE: Validate coupon codes on form submit (#74) 2021-06-16 12:54:54 -05:00
Jordan Vidrine a4f36e4966
Campaign topic footer (#72)
* UX: Restyle banner, add topic footer functionality, other updates
2021-06-10 16:02:54 -05:00
Justin DiRose 791c7fa7a5
UX: Improve mobile campaign flow (#69)
1. Improve mobile checkout styling

These are pretty simple changes. The buttons were crammed together and not wrapping properly on mobile if there were more than a few. Also the padding was weird and causing text to overflow out of the #main-outlet on phone viewports.
2. Renders the top campaign banner on mobile even if sidebar is selected

In the original PR, we refactored using the connector JS out since we now have more Ember operators; however, we needed some more complex logic that couldn't be done in the template. Basically, we choose which outlet to render the component in based on two criteria:

    If the setting is set to sidebar or top
    If we're on a mobile device

Previously, if the site showed the banner on the sidebar and the user browsed to mobile, they wouldn't see a banner at all. This PR changes the logic to use the top outlet on mobile, even if the sidebar is selected.
2021-06-08 12:52:29 -05:00
Justin DiRose f596a0f78a
FEATURE: Campaigns (#67)
Co-authored-by: Jordan Vidrine <jordan@jordanvidrine.com>

See https://github.com/discourse/discourse-subscriptions/pull/67 for the full description.
2021-06-02 13:15:03 -05:00
Jay Pfaffman 3fb597a4cf
FIX: Don't use `Discourse` global (#66)
Discourse.SiteSettings should be this.siteSettings.
2021-05-26 21:33:31 +02:00
chalkadmin 1ae5a552a6
FEATURE: Add SGD as supported currency (#60)
Add additional currency Singapore dollars as supported Stripe currency
2021-04-13 12:20:00 +02:00
Brian Bønk 312b1182b9
FEATURE: Add DKK as supported currency 2021-04-06 09:59:27 -05:00
Justin DiRose 7f84cee940
UX: Improve usability of purchase page (#54)
Commit does 3 things:

    Remove the duplicative currency abbreviation in favor of the currency symbol alone
    Reorders plans by the cost in ascending order.
    Fixes a flexbox button bug
2021-02-16 12:07:53 -06:00
Justin DiRose 0126b12761
DEV: Remove unused CSS selector (#55) 2021-02-16 11:54:21 -06:00
Justin DiRose ab9b81471b
UX: Adjust repurchase styles to look better (#53)
Suggested here: https://meta.discourse.org/t/subscriptions-suggestions-for-interface-improvements/177970

Changes order and alignment so it makes a bit more sense in the UX of the /s route. Otherwise it looks too cluttered. This specifically impacted products that can be repurchased.
2021-02-15 15:17:45 -06:00
Justin DiRose a282475da3
FEATURE: Admin > Subscriptions Pagination (#50)
Meta topic: https://meta.discourse.org/t/subscriptions-add-pagination-to-admin-subscriptions-view/172500

This adds support for pagination using our `{{load-more}}` component in core. Implementation on the backend was a bit tricky because we don't return all results from Stripe, only those that match local subscriptions stored in the `DiscourseSubscriptions::Subscription` model.
2021-02-05 11:57:53 -06:00
Justin DiRose 072b558d40
FEATURE: Give option to repurchase products multiple times (#46)
Feature requested here: https://meta.discourse.org/t/subscriptions-allow-users-to-purchase-one-time-products-multiple-times/173732/

There may be cases where a site admin wants to allow the repurchasing of a product. This implements the functionality by adding a repurchaseable toggle in the admin screen when creating a product. This saves an attribute to the Stripe product metadata.

When a user has already purchased an item with this toggle enabled, they will be able to purchase it again when browsing to `/s`.
2021-01-31 14:17:44 -06:00
Joffrey JAFFEUX 3f8fca3246
DEV: prettier 2.2.1 (#48) 2021-01-27 10:38:33 +01:00
Justin DiRose 400313cded
FEATURE: Allow creation of coupons in admin panel (#43)
Adds full support to create coupon/promo codes in the Admin > Plugins > Subscriptions section of the plugin. The Create Coupon button opens a form on the same page, and the active checkboxes toggle the active status of the coupon code.
2021-01-13 11:47:22 -06:00
Justin DiRose da9b58398b
FEATURE: Support for coupons in checkout (#41)
This adds support for Stripe Promo Codes in the user checkout process. 

Also adds a discounted field to User > Billing > Subscriptions to show the amount or percent discounted.

This does not currently add in support for creating promo codes in the Subscriptions interface (that will come at a later point in time). Instead a coupon can be created with a promo code right from the Stripe dashboard.
2021-01-07 15:25:44 -06:00
Justin DiRose 443fdc3ec6
DEV: Transition from Ember constant to imports (#34) 2020-11-30 10:35:21 -06:00
Justin DiRose d430098bad
FIX: Properly allow no group to be selected (#33) 2020-11-24 14:52:00 -06:00
Justin DiRose be9e9c0117
FIX: Make URLs subfolder friendly (#29)
Not all URLs in Subscriptions were not subfolder install friendly. This commit uses link-to in places its needed to properly set URLs if on a subfolder install.
2020-11-02 10:20:31 -06:00
Justin DiRose b92627677f
FEATURE: Implement refunds from dashboard (#27)
An implementation of refunds from the Admin dashboard. To refund, go to Plugins > Subscriptions > Subscriptions then click the `Cancel` button. You'll be presented with a modal. If you wish to refund only the most recent payment, check the box. 

This only implements refunds for Subscriptions, not One Time Payments. One Time Payments will still need to be handled manually at this time.
2020-10-29 10:31:12 -05:00
Justin DiRose b950926538
FIX: Payments could not complete (#28)
Due to putting the Stripe Elements HTML inside an if block in the
template, this caused state to be funky. As a result, calling
`this.stripe.createToken` failed to return a promise. Opted instead to
hide the elements via CSS for anonymous users to prevent this
showstopping bug.
2020-10-29 10:21:14 -05:00
Justin DiRose 1ad5b17640
FEATURE: Better UX for anonymous users (#25)
Improves the subscription flow for anonymous users by making the routes available, and showing a login button. Clicking login from this page will save a `destination_url` cookie so that when logging in they're redirected back to the subscription page they were at.
2020-10-28 13:30:26 -05:00
Justin DiRose 3a5078ded6
REFACTOR: Simplify controller setup (#24)
The code in the plugin needed a dramatic cleanup. This refactor collapses the Plan/Product/Subscription controllers on the backend into one new controller: `SubscribeController`.

This reduces N+1 calls to the back end during the subscription process and simplifies use of the code. 

I've also removed a bunch of dead code and refactored some logic into methods for easier readability. No feature/functionality changes in this commit; only refactoring. However, refactoring will allow for implementation of better anonymous user handling, so this is largely a foundation to enable making that change.
2020-10-21 13:36:31 -05:00
Justin DiRose e13221279d
FIX: Loading state persists after bad card entered (#22)
* FIX: Loading state persists after bad card entered

If a bad card number was entered and the subscribe button clicked, the
subscription button still disappeared and subscribing was not possible
without refreshing the page.

* UX: Add missing tooltip

* DEV: Ignore gems directory for local rubocop runs
2020-10-19 20:54:30 -05:00
Faizaan Gagan 55e6accb9c
FEATURE: Markdown support for product description (#21) 2020-10-12 10:01:33 -05:00
Justin DiRose 7e753d45bd
DEV: Update to new prettier standards 2020-09-16 09:53:50 -05:00
Justin DiRose d60c5b6d54
UX: fix incorrect text on cancel button 2020-09-16 09:49:45 -05:00