Skip to content

Prevent UI popping during subscription process - #818

Closed
begedin wants to merge 2 commits into
developfrom
811-prevent-ui-popping-during-subscription-process
Closed

Prevent UI popping during subscription process#818
begedin wants to merge 2 commits into
developfrom
811-prevent-ui-popping-during-subscription-process

Conversation

@begedin

@begedin begedin commented Dec 1, 2016

Copy link
Copy Markdown
Contributor

What's in this PR?

Closes #811

This makes it so while anything is happening in the background on the donate page, both the card form and the card item display are replaced by a "Processing..." indicator, which includes a loading spinner.

Since the change eliminates the need for some logic in the credit-card component (namely, the busy state), commit 260044f also removes all of that code.

If this behavior is not an acceptable solution, the only alternative I can think of is to show the form until the whole process is done, provided the form was there at the start, or show the card item until the process is done, provided the card item was there to begin with.

The problem with that is, it would significantly complicate the logic. In order to achieve that, we should

  • revert 260044f
  • remove the isBusy wrapping from the template
  • on templates/project/donate, replace {{#donation/donation-container card=user.stripePlatformCardwith just card=card
  • in routes/project/donate, add a model hook that explicitly loads the project and the user's card. Then add a setupController hook that sets the two properties on the controller. That way, the card wont be set automatically and the UI wont switch from the form to the card half-way through.

If the current solution is acceptable, finalizing this PR is a matter of setting the right style (in case the current spinner with "Processing..." is not good).

If the proposed alternative is the way to go, then the process id described above. I don't think it would break any tests to do it that way, but as explained, it slightly complicates things.

@begedin begedin added this to the Improve Donations milestone Dec 1, 2016
@begedin begedin changed the title 811 prevent ui popping during subscription process Prevent ui popping during subscription process Dec 1, 2016
@begedin begedin changed the title Prevent ui popping during subscription process Prevent UI popping during subscription process Dec 1, 2016

actions: {
submit() {
this.set('isSubmitting', true);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This was actually useless property we don't need anymore, so I would keep this one change in no matter what.

@joshsmith

Copy link
Copy Markdown
Contributor

We can fix this by simply doing:

{{#if (and card (not isBusy))}}

Will need to install this https://github.com/jmurphyau/ember-truth-helpers

@joshsmith joshsmith closed this Dec 1, 2016
@joshsmith
joshsmith deleted the 811-prevent-ui-popping-during-subscription-process branch December 1, 2016 21:12
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.

2 participants