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

Replace cancel account creation link on email signup screen with cancel link #1314

Merged
merged 2 commits into from
Apr 5, 2017

Conversation

el-mapache
Copy link
Contributor

Why: Although the user is technically canceling their account
creation, none of the actions in the modal make sense at this point,
since they haven't entered any information

screen shot 2017-04-04 at 9 25 22 am

**Why**: Although the user is technically canceling their account
creation, none of the actions in the modal make sense at this point,
since they hacven't entered any information
Copy link
Contributor

@jessieay jessieay left a comment

Choose a reason for hiding this comment

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

This looks great! One comment / question about whether this PR is meant to change just the email signup screen or if it is also supposed to tackle the "enter password" page

@@ -4,7 +4,7 @@
before do
user = build_stubbed(:user)
allow(view).to receive(:current_user).and_return(nil)
allow(view).to receive(:session).and_return(sign_up_init: true)
allow(view).to receive(:params).and_return(confirmation_token: 123)
Copy link
Contributor

Choose a reason for hiding this comment

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

so are we also removing the cancel modal from the "enter password" page? That isn't mentioned in the PR description but this spec change would indicate that we are?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope! The modal is still on this screen. We are just making use of the existing confirmation_token session key, rather than sign_up_init, which isn't needed anymore.

@pkarman
Copy link
Contributor

pkarman commented Apr 4, 2017

@el-mapache so this reverts part of #1255 ?

Copy link
Contributor

@pkarman pkarman left a comment

Choose a reason for hiding this comment

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

lgtm % questions

def user_signing_up?
sign_up_init? || current_user && !current_user.two_factor_enabled?
params[:confirmation_token] || (current_user && !current_user.two_factor_enabled?)
Copy link
Contributor

Choose a reason for hiding this comment

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

this seems to be the core logic change yes? everything else flows out of here.

@el-mapache
Copy link
Contributor Author

el-mapache commented Apr 4, 2017

@pkarman No, that PR specifically dealt with the Forgot Password screen, which a user would (presumably!) only be going to when they already had an account. Unless we reuse the confirmation token key for that screen, in which case we will need to keep a separate session key to flag the user as partially signed up.


expect(rendered).to have_selector("input[value='#{link}']")
expect(rendered).to have_content(link)
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think about replacing these 2 last lines with this, to test both the link text and the actual destination?

expect(rendered).to have_link(t('links.cancel'), href: root_url)

I would expect the cancel link to point to the root url, not api/saml/logout since the user is not signed in.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, I agree

@monfresh
Copy link
Contributor

monfresh commented Apr 4, 2017

Also, the PR description doesn't seem to be accurate. It says that the cancel link will be removed entirely, but it's still there, only it points somewhere else.

@pkarman
Copy link
Contributor

pkarman commented Apr 4, 2017

@el-mapache that's not how I read #1255. Many of the exact same files seem to be changing back. Don't mean to be pedantic, just trying to correlate with #1255 since that has been prioritized for the next RC fix release.

@el-mapache
Copy link
Contributor Author

el-mapache commented Apr 4, 2017

@pkarman I see, now. Yes, I'm essentially just removing sign_up_init and relying on the existing confirmation_token param. That param is present on the sign up/password page, and an extra value in the session that needed to be independently managed across multiple controllers seemed unnecessary.

Re that other PR, there are two different 'password' screens affected by it, I'll update the title to reflect that.

Many of the same files are changing back because we don't need to check for the presence of the sign_up_init key in the session. The important change in the PR you referenced is that we have some other mechanism beyond 'is this a current user' when determining what type of cancel link to show.

@monfresh
Copy link
Contributor

monfresh commented Apr 4, 2017

Can we also update this test: https://github.com/18F/identity-idp/blob/master/spec/views/sign_up/passwords/new.html.slim_spec.rb#L26-L30

to test for the href as well as the link text since that's what we're really interested in testing? Doesn't have to be in this PR. Might be good to check for other similar tests that only test for the link text and not the href.

@el-mapache
Copy link
Contributor Author

el-mapache commented Apr 4, 2017

@monfresh Sorry, I've been trying to make the titles as descriptive as possible given the character limit on the command line, but I'm not in the habit of updating them on github. I'll change it to make it clear that we are replacing one cancel link with another.

@el-mapache el-mapache changed the title Remove cancel account link on email signup screen Replace cancel account creation link on email signup screen with cancel link Apr 5, 2017
**Why**: It was still pointing at the `destroy_user_session_path`, which
was a hold over from previous behavior.
Copy link
Contributor

@monfresh monfresh left a comment

Choose a reason for hiding this comment

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

lgtm

@el-mapache el-mapache merged commit af98fd9 into master Apr 5, 2017
@el-mapache el-mapache deleted the ab-use-generic-cancel-link branch April 5, 2017 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants