Skip to content

Added separate ToS page (bug 1209226)#796

Merged
Nolski merged 1 commit intomozilla:masterfrom
Nolski:signing-api-agreement
Oct 6, 2015
Merged

Added separate ToS page (bug 1209226)#796
Nolski merged 1 commit intomozilla:masterfrom
Nolski:signing-api-agreement

Conversation

@Nolski
Copy link
Copy Markdown
Contributor

@Nolski Nolski commented Oct 1, 2015

Work in Progress:

Having issues with tests due to the fact that the user is populated somewhere in the unit tests which automatically causes the request to forward onto the next step (throwing assertion errors). Can't seem to figure out how to populate that request.user object.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

it looks like the only thing different here between the existing agreement page is the title, right? Can you maybe refactor them both to share a common base so there isn't any repeated content?

@kumar303
Copy link
Copy Markdown
Contributor

kumar303 commented Oct 2, 2015

r- because of missing api_key_agreement tests and also too much copy/paste of existing code

@Nolski Nolski force-pushed the signing-api-agreement branch from cfa23a6 to f1f8856 Compare October 2, 2015 20:21
@Nolski
Copy link
Copy Markdown
Contributor Author

Nolski commented Oct 2, 2015

I stubbed out the view for showing the API key but I was going to leave that for a separate PR. Everything else should be resolve aside from the one comment that I replied to.

@Nolski Nolski force-pushed the signing-api-agreement branch 3 times, most recently from 6a43fed to 7d680e8 Compare October 5, 2015 14:06
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this template isn't used anymore so it can be deleted

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.

What do you mean? All sorts of templates extend from this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I meant apps/devhub/templates/devhub/api/agreement.html - where is this used?

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.

Ah right, so here is where I don't understand the UX of the current flow. Here is what happens in our hypothetical flow.

  1. User logs into AMO
  2. User clicks nav link to generate API key
  3. User is redirected to this page
    screen shot 2015-10-05 at 4 02 56 pm
  4. User accepts and is sent to actual API page

Now the issue here is that the page shown has nothing to do with API keys. it has a side bar that has a whole bunch of steps, none of which mean anything to someone trying to reach the API page. I must have missed this back in my last commit but this is why I suggested having a separate page for accepting the license.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks, this is fixed now

@kumar303
Copy link
Copy Markdown
Contributor

kumar303 commented Oct 5, 2015

r- for some fixups needed to the test logic. Let me know if you get stuck or have questions.

@Nolski Nolski force-pushed the signing-api-agreement branch from ee71366 to 5f21905 Compare October 5, 2015 21:04
Comment thread apps/devhub/views.py Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this still looks like unnecessary copy/paste to me. Why not just add the template as a parameter to submit()?

def api_key_agreement(request):
    return submit(request, next_step=..., 
                  template='devhub/api/agreement.html')

@Nolski Nolski force-pushed the signing-api-agreement branch from b3f1c97 to acc218d Compare October 5, 2015 22:07
Comment thread apps/devhub/tests/test_views.py Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can't you just take off the follow argument and test it more directly?

response = self.client.get(reverse('devhub.submit.1'))
self.assertRedirects(response, reverse('devhub.submit.2'))

@kumar303
Copy link
Copy Markdown
Contributor

kumar303 commented Oct 5, 2015

The redirect chain test looks a little fragile so I offered a solution for that. Otherwise, r+ on the latest changes. Thanks!

@Nolski Nolski force-pushed the signing-api-agreement branch from acc218d to 86f574a Compare October 6, 2015 01:03
Nolski added a commit that referenced this pull request Oct 6, 2015
Added separate ToS page (bug 1209226)
@Nolski Nolski merged commit e2a337a into mozilla:master Oct 6, 2015
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.

3 participants