Commit Graph

874 Commits

Author SHA1 Message Date
Chris Hill-Scott
db6bb77d74 Don’t allow suppliers to sign up for own accounts
Suppliers need to be invited by people who work for the government.
People who work for the government can invite anyone to join their team,
no matter what their email address is.

So there’s no need for these domains to be in the list now.
2016-12-07 13:57:26 +00:00
Chris Hill-Scott
b4a7ffff8d Add Natural England to gov. email domains list
> I cannot register as the Email address field will not accept my email
> address format (.org.uk).  Natural England is a non-departmental
> government body sponsored by Defra (Department for Environment, Food
> and Rural Affairs).  Can you register me on the system or change the
> system so it will accept my email address?

– Deskpro ticket

> Natural England is an executive non-departmental public body,
> sponsored by the Department for Environment, Food & Rural Affairs.

– https://www.gov.uk/government/organisations/natural-england

***

Checks out…
2016-12-07 12:58:49 +00:00
Jenny Duckett
93405dd56b Move day and test key messages to <p> instead of left column
We don't want large numbers in Production to start overlapping other columns
in the tables when they have less space available, and putting these messages
at the top of the page under the h1 means that we don't need an extra column
on the page yet.
2016-12-06 12:46:11 +00:00
Jenny Duckett
3a637c8fa9 Move "Today" heading to left column on platform admin page
When we make the numbers on this page more filterable the date range will be
one of the options to change, so it makes sense to move it to the side now
instead of leaving it above the big numbers.
2016-12-06 12:42:27 +00:00
Jenny Duckett
c88a961e04 Add option to exclude test key stats on platform admin page
This page currently includes all notifications for all services, including
those sent using a test key. Stats on all other pages exclude test key usage,
though, which can lead to confusion for admins comparing numbers between
pages. Adding the option to toggle between including and excluding test key
usage on the platform admin page gives context for this difference, and allows
admins to see live usage of the platform as well as load associated with test
key usage.
2016-12-06 12:42:27 +00:00
Rebecca Law
1efa5530d4 Merge pull request #1027 from alphagov/deactivate-services-all-services-list
dont show inactive services on the choose service list
2016-11-23 16:10:44 +00:00
Rebecca Law
cebf8e1d65 Removed get_all_notifications method from notification_api_client as it is not longer being used. 2016-11-18 14:39:23 +00:00
Leo Hemsted
805639a2e1 add test for choose services and related redirects to it
it'll just show the add service button if you only have archived services
2016-11-16 13:18:49 +00:00
Leo Hemsted
08881e5bd1 add get_active_services method
* all current invocations of get_services now call get_active_services
  EXCEPT for platform admin page (where we want to see inactive services
* cleaned up parameter names and unpacking (since *params is unhelpful)
* fixed incorrect kwarg name in conftest
2016-11-16 11:08:20 +00:00
Leo Hemsted
b885ce9cf4 clean up some usage of active in tests and remove it from service_api_client.create_service (created services are always active) 2016-11-16 11:08:20 +00:00
Leo Hemsted
045864f052 Merge pull request #1022 from alphagov/deactivate-services-plat-admin
Deactivate services plat admin
2016-11-16 11:07:52 +00:00
Chris Hill-Scott
48496eefde Merge pull request #1024 from alphagov/add-letters-templates-2
Let users upload a CSV file of addresses against a letter template
2016-11-15 17:57:28 +01:00
Leo Hemsted
5edb8cd086 revert platform admin statistics
was erroneously using 'requested' rather than calculating 'sending'
2016-11-15 11:12:19 +00:00
Leo Hemsted
28adea52ab fix tests for new platform admin layout 2016-11-14 17:25:07 +00:00
Leo Hemsted
d26f7ac441 Merge branch 'master' of github.com:alphagov/notifications-admin into deactivate-services-plat-admin 2016-11-14 17:15:05 +00:00
imdadahad
6a9973d1b6 Merge pull request #1025 from alphagov/show-email-sms-stats-platform-admin
Show email and sms counts for each service on platform admin
2016-11-14 16:56:00 +00:00
Chris Hill-Scott
70eec8fe73 Don’t let people actually start a letter job
Who knows what would happen if a job with a letter template actually
got into the database. `403`ing the page is a quick and dirty hack to
stop this from happening.
2016-11-14 14:51:27 +00:00
Chris Hill-Scott
88631a680c Sprinkle letter throughout the app
Let users create/edit/delete letter templates.

Let them upload a CSV file or send a test against a letter template.

Big assumption at the moment is that addresses only have one line, and
therefore one column in the CSV file.
2016-11-14 14:51:26 +00:00
Imdad Ahad
dbbb2f7848 Fix comment 2016-11-14 14:50:36 +00:00
Imdad Ahad
c1649e85a6 Ensure stats shown on platform admin are correct and refactor original test for new layout 2016-11-14 14:46:52 +00:00
Leo Hemsted
63de598d31 Merge pull request #1008 from alphagov/deactivate-service
Deactivate service
2016-11-14 11:41:13 +00:00
Leo Hemsted
fb85877c75 add tests for platform admin list ordering 2016-11-14 11:33:39 +00:00
imdadahad
115cbe67e5 Merge pull request #1011 from alphagov/update-user-profile
Update user profile
2016-11-11 14:47:13 +00:00
Imdad Ahad
e5ea81b184 Fix pep issues and refactor tests 2016-11-10 10:45:09 +00:00
Imdad Ahad
f3ca33dad3 Revert original update user method and add new attribute update (with strict checking) 2016-11-09 15:06:02 +00:00
Leo Hemsted
7a48e25dbb flash up prompt when archiving a service
same way as we do when deleting templates

(also rename button from deactivate -> archive)
2016-11-08 14:33:53 +00:00
Chris Hill-Scott
4ae28386a6 Always show live key, reword key labels
This is trying to resolve these confusions:

- that you’re in trial mode, which means you can’t have a live key yet (
  or you can but it wont work, which is what we used to have)
- what does simulate mean

The create key page is the right place to resolve these confusions
because it’s where users are actively reading.

This commit also removes the trial mode banner from API integration
page because this where users _aren’t_ actively reading. A whole bunch
of users weren’t seeing this banner at all.

The implementation of the disabled API key options is kinda clunky
because WTForms doesn’t have a native way of doing this.

¯\_(ツ)_/¯
2016-11-04 14:05:30 +00:00
Chris Hill-Scott
6a07b8bac2 Merge pull request #1006 from alphagov/request-to-go-live-improvements
Make certain questions on request to go live radio buttons
2016-11-04 14:05:54 +01:00
Leo Hemsted
a216259a8e Merge pull request #1005 from alphagov/letters-nav
allow users to see letters even if they dont have edit permissions
2016-11-04 09:46:27 +00:00
Imdad Ahad
1c42640137 Update update user mock to conform to new format 2016-11-03 11:20:43 +00:00
Chris Hill-Scott
274b2893f7 Merge pull request #979 from alphagov/4-days-scheduled
Allow a job to be scheduled any time in next 4 days
2016-11-03 10:24:07 +01:00
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
Leo Hemsted
e89f89bd11 remove unused delete service functionality 2016-11-02 10:29:44 +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
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
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
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
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
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
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
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