Commit Graph

190 Commits

Author SHA1 Message Date
Chris Hill-Scott
d5656a4dc2 Add mocked get_services to test_client.login
Because the redirect after logging in checks the number of services a user has,
this now needs to be mocked.

Right now this means adding `mock_get_login` to any tests that need a login.
This must be one of the first mocks, so that it can be overridden by any use
of `mock_get_services`, for tests that specifically want to rely on a quantity
of mocked services, or their contents.

This is a bit fragile, but there’s already a TODO in the code to make it better
so ¯\_(ツ)_/¯
2016-02-05 15:11:44 +00:00
Chris Hill-Scott
939954cd64 Skip ‘choose service’ page if user has one service
We used to do this by redirecting on the choose service page. However when we
lost the dropdown and this page also became the page for adding a new service
(in 3617f2e936) the redirect was removed.

This commit re-adds the redirect on the two factor page, so that it only happens
on first login.

So the flows are:

**Multiple services**
```
`Sign in` → `Enter two factor code` → `Choose service` → `Service dashboard`
```

**One service**
```
`Sign in` → `Enter two factor code` → `Service dashboard`
```

**No services (you’ve deleted all your services)**
`Sign in` → `Enter two factor code` → `Choose service` → `Add new service`
2016-02-05 14:50:55 +00:00
NIcholas Staples
7854617453 Merge pull request #155 from alphagov/fixes-to-front-end-patterns
Fixes to front end patterns
2016-02-05 11:39:46 +00:00
Chris Hill-Scott
0fc927b458 Review usage of secondary/back links
This commit examines all the pages that use the page footer component, and
determines whether they should have a back button, a secondary link, both or
neither.
2016-02-05 10:43:49 +00:00
Chris Hill-Scott
7399c3c6c0 Add a flash message to confirm sending has started 2016-02-04 15:29:36 +00:00
NIcholas Staples
cf08f4ef2a Merge pull request #150 from alphagov/send-text-flow-revised
Send text flow revised
2016-02-04 14:57:43 +00:00
Chris Hill-Scott
a7d6d85d8b Make first page of ‘send texts’ use links not form
This doesn’t need to be a form—it’s not changing any data.

And having the primary action on the page as ‘Use this template’ it makes it
clear what the page is for.
2016-02-04 14:13:57 +00:00
Adam Shimali
90a17bc0a7 Service and job id were incorrectly in bucket name. 2016-02-04 12:06:06 +00:00
Chris Hill-Scott
856296df5d Updates to display of jobs
This commit:
- adds the template to the jobs page (and puts it at the top of the send SMS
  page) so that it consistently appears in the same place throughout the
  journey
- put the real data about a job on the jobs page and on the dashboard
2016-02-04 10:59:03 +00:00
Chris Hill-Scott
3e7bb42323 Replace message previews on check page with table
The first 3/last 3 messages didn’t test well, it wasn’t immediately obvious what
was going on.

This commit replaces it with just a preview of the first message, and a table
showing the details of the subsequent messages.
2016-02-04 10:44:20 +00:00
Chris Hill-Scott
394a9db3f7 Split ‘send SMS’ page into two pages
This commit just splits the existing page into two. It doesn’t do any
substantive changes to how the two parts of the page work.
2016-02-03 11:14:20 +00:00
Chris Hill-Scott
335cc160fa Fix wording 2016-02-02 15:59:41 +00:00
Chris Hill-Scott
686c4127cd Various tweaks
- remove black border from banner
- make banners have internal columns
- make nav 2/3rd width, 19px text and more spaced out
- only show the ‘restricted mode’ banner where it’s needed
- rename ‘restricted mode’ to ‘trial mode’
2016-02-02 15:01:17 +00:00
Rebecca Law
a4cb35ad3b Update service_id to a UUID from an integer.
This commit must go along side a commit on the notifications-api app.
There will be a breif outage until both app are deployed.
2016-02-02 14:25:31 +00:00
Chris Hill-Scott
acc13feddb Add prompt to add first template to dashboard
https://www.pivotaltracker.com/story/show/112814667

> As you need to have templates to send any notifications, we should be nudging
> people to do that when they sign in.
>
> This should be in the dashboard, with a link to manage templates.
>
> Should be bright and shiny and only show if the service has no templates.

This commit adds the above.

It also rationalises the language (some places used ‘create template’, others
used ‘add template’, this changes everything to the latter).
2016-02-02 10:14:04 +00:00
Chris Hill-Scott
683f8d4161 Merge pull request #134 from alphagov/share-phone-validation
Moved mobile validation to utils module for use in csv upload as well.
2016-02-01 17:21:23 +00:00
Adam Shimali
9e8c0b8d59 Moved mobile validation to utils module for use in csv upload as well.
This could be moved to shared utils code base at some point.
2016-02-01 16:57:40 +00:00
Chris Hill-Scott
9cf6dfa6f2 Tidy up inconsistencies in forms
Wherever possible, use the macros.
2016-02-01 16:55:46 +00:00
Chris Hill-Scott
3617f2e936 Move service and user nav to proposition header
This commit moves user-related navigation into the proposition header (the black
bar) at the top of the site. It adds some custom SASS to override GOV.UK
template and align these navigation items to the right (because it looks
better).

It then removes the service chooser dropdown (and its associated SASS and JS) in
favour of a link alongside the user-related navigation items. ‘Switch service’
is the best language for this that we’ve come up with so far.

This means that the only way of adding a new service is from the `/services`
page. So this commit removes the redirect if you land on this page with only one
service (else it would prevent you from ever being able to add more).
2016-02-01 13:52:45 +00:00
Adam Shimali
b73a5d8710 Pass selected template id to api when creating job.
Moved query params for original file name and template id
to session.
2016-02-01 11:28:36 +00:00
Adam Shimali
4ea50499c3 List and individual job pages now fetch data from api.
Few bug fixes around job uuid.
2016-01-29 15:35:35 +00:00
Adam Shimali
5196436645 Better bucket name pending possible change to uuid for service primary
key.

Also small bugfix around file name and original file name
2016-01-29 12:19:50 +00:00
Adam Shimali
0995cd2e3c Uploading csv creates job via api 2016-01-29 10:30:02 +00:00
Rebecca Law
0dd20abbb3 Replace Current service with chosen service name. 2016-01-28 17:20:34 +00:00
Nicholas Staples
62150e5596 Added fixes for forms to hide potential email philshing scams. 2016-01-28 16:36:36 +00:00
Adam Shimali
91465520a0 Call to client for password check incorrectly passed user instead
of user.id
2016-01-28 12:31:24 +00:00
Nicholas Staples
ca8d78aee5 Fix for forgot my password. 2016-01-27 18:01:43 +00:00
Nicholas Staples
2d35f5f36a All tests passing and merged with master. 2016-01-27 16:30:33 +00:00
NIcholas Staples
8ff5ee9ffb Merge pull request #113 from alphagov/real-templates
Use real templates when sending text messages
2016-01-27 12:24:52 +00:00
Nicholas Staples
6959d695d3 Working tests, hopefully all code changes done. 2016-01-27 12:22:32 +00:00
Chris Hill-Scott
3a864ad132 Use real templates when sending text messages
Sets the value of `template` to the ID of the chosen template when submitting
the form.
2016-01-26 17:17:46 +00:00
Chris Hill-Scott
a6d19ff45b Show correct default state on service settings page
By default a service should be active (ie keys not suspended). For some reason
the API is returning the opposite.

This commit reverses the logic to make it look right for hack day.
2016-01-26 17:16:24 +00:00
Adam Shimali
b394a18b4e Incrementing of failed logins happens on api side 2016-01-26 12:36:05 +00:00
NIcholas Staples
d89174f322 Merge pull request #108 from alphagov/test-cleanup
Test cleanup
2016-01-26 10:53:49 +00:00
Chris Hill-Scott
46a7410839 Add test for template page repopulation
A bug was found whereby the body of a template was not being shown in the
on the page when returning to edit an existing template. This bug was caused
by renaming the field in some places, but not in the `Form` class.

This bug has since been fixed, but this commit adds a test to make sure that it
doesn’t happen again.
2016-01-25 07:20:13 +00:00
Adam Shimali
3d14296ae0 Re introduced some tests. Moved update email from db to api. 2016-01-24 15:00:50 +00:00
Adam Shimali
4674bd6b68 Reintroduce some tests. A bit of cleanup of mocks.
User object fields made a bit clearer and simple test to
verify user added.
2016-01-23 23:14:50 +00:00
Adam Shimali
ba0d0d49e1 Fixed tests 2016-01-22 19:32:08 +00:00
Adam Shimali
f8fc8e951a If user is logged in and visits / /sign-in or /register they will
be redirected to choose service.
2016-01-22 17:24:14 +00:00
Rebecca Law
6ef9becf8f Able to get services by user id 2016-01-22 16:46:59 +00:00
Nicholas Staples
96d38b8189 Added check for password on service change page, work in progress. 2016-01-22 16:34:36 +00:00
Chris Hill-Scott
396f8415c6 SKIRMISH MODE 2016-01-22 14:51:01 +00:00
Chris Hill-Scott
9ee8610da0 Rename content to template content
WTForms sets the `id` of a `textarea` element to the variable name to which the
form control is assigned.

This conflicts with the page container, which is styled by targeting `#content`.
2016-01-22 14:51:00 +00:00
Rebecca Law
61893c5c7e Validation on key name is case insenstive 2016-01-21 16:52:01 +00:00
Rebecca Law
81a5164fa5 Fix test to use mock_api_user 2016-01-21 15:56:08 +00:00
Rebecca Law
46e0e3fd1b Merge branch 'master' into api-keys-flow
Conflicts:
	tests/app/main/views/test_api_keys.py
2016-01-21 15:50:00 +00:00
Rebecca Law
e7713a8b7f Added a validator so that the key name is unique per service. 2016-01-21 14:15:36 +00:00
Rebecca Law
2b24909ca6 Fix tests for to use mock user for login 2016-01-21 12:43:11 +00:00
Rebecca Law
8737edfad1 Merge branch 'master' of github.com:alphagov/notifications-admin into api-keys-flow
Conflicts:
	tests/app/main/views/test_api_keys.py
2016-01-21 12:31:28 +00:00
Adam Shimali
167c7b0f13 Fixed some tests. Some broken mocked tests commented out until later 2016-01-21 12:31:09 +00:00