-
Notifications
You must be signed in to change notification settings - Fork 612
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
card add #1373
card add #1373
Conversation
Autotagging @bigcommerce/storefront-team @davidchin |
Hey @junedkazi , this is code the for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey man, looks good for the most part!
I'm a little concerned about the way we have to map data before posting to bigpay, It would be really nice if we could find a better solution.
Would you be able to have a look as well please, @junedkazi @jackosaurus
assets/js/theme/account.js
Outdated
case 'FormField[2][5]': | ||
refObj.last_name = item.value; | ||
break; | ||
case 'FormField[2][6]': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would really like to avoid doing this if we can help it.
Is there a way that we can either:
- Build the form manually
- Get the backend to send proper
names
over the wire so we can avoid or simplify this mapping?
🍹
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree we need a better way of building these switch cases instead of relying on numeric keys.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @junedkazi @danieldelcore , the best alternative will be to create those input fields manually so I have a better control of the form names.
@@ -8,6 +8,7 @@ | |||
"dependencies": { | |||
"@bigcommerce/stencil-utils": "^1.1.2", | |||
"babel-polyfill": "^6.26.0", | |||
"creditcards": "^3.0.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No package lock file please.
@@ -201,6 +208,103 @@ export default class Account extends PageManager { | |||
}); | |||
} | |||
|
|||
initPaymentMethodFormValidation($paymentMethodForm) { | |||
// Inject validations into form fields before validation runs | |||
$paymentMethodForm.find('#first_name.form-field').attr('data-validation', `{ "type": "singleline", "label": "${this.context.firstNameLabel}", "required": true, "maxlength": 0 }`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @junedkazi , we have removed the dynamic input fields for the static components. however, I had to inject the validation through javascript because it was breaking the template engine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, looks good to me!
Thanks for all of the input @junedkazi @jackosaurus
What?
Add payment method.
lock.svg
.Tickets
Screenshots (if appropriate)
Desktop
![screen shot 2018-10-26 at 2 21 57 pm](https://user-images.githubusercontent.com/2579218/47542776-b39c0300-d92a-11e8-8627-c6b0b4455e2f.png)
Mobile
![screen shot 2018-10-26 at 2 22 28 pm](https://user-images.githubusercontent.com/2579218/47542785-ba2a7a80-d92a-11e8-8c3f-4b5242a23aa7.png)