Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First pass at Coupon support #1006

Merged
merged 5 commits into from
Sep 23, 2022
Merged

First pass at Coupon support #1006

merged 5 commits into from
Sep 23, 2022

Conversation

hardillb
Copy link
Contributor

http://forge.example.com/account/create?code=[CouponCode]

Sets the ff_coupon cookie with a week long life

closes #978

@hardillb
Copy link
Contributor Author

OK, works, but might want a little UI polishing, I've picked what I think are the right classes, but the spacing might be a little off

@hardillb hardillb marked this pull request as ready for review September 22, 2022 09:27
@hardillb hardillb self-assigned this Sep 22, 2022
@hardillb hardillb added this to the 0.10 milestone Sep 22, 2022
Copy link
Member

@knolleary knolleary left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple initial comments without looking at the visuals of it.

frontend/src/pages/team/Billing.vue Outdated Show resolved Hide resolved
if (err.response.status === 404) {
// check for 402 and redirect if 402 returned
if (err.response.status === 402) {
this.coupon = (await window.cookieStore.get('ff_coupon'))?.value.split('.')[0]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

window.cookieStore is not supported widely enough for us to use - https://developer.mozilla.org/en-US/docs/Web/API/CookieStore#browser_compatibility

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, will have to write a function to work with document.cookie - https://www.w3schools.com/js/js_cookies.asp

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed update without window.cookieStore

hardillb and others added 2 commits September 22, 2022 14:01
Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
Should now work everywhere
Co-authored-by: Nick O'Leary <nick.oleary@gmail.com>
@knolleary knolleary merged commit f5561f1 into main Sep 23, 2022
@knolleary knolleary deleted the signup-coupon branch September 23, 2022 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Coupon Codes in Signup Links
3 participants