-
Couldn't load subscription status.
- Fork 1.8k
feat: Create user payment information form #3215
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
feat: Create user payment information form #3215
Conversation
|
@mariobehling I will be providing the related tests in a follow-up PR because this one's already pertaining to >150 lines changed. |
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.
store, session, authManager are injected into each and every template. Therefore, you can use it in any template. No need of returning it from any model :)
|
@mrsaicharan1 @niranjan94 I have updated it according to the requirements. Please take a look. |
|
|
||
| export default Controller.extend({ | ||
| user: computed(function() { | ||
| return this.authManager.currentUser; |
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.
Use it directly ... No computed property needed
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.
@niranjan94 I am now calling it directly using user : this.authManager.currentUser but it threw the following error
payment-info.js:8 Uncaught (in promise) TypeError: Cannot read property 'authManager' of undefined
at Module.callback (payment-info.js:8)
at Module.exports (loader.js:106)
at requireModule (loader.js:27)
at Class._extractDefaultExport (index.js:394)
at Class.resolveOther (index.js:114)
at Class.superWrapper [as resolveOther] (utils.js:366)
at Class.resolveController (globals-resolver.js:293)
at Class.resolve (globals-resolver.js:140)
at _resolve (container.js:1210)
at Registry.resolve (container.js:749)
That's why I used a computed property 😅 .
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.
@uds5501 where exactly did you call it from ? Could you push the related code ?
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.
@niranjan94 I was calling this initially in app/controllers/account/billing-info/payment-info.js and then in the app/components/forms/user-payment-info-form.js . But now I am using intermediate element (made by a computed property) so I don't think this will be relevant
a5cb035 to
73e8c4c
Compare
cbc9478 to
c242658
Compare
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.
- create the intermediate object at the time of component creation. (not as a computed property)
- let all edits in the component edit the intermediate object.
- at the time of save, update the actual user object with values from the intermediate object and save.
- if the save fails for some reason, revert all changes in the main user object. (but keep in intermediate)
--
Also, two minor things.
- Just use a plain js object. an ember object is not needed for this.
- Call it userBillingInfo or something more related to it.
7208562 to
e36a809
Compare
9c720e6 to
db2f6f8
Compare
8bd573f to
e893f16
Compare
9e5b0af to
6d40ea7
Compare
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.
- Please change /account/billing-info/payment-info to /account/billing/payment-info
- Actually we also need form fields for
- Country*
- State
466bb76 to
97984e8
Compare
|
@niranjan94 @CosmicCoder96 Please check |
| } | ||
|
|
||
| @action | ||
| submit() { |
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.
Show a loading UI..
- Either Add a loading icon to the button and disable the button during submit
- Or show the loading UI over the entire form
See others forms and stick to something that is similar to the others
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.
Okay, I used the existing loading UI being used in the other forms.
7eaed74 to
0dde487
Compare
0dde487 to
ae50f4d
Compare
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.
LGTM.
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.
Just the rebase the commits & this is GTG.
Fixes #3214
Short description of what this resolves:
Creates an organizer billing information form as the front end follow up for fossasia/open-event-server#6103
Changes proposed in this pull request:
Checklist
developmentbranch.A sample :
(updated)