Commit Graph

7170 Commits

Author SHA1 Message Date
Leo Hemsted
a982144821 add deactivate service button on the service settings page
only visible for platform admins looking at active services.
no way to undo. no confirm button.
2016-11-02 16:53:40 +00:00
Chris Hill-Scott
ab4df96de4 Merge pull request #1007 from alphagov/terms-of-use-updates
Updated the terms of use on 2 November in line with MOU changes
2016-11-02 16:55:08 +01:00
Pete Herlihy
7fd19b3906 Updated the terms of use on 2 November in line with MOU changes 2016-11-02 15:45:19 +00:00
Leo Hemsted
e89f89bd11 remove unused delete service functionality 2016-11-02 10:29:44 +00:00
Chris Hill-Scott
c56db50ebf Add some spacing to group related items 2016-11-01 12:23:50 +00:00
Chris Hill-Scott
a455d8aad9 Add link to terms of use 2016-11-01 12:23:50 +00:00
Chris Hill-Scott
82064ca4d0 Make MOU a multiple choice question not a banner
If we want someone to read something (ie that they need to have the MOU
signed), then the best way is to make them interact with it.

And if someone doesn’t have the MOU in place, then we need to know to
send them a copy. The best way of them telling us this is in this form,
rather than sending them to the generic contact form and have them
compose a message saying ‘please send me the MOU thanks’, which we
haven’t seen anyone actually do.
2016-11-01 12:23:49 +00:00
Chris Hill-Scott
84c2fcddff Add hint text for volumes questions
We’ve had some non-helpful answers to these questions, eg ‘3’.

This commit adds examples of the kind of response we’re looking for, to
help users write good answers.
2016-11-01 12:19:50 +00:00
Chris Hill-Scott
a9b9e8978b Add some spacing
Visually separates the list from the first question in the form.
2016-11-01 11:40:08 +00:00
Chris Hill-Scott
270e3c17dd Reword questions to make sense with radio buttons 2016-11-01 11:39:57 +00:00
Chris Hill-Scott
d832a9107c Use radio buttons not textboxes for multi-choice
No need to make people type when they can click, and gives us consistent
data.
2016-11-01 11:39:22 +00:00
Leo Hemsted
93cdaf1811 allow users to see letters even if they dont have edit permissions
same way as we handle seeing emails/sms
2016-10-31 18:01:31 +00:00
Leo Hemsted
8803de2cc3 Merge pull request #1000 from alphagov/letters-flag
Letters flag
2016-10-31 16:33:12 +00:00
Chris Hill-Scott
da75dd403b Merge pull request #1004 from alphagov/utils-bump-email-newline
Bump utils
2016-10-31 16:36:29 +01:00
Leo Hemsted
96c592be10 add user permissions to the letters endpoints
you can get in with either "manage_templates" or "send_letters"

also improve running of a bunch of tests, by parametrising rather than
looping and by cleaning up some mock imports
2016-10-31 14:43:40 +00:00
Leo Hemsted
e0fcb79b9b Merge branch 'master' of github.com:alphagov/notifications-admin into letters-flag 2016-10-31 14:04:05 +00:00
Chris Hill-Scott
2c6ab4756f Bump utils
Includes:
- [ ] https://github.com/alphagov/notifications-utils/pull/75
2016-10-31 09:19:53 +00:00
Chris Hill-Scott
3761a7a436 If possible, show sent not uploaded time for jobs
If you’re looking back at a job that was scheduled and has now been sent
it’s more useful and consistent to know what time it went out. The time
it was uploaded at is a bit arbitrary once it’s sent.

The only time the uploaded time is relevant is when the job is still
waiting to be sent.

Slightly fiddlier than it sounds because we never want to show
‘uploaded by’ for a job that hasn’t been scheduled because it almost
immediately changes to ‘sent by’. This flickering of the UI is
undesirable.
2016-10-31 09:14:05 +00:00
Chris Hill-Scott
4b0d8ec636 Use days of week, not month for scheduled jobs
Friday at 4pm is easier to understand than 14 October at 4pm, especially
when the UI you’ve used to choose this time has talked about days of the
week.
2016-10-31 09:14:05 +00:00
Chris Hill-Scott
103e09e3a0 Make the UI more performant by not reflowing
Fixes the height of the component until it’s loaded so that it doesn’t
causes the page to reflow while it’s rendering the buttons.

Stops the options being shown and then immediately hiding on initial
page load.
2016-10-31 09:14:05 +00:00
Chris Hill-Scott
8a01e6af36 Make it say later today
Categories before:

> Now, today, tomorrow, Friday…

Categories after:

> Now, later today, tomorrow Friday…

This reduces the ambiguity of ‘now’ vs ‘today’, and keeping the word
‘later’ suggests what this features is about.

This implementation here is a bit hacky, but it works…
2016-10-31 09:14:05 +00:00
Chris Hill-Scott
a78d9d5048 Group choices for scheduling a job by day
The options for scheduling a job by time should be grouped by day,
because a long list of 96 options is not very usable.

On the server side, this commit generates label for the next 4 days in
a friendly format (ie today/tomorrow/Sunday/Monday)

The Javascript component for choosing a time was built in a kind of
old-school jQuery way, where it manipulated the elements on the page.
The complexity of introducing groups of options was just too much for
this pattern, because it involves storing a lot of state in the DOM.

This commit completely rewrites the JS to:

- read the initial options and groups from the HTML and store them
  in the object
- use Hogan to completely re-render the UI from a series of Mustache
  templates, each of which represents a state of the UI and takes the
  inital options and groups
- filter the choices to show when the today/tomorrow/… buttons are
  clicked
2016-10-31 09:14:05 +00:00
Chris Hill-Scott
324e1f9ef4 Allow a job to be scheduled any time in next 96hrs
If you want to send a job on Monday morning, you should be able to
schedule it on Friday. You shouldn’t need to work on the weekend.

96 hours is a full 4 days, so you can schedule a job at any time on
Friday for any time on Monday.

We’ve checked with the information assurance people, and they’re OK
with us holding the data for this extra amount of time.

This commit changes the choose time form from showing one radio button
for each of the next 24 hours to one for each of the next 96 hours. It
changes the labels from ‘9am’ to ‘Monday at 9am’ so it’s clear which
day you’re choosing.
2016-10-31 09:14:04 +00:00
Chris Hill-Scott
318e8fdc81 Merge pull request #994 from alphagov/remove-all-services
Remove ‘all services’ page
2016-10-31 10:13:49 +01:00
Chris Hill-Scott
5d76335015 Move relevant test, delete others
The test for non-gov.uk domains adding services is still relevant, but
probably makes more sense in `test_add_services.py`.

The others are no longer relevant now the ‘All services’ page has gone.
2016-10-31 09:09:10 +00:00
Chris Hill-Scott
fc60016566 Remove ‘all services’ page
It’s not needed any more, because the platform admin page does the same
thing better.
2016-10-30 09:16:46 +00:00
Chris Hill-Scott
14b99e5a24 Go to platform admin page when logging in
If you’re a platform admin, you should go straight to the platform admin
page when you log in.

The all services page is just a crappier version of the same thing,
without all the stats, etc.
2016-10-30 09:16:35 +00:00
Leo Hemsted
ef00427564 Merge pull request #1001 from alphagov/service-email-fix
ensure robustness of email_safe function
2016-10-28 16:18:11 +01:00
Leo Hemsted
13d0039aab Merge pull request #1002 from alphagov/go-live-typo
Update request-to-go-live.html
2016-10-28 16:16:50 +01:00
Leo Hemsted
c6291a614e Update request-to-go-live.html
fix typo
2016-10-28 16:16:26 +01:00
Leo Hemsted
a5d228d837 ensure robustness of email_safe function
* remove leading, trailing, or consecutive periods
* strip unicode accents, umlauts, diacritics etc
2016-10-28 16:11:08 +01:00
imdadahad
847bb8ed57 Merge pull request #998 from alphagov/invite-nongov-users
Invite nongov users
2016-10-28 15:40:37 +01:00
Imdad Ahad
4dbae97fd1 Update to use raw strings 2016-10-28 12:09:08 +01:00
Imdad Ahad
f3a4432ed7 Stop non-gov user seeing/changing email and add test 2016-10-28 11:45:05 +01:00
Imdad Ahad
e58b63f504 Update regex/config and remove unused imports 2016-10-28 11:44:35 +01:00
Imdad Ahad
a7e5285073 Add tests to ensure non gov user cannot see, access or create service 2016-10-28 10:48:29 +01:00
Imdad Ahad
2676ee9bcf Add additional tests and refactor 2016-10-28 10:47:32 +01:00
Imdad Ahad
5ecdbb8596 Refactor to use a cleaner and lean regex 2016-10-28 10:45:05 +01:00
Leo Hemsted
f039397533 make letters error if user not logged in
also added tests for the various hiding logic points

also added new logged_in_client in conftest - so you dont need to
patch all those stupid API calls for get user and get service
2016-10-27 16:46:51 +01:00
bandesz
df313ad3d4 Add minimal 404 page for Cloudfront 2016-10-27 13:13:49 +01:00
Leo Hemsted
730719b61f platform admins can toggle services from seeing letters 2016-10-26 16:56:51 +01:00
Leo Hemsted
4a7f136cab add placeholder letters page 2016-10-26 16:51:36 +01:00
Leo Hemsted
baf3bfbda5 Merge pull request #999 from alphagov/xl-fix
fix 500 errors with excel files > 500k size limit
2016-10-26 16:39:14 +01:00
Leo Hemsted
26a985720c fix 500 errors with excel files > 500k size limit
werkzeug's internal workings keep files under 500kb in memory, and files
greater than 500kb as a TemporaryFile

(https://github.com/pallets/werkzeug/blob/0.11-maintenance/werkzeug/formparser.py#L38)

when we encounter a CSV or TSV, we call normalise_newlines, which invokes
`.read()`, however when we were passing straight into pyexcel, we called
`file.getvalue()` - this exists on BytesIO (small files) but not on
TemporaryFile objects (large files) - we were seeing 500 errors
2016-10-26 16:35:14 +01:00
Imdad Ahad
cd3a8bf533 Remove whitelist user fixture and refactor 2016-10-26 14:15:55 +01:00
Imdad Ahad
4203c7c250 Refactor creating a non-gov user 2016-10-26 14:03:18 +01:00
Imdad Ahad
da0c03e8a1 Remove gov-only email text on page 2016-10-26 14:02:23 +01:00
Imdad Ahad
1fb0e22570 Update forgotten password to allow non-gov with test 2016-10-26 14:01:01 +01:00
Imdad Ahad
78aeb8934b Add test to invite nonwhitelist user and refactor 2016-10-25 18:13:50 +01:00
Imdad Ahad
bb85782230 Remove link for adding service if nonwhitelist user 2016-10-25 18:12:46 +01:00