Commit Graph

124 Commits

Author SHA1 Message Date
Nicholas Staples
a9fead0d82 Merge with master. 2016-01-19 09:49:01 +00:00
Nicholas Staples
609f5f0a8d Working service integration. 2016-01-18 17:35:28 +00:00
Nicholas Staples
6e19dd7c9c Added choose_service using services_dao. 2016-01-18 16:01:04 +00:00
Nicholas Staples
a09ac6cbf5 Added choose_service using services_dao. 2016-01-18 11:15:14 +00:00
Chris Hill-Scott
81d4230b61 Page for adding a new service
This page is exactly the same as the page for adding your first service, save
the heading text.

So all this commit does is:
- set up two routes (`/add-service`, `/add-service/first`) for each of the two
  journeys and change the existing journeys to use the `/add-service/first`
  route
- add logic to show different heading text depending on the journey
- add a link to the new (`/add-service`) route in the service chooser dropdown
2016-01-18 11:03:25 +00:00
Chris Hill-Scott
f3459847f1 Move view function into own file, add test 2016-01-16 12:31:01 +00:00
Nicholas Staples
4e2019c949 Work in progress, all tests passing and implemented mocks for services_dao. 2016-01-15 17:46:09 +00:00
Nicholas Staples
262bbbac45 Test add service completed. 2016-01-15 16:10:24 +00:00
Nicholas Staples
3b1d521c10 Tests added for dao. 2016-01-15 15:15:35 +00:00
Adam Shimali
494e49ee45 Changed flow to upload directly to s3 if non empty file.
Then on check page file read back from s3 and checked.
2016-01-14 16:07:06 +00:00
Nicholas Staples
d42ee85f93 Added new notification-python-client removed check on old one, fixed tests, live service will be broken. 2016-01-14 14:55:07 +00:00
Chris Hill-Scott
54b66c5947 Merge pull request #77 from alphagov/manage-templates-page
Manage templates page
2016-01-14 14:11:30 +00:00
Chris Hill-Scott
9f3621b75e Use url_for to generate URLs
> it is about consistency and updates, if that endpoint changes in the future
> we don't have to update hundreds of tests for a specific string. The actual
> url should be ambiguous we are testing a view endpoint.
2016-01-14 14:03:27 +00:00
NIcholas Staples
96f7034ed3 Merge pull request #73 from alphagov/choose-service-page
Add page to choose services
2016-01-14 11:35:48 +00:00
Chris Hill-Scott
0a46a10316 Use url_for to generate URLs
> it is about consistency and updates, if that endpoint changes in the future
> we don't have to update hundreds of tests for a specific string. The actual
> url should be ambiguous we are testing a view endpoint.
2016-01-14 11:30:33 +00:00
Chris Hill-Scott
1e0f5c27b9 Add link to delete a template
This is a link not a button because:
- it’s less prominent—delete is an infrequent action
- it’s a two-step process, and only the second part changes any data (so it has
  a button)
2016-01-14 10:59:51 +00:00
Chris Hill-Scott
58317afdf1 Add page to choose services
Because a user can have multiple services, they need a way to navigate between
them. Normally they can use the ▶ Switcher to do this, except when:

- they first sign in
- they are on a page which isn’t associated with a service (eg user profile) in
  which case we can’t use the switcher because it won’t know what the ‘current’
  service is

So this commit adds a new page with a (fake) list of services.
2016-01-14 09:55:40 +00:00
Adam Shimali
2f802e3183 Tests pass locally and fail on travis. This is attempt to improve situation 2016-01-13 22:54:11 +00:00
Adam Shimali
6c688a3257 fix pep8 error 2016-01-13 22:39:44 +00:00
Adam Shimali
c729f0a29f fix up tests 2016-01-13 22:34:36 +00:00
Adam Shimali
4dcb180da1 Changed page flow to first save file and then redirect to check.
On check numbers in file are validated.

Posting to check then uploads file to s3
2016-01-13 17:32:40 +00:00
Chris Hill-Scott
de1c0e36c8 Add /services prefix to all service-related URLs
The URLs will be easier to parse if the parts are clearly labelled.

This is a precursor to making a blueprint for all service-related URLs.
2016-01-13 13:25:06 +00:00
Chris Hill-Scott
b4a8c2732d Add stubbed job_id
So that we can get a better sense of what the URLs look like.

Leaving unsigned for now because we don’t know if the ID will be a string or int
or…
2016-01-13 13:25:06 +00:00
Chris Hill-Scott
04b9c120d4 Add mocked service ID to all service-specific pages 2016-01-13 12:44:12 +00:00
NIcholas Staples
a469cf6bcf Merge pull request #70 from alphagov/mobile-number-validation
Mobile number validation
2016-01-13 11:48:02 +00:00
NIcholas Staples
a23017e3f5 Merge pull request #71 from alphagov/csp-fonts
Add content security policy directive to allow loading of base64 encoded
2016-01-13 10:55:42 +00:00
Adam Shimali
9ce46c19cb Add content security policy directive to allow loading of base64 encoded
fonts.
2016-01-13 10:37:34 +00:00
Chris Hill-Scott
aa43bd9e75 Add the new field to the application
This commit replaces the previous `StringField` used for collecting mobile
phone numbers with the `UKMobileNumber` field.

This means changing a few of the preexisting tests to have more realistic mobile
numbers so that they still pass.
2016-01-13 09:43:32 +00:00
Chris Hill-Scott
791324588b Test for specific error messages
This commit:
- improves the tests to check for specific error messages, rather than just
  pass/fail
- makes the error messages more human, and more suggestive of what the user
  needs to do to fix the error
2016-01-13 09:43:32 +00:00
Chris Hill-Scott
faa3b9ca7c Add form field for a UK mobile phone number
This field does two things:
- validates the format of the phone number
- outputs a consistent representation of the phone number

Because of this I think it’s better represented as a new field type, rather
than individual validators.

I also think that it’s better to do this without regular expression(s), because
it makes returning the specific error easier.

This commit also adds basic pass/fail test for a series of valid/invalid
phone numbers.
2016-01-13 09:42:37 +00:00
Chris Hill-Scott
c94ac4266c Add confirmation of password for important changes
This commit adds an extra page or field for confirming your current password
when making important changes

Name                 | Email address     | Mobile number     | Password
---------------------|-------------------|-------------------|------------
No password required | As second page    | As second page    | On same page as new password
2016-01-12 15:30:18 +00:00
Chris Hill-Scott
df79dc69f6 Add loops for changing each part of your profile
This commit adds a page or series of pages for changing your:

Name              | Email address     | Mobile number     | Password
------------------|-------------------|-------------------|------------
Enter new value   | Enter new value   | Enter new value   | Enter new value
                  | Enter 2fa code    | Enter 2fa code    |
Return to profile | Return to profile | Return to profile | Return to profile

(each row is a page)
2016-01-12 15:30:18 +00:00
Chris Hill-Scott
ba50f132fc Add table to user profile page 2016-01-12 15:30:18 +00:00
Chris Hill-Scott
10af2bccf7 Extract user profile route into its own file 2016-01-12 15:30:18 +00:00
Adam Shimali
03c7d7a0ff Merge pull request #63 from alphagov/require_login
Add login_required for all endpoints where it makes sense.
2016-01-12 11:54:33 +00:00
Rebecca Law
3eefce56d4 Add login_required for all endpoints where it makes sense.
https://www.pivotaltracker.com/story/show/111240834
2016-01-12 11:26:28 +00:00
Adam Shimali
886d0c8c95 Added content security policy header.
unsafe-inline exception added to allow inline js scripts
we have in base govuk_template.
2016-01-12 11:08:10 +00:00
Adam Shimali
bfd7291426 resolve merge conflicts 2016-01-12 10:43:23 +00:00
Rebecca Law
05695a1c03 Updated generate_token to use encrypt the entire url.
Created notify_client.sender to hold the methods to send notifications.
2016-01-11 15:18:37 +00:00
Adam Shimali
584533eb11 First slice of csv upload of phone numbers for sending messages.
At the moment the file contents are not persisted by checked in
memory.

The first and last three records are show if all are valid.

If there are invalid rows, they are reported and the user is
prompted to go back and sort out upload file.

The storing of upload result (i.e. validation of file) in session
will be removed in next story which is about persisting of file
for later processing.
2016-01-11 15:00:51 +00:00
Chris Hill-Scott
b303e06ca0 Add a styleguide page
There are now quite a few frontend components in the app.

It’s good to have a reference for them to:
- document for developers what patterns are available and how they are used
- check for regressions
  - when working on one variation of a pattern you can check that your changes
    don’t break other variations of it
  - when changing the arguments to a pattern you can check that this doesn’t
    change the expected arguments already in use

This commit adds a single page (`/_styleguide`) which has examples of all the
patterns.
2016-01-11 14:27:31 +00:00
Rebecca Law
bb1db0c345 When the user request a reset password link, the user.state is set to request_password_reset.
Which means the user will only be able to reset their password, and not sign-in.
Once the user resets the password the user state is set to active once more.
If the link is used a second time they will be redirected to the index page with a message
that the link in the email is not longer valid.
2016-01-11 12:23:08 +00:00
Rebecca Law
f7373ee5fc Fix wording
Changed forgot-password so that it does not expose to the user that the email address does not exist.
2016-01-11 12:23:08 +00:00
Rebecca Law
c858869a52 Removed exceptions, found a better way to handle them.
Refactored the forms so that fields like email_address can be used in multiple forms.
Refactored form validation so that a query function is passed into the form to be run, this
way the form is not exposed to the dao layer and the query is more efficient.

This PR still requires some frontend attention. Will work with Chris to update the templates.
2016-01-11 12:23:08 +00:00
Rebecca Law
ceb78f49b4 Take out the Canadian politeness.
Make the error message more consistent.
Extracted common fields for the forms.
2016-01-11 12:23:08 +00:00
Rebecca Law
f951b364ac Actually use the mock in the test 2016-01-11 12:23:07 +00:00
Rebecca Law
eb78a77808 Added the mock for the admin_api_client 2016-01-11 12:23:07 +00:00
Rebecca Law
35619553c8 Added NoDataFoundException 2016-01-11 12:23:07 +00:00
Rebecca Law
a860f713d2 Implementation of the new_password endpoint.
Found a way to create the token that does not need to persist it to the database.
This requires proper error messages, written by people who speak menglis good.
2016-01-11 12:23:07 +00:00
Rebecca Law
b5901a1ac7 New-password endpoints are implemented.
There should be a better way to validate the token.
2016-01-11 12:23:07 +00:00