Skip to content
This repository was archived by the owner on Oct 29, 2020. It is now read-only.

After Signin Modal#6515

Merged
sbsmith86 merged 14 commits intodevfrom
after-signin-modal
May 27, 2016
Merged

After Signin Modal#6515
sbsmith86 merged 14 commits intodevfrom
after-signin-modal

Conversation

@sbsmith86
Copy link
Contributor

What's this PR do?

This PR does a few things:

  • Sets up a configuration option on Custom Settings that allow admins to check if organ donation should be allowed. here
  • If that ^^ flag is turned on, after a user signs up the modal is displayed and Takeover.js injects content into the modal and handles everything from there. But we also check that the users hasn't yet submitted the registration form before deciding if we should show it or not. here
  • in Takeover.js, this PR, starts to roughly mock out how the modal will work for organ donations. We pull in some underscore templates that house the content for each "screen" in the modal. Flow is like:
    • User clicks the submit button on the first "screen"
    • We make an AJAX call to a fake endpoint.
    • If that is successful, we move to the next screen.
    • User hits the submit button there, an AJAX called is made to a custom endpoint in phoenix that stores data about the registration. see Set up organ donation module #6491

How should this be reviewed?

Pull branch down. Make sure you have the dosomething_organ_donation module turned on. Go to a campaign and turn on organ donation in the custom settings form.

Now, sign up for the campaign (preferably as a new user or anon user since that is what most of the folks will be) when you get taken to the action page, you should see the modal. And the experience should work like what is outlined above.

Any background context you want to provide?

This is not final at all, but covers the ability to show a modal after a user signs up for a campaign and allows us to start making API calls from within that modal. Please see my notes here about some of the JS and how I would like to refactor it.

Relevant tickets

Fixes #6481

@angaither @DFurnes @weerd @chloealee

* organ donation modal after signup.
*
*/
function dosomething_campaign_organ_donation_config_form($form, &$form_state, $node) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now that i'm looking at it, i feel like this admin config stuff should be housed in the dosomething_organ_donation module. But it's not a blocker for merge, I don't think...

sbsmith86 added 2 commits May 26, 2016 17:18
Refactor how we check if someone has registered so it is more readable
@sbsmith86
Copy link
Contributor Author

@angaither I moved the all the admin stuff for the organ donation configuration into the dosomething_organ_donation module and then added that helper you mentioned there as well. Then just checked if the module exists and if the user has register to determine how to set the variable. I hope the makes it a little more readable!

@DFurnes thanks for your comments! i didn't know about => syntax and it is lovely! I also addressed your other comments and will work on this further, refactoring to classes like we discussed IRL

@angaither
Copy link
Contributor

👍

@sbsmith86 sbsmith86 merged commit cc974c5 into dev May 27, 2016
@DFurnes DFurnes deleted the after-signin-modal branch May 27, 2016 14:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants