Commit Graph

173 Commits

Author SHA1 Message Date
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
Rebecca Law
90fca93308 Implementation of api key pages.
Revoke page will show the correct key name
Show api keys shows a well formatted expiry date
Fix tests for api key endpoints.
2016-01-21 12:28:05 +00:00
Adam Shimali
ee23df2c73 some tests fixed 2016-01-21 12:12:06 +00:00
Adam Shimali
856b6adb56 First slice full sign in flow 2016-01-21 11:33:53 +00:00
Rebecca Law
41c775cd68 Created api_key_api_client.
Implementation of create, revoke and show api keys for service.
These calls work, however we still need to fix the tests.
2016-01-20 17:32:55 +00:00
Adam Shimali
4e28410794 Temporarily comment out tests that are timing out until mocking sorted 2016-01-20 17:24:17 +00:00
Adam Shimali
7af53761d9 fixed some mocks in test 2016-01-20 16:36:06 +00:00
Chris Hill-Scott
9784a9936c Add pages for create/view/revoke API keys
Copying what they’ve done on GOV.UK Pay, we should let users:
- generate as many keys as they want
- only see the key at time of creation
- give keys a name
- revoke any key at any time (this should be a one way operation)

And based on discussions with @minglis and @servingUpAces, the keys should be
used in conjunction with some kind of service ID, which gets encrypted with the
key. In other words the secret itself never gets sent over the wire.

This commit adds the UI (but not the underlying API integration) for doing the
above.
2016-01-20 16:22:23 +00:00
Adam Shimali
fcedae5fe1 Merge conflicts and test fixes 2016-01-20 15:40:06 +00:00
Adam Shimali
ca3d3240a6 Verify activate and login user with sms and email code 2016-01-20 15:34:42 +00:00
Nicholas Staples
75d7110642 Updated to send email through the client send_email. 2016-01-20 14:45:50 +00:00
Adam Shimali
422b1fb5c2 uncomment accidentally commented out tests 2016-01-20 09:43:38 +00:00
Adam Shimali
b5cdf86b40 User registration now creates user via api.
Verification flow is still to be completed.

Foreign key constraint on verify codes to user table removed.
2016-01-19 22:49:46 +00:00
Nicholas Staples
f6f4fe15b2 Merge with master. 2016-01-19 16:35:52 +00:00
Adam Shimali
c86b53f7f1 Add user via api
Leave original user object in for this slice. Remove on next
2016-01-19 16:07:44 +00:00
Nicholas Staples
cfb3f96b01 Mapped template actions to the api and mocked tests. 2016-01-19 15:54:12 +00:00
Chris Hill-Scott
ba0c9ac6c1 Remove placeholder logs of notifications sent
From the:
- dashboard
- activity page

This info will be confusing for users at the hack day, because it will say
they’ve already sent messages when they first sign up.

This involved changing the table macro to have a nice ‘no rows’ message.
2016-01-19 12:04:18 +00:00
Nicholas Staples
a9fead0d82 Merge with master. 2016-01-19 09:49:01 +00:00