Commit Graph

2583 Commits

Author SHA1 Message Date
Chris Hill-Scott
90d4fcaa52 Don’t let people create a normal key in trial mode
You can’t properly use a normal key when your service is in trial mode.

It’s theoretically useful to create a live key in preparation for going
live. This utitily outweighs the confusion it causes for people creating
their first keys in trial mode.

We should just remove the confusing option.
2016-10-10 14:40:13 +01:00
Chris Hill-Scott
5bb700ac81 Merge pull request #970 from alphagov/whitelist-live
Make whitelist available to live services
2016-10-10 11:39:11 +01:00
Chris Hill-Scott
e714f7adff Merge pull request #971 from alphagov/whitelist-flash
Add a flash message when a user saves whitelist
2016-10-10 11:27:39 +01:00
Chris Hill-Scott
d85be4ef13 Merge pull request #972 from alphagov/compress-all-js
Ensure all Javascript is served compressed
2016-10-10 11:20:22 +01:00
Chris Hill-Scott
87fc3a9e16 Ensure all Javascript is served compressed
Previously we were running the minification before adding dependencies.
This meant that dependencies that don’t come with a minified version
were being served in full.

Running Uglify over everything _after_ including the dependencies
reduces the weight of the downloaded Javascript by about 50kb.
2016-10-10 09:35:15 +01:00
Chris Hill-Scott
eab1d134b2 Add a flash message when a user saves whitelist
I saw users in research going back into the whitelist to check that it
had saved because there’s no feedback.

This commit adds a flash message to confirm that the whitelist was saved
OK.
2016-10-07 15:06:47 +01:00
Chris Hill-Scott
73469c1067 Make whitelist available to live services
Why would a live servie need the whitelist? Because the team key will
also let you send to members of your whitelist (so this commit relabels
it to say so).
2016-10-07 15:01:49 +01:00
Chris Hill-Scott
14c9f39342 Merge pull request #967 from alphagov/fix-param-tests
fix query param testing once and for all. hopefully
2016-10-07 13:43:49 +01:00
Leo Hemsted
b01323c28c fix query param testing once and for all. hopefully
try and avoid comparing URLs as much as possible cos its hard
2016-10-07 13:32:47 +01:00
Chris Hill-Scott
1d18afa231 Merge pull request #966 from alphagov/title-dashboard
Removed service name from the title tag on dashboard
2016-10-07 12:27:18 +01:00
Pete Herlihy
0a21d30f4b Removed service name from the title tag on dashboard 2016-10-07 12:20:39 +01:00
Chris Hill-Scott
60ca57f8f8 Merge pull request #964 from alphagov/terms-update
Removed the incorrect bit about not needing an MOU for low volumes.
2016-10-05 16:38:15 +01:00
Pete Herlihy
4632affc3f Removed the incorrect bit about not needing an MOU for low volumes. 2016-10-05 16:35:08 +01:00
Chris Hill-Scott
893a7b839e Merge pull request #963 from alphagov/fix-analytics
Don’t include hostname in page passed to analytics
2016-10-05 16:34:54 +01:00
Chris Hill-Scott
2e82731bf3 Don’t include hostname in page passed to analytics
Analytics only expects to get the path part of the URL, not the full
URL.
2016-10-05 16:31:22 +01:00
Chris Hill-Scott
5267bb3eda Merge pull request #961 from alphagov/add-quarterly-breakdown
Add monthly breakdown of usage
2016-10-05 16:29:39 +01:00
Chris Hill-Scott
860b071f66 Test for query parameters in either order
They’re not deterministic, and were causing intermittant test failures.
2016-10-05 16:13:21 +01:00
Chris Hill-Scott
b760457ba9 Add monthly breakdown of usage
Basically:
- shows all the months from start of given financial year to now or end
  of given financial year (whichever is earliest)
- shows a breakdown of free and paid text messages for each of these
  months

Depends on:
- [x] https://github.com/alphagov/notifications-api/pull/699
2016-10-05 16:11:19 +01:00
Chris Hill-Scott
0a0bfa9232 Merge pull request #962 from alphagov/re-add-analytics
Re-add Google Analytics
2016-10-05 14:49:01 +01:00
Chris Hill-Scott
4ea7d806fb Remove UUIDs from URLs sent to Google Analytics
If all our URLs are unique (because they contain service/job/template
IDs) then it makes it hard to aggrate how users are behaving across a
range of services/jobs/templates.

This commit replaces anything that looks like a UUID in a URL with `…`.
2016-10-05 10:58:33 +01:00
Chris Hill-Scott
e095d6024c Revert "Remove Google Analytics"
This reverts commit f31170f5a2.
2016-10-05 10:55:04 +01:00
Chris Hill-Scott
cf01227790 Merge pull request #960 from alphagov/fix-paging-activity-page
Fix pagination on activity page
2016-10-03 17:09:34 +01:00
Chris Hill-Scott
3069858a9f Fix pagination on activity page
The activity page was AJAXified in
https://github.com/alphagov/notifications-admin/pull/952 but this
didn’t take pagination into account.

So if you visited page 2, the contents of the page would be replaced by
Javascript with the contents of page 1. So you’d never be able to see
anything beyond page 1, expect for a brief fraction of a second when the
page loaded.

This commit makes sure the AJAX request uses whatever page parameter is
in the URL of the original page.
2016-09-30 15:41:46 +01:00
Rebecca Law
2eb7360468 Merge pull request #959 from alphagov/remove-user-from-service
Allow platform admin to edit users.
2016-09-30 14:07:20 +01:00
Chris Hill-Scott
e682f6a5f9 Merge pull request #958 from alphagov/revert-add-analytics
Remove Google Analytics
2016-09-30 13:49:14 +01:00
Rebecca Law
5a50c945c7 Allow platform admin to edit users. 2016-09-30 11:48:16 +01:00
Chris Hill-Scott
19e86f73a3 Merge pull request #957 from alphagov/cookie
Cookie page updates
2016-09-30 09:38:58 +01:00
Chris Hill-Scott
f31170f5a2 Remove Google Analytics
Reverts https://github.com/alphagov/notifications-admin/pull/306

We’re not looking at the data from Analytics, so shouldn’t be collecting
it just in case.

<sup>Brought to you by the fun police.</sup>
2016-09-30 09:23:00 +01:00
bandesz
c63f1012cc Always pull base Docker image before building 2016-09-29 17:15:10 +01:00
Pete Herlihy
b08c667376 Typo corrections 2016-09-29 15:49:08 +01:00
Pete Herlihy
28f7a55b5c Added the remember_me cookie info to the cookies page. 2016-09-29 15:48:04 +01:00
Chris Hill-Scott
4d70448835 Merge pull request #956 from alphagov/platform-admin-api-visibility
Give platform admin users visibilty of API pages
2016-09-29 13:02:36 +01:00
Chris Hill-Scott
46426217f9 Give platform admin users visibilty of API pages
Platform admins should be able to see what’s going on with a service’s
API integration, including:
- messages sent
- contents of whitelist
- names of keys

They should also be able to revoke keys in an emergency.

The only thing they _shouldn’t_ be able to do is create new keys
(because then they’d be able to send messages as the service).
2016-09-29 12:57:57 +01:00
Chris Hill-Scott
ee6c4909b1 Merge pull request #949 from alphagov/api-integration-page-FINAL
Add whitelist, trial mode, and log to API page
2016-09-29 10:32:14 +01:00
Chris Hill-Scott
fdeb2997fb Stop whitelist form autocompleting
The browser tries to be helpful by autofilling email addresses and
phone numbers. But it gets confused and tries to fill all the fields
with the same email address or phone number. This looks broken.

This commit disables autocomplete for these form fields.
2016-09-29 10:21:08 +01:00
Chris Hill-Scott
6c96b90922 Make relative timestamps update automatically
It’s weird to be on a page that says ‘2 seconds ago’ and stays stuck
there.

We don’t want to AJAX the whole page because it would get in the way of
interacting with the list of notifications.

This commit adds the venerable jQuery Timeago[1] plugin to keep the
relative times accurate and fresh.

1. http://timeago.yarp.com/
2016-09-29 09:28:13 +01:00
Chris Hill-Scott
48891babc4 Add log of notifications to API integration page
Now that we’ve removed simulated notifications from the dashboard and
activity pages they’re not visible anywhere in the app.

While they should’t be visible to non-technical users, developers have
a real need for Notify to confirm that their code is doing what they
expect. This is needed especially when they’re just getting started with
Notify.

There’s no way of seeing this info from the API either, because a key
can only get notifications created with a key of that type.

It doesn’t make sense to make this a ‘mode’ of the dashboard or activity
because the information about notifications that developers need is
also different. So this commit adds up to 50 of the most recent
notifications sent via the API to the page that developers use as their
‘home’ page.

This also lets us explain the 7 days thing to developers via the
empty slate state of this area of the page.
2016-09-29 09:28:04 +01:00
Chris Hill-Scott
a04aad8825 Add additional params to get notifications client
We want to show a log of notifications that have been sent from the API.

The admin app uses its own private `/service/…/notifications` endpoint
for listing activity. This commit allows us to pass through two
optional, additional parameters to tell the API to:

- include or not include notifications created from a job
- include or not include notifications created with a test API key
2016-09-29 09:27:55 +01:00
Chris Hill-Scott
ce0b3511e6 Make indentation more sensible
Starting arguments on their own line and putting the closing parenthesis
on it’s own line because any subsequent changes to the arguments diff
cleanly (ie without touching any other lines).
2016-09-29 09:27:46 +01:00
Chris Hill-Scott
3e42042156 Add a page to manage a service’s whitelist
Services who are in alpha or building prototypes need a way of sending
to any email address or phone number without having to sign the MOU.

This commit adds a page where they can whitelist up to 5 email addresses
and 5 phone numbers.

It uses the ‘list entry’ UI pattern from the Digital Marketplace
frontend toolkit [1] [2] [3].

I had to do some modification:
- of the Javascript, to make it work with the GOV.UK Module pattern
- of the template to make it work with WTForms
- of the content security policy, because the list entry pattern uses
  Hogan[1], which needs to use `eval()` (this should be fine if we’re
  only allowing it for scripts that we serve)
- of our SASS lint config, to allow browser-targeting mixins to come
  after normal rules (so that they can override them)

This commit also adds a new form class to validate and populate the two
whitelists. The validation is fairly rudimentary at the moment, and
doesn’t highlight which item in the list has the error, but it’s
probably good enough.

The list can only be updated all-at-once, this is how it’s possible to
remove items from the list without having to make multiple `POST`
requests.

1. 434ad30791/toolkit/templates/forms/list-entry.html
2. 434ad30791/toolkit/scss/forms/_list-entry.scss
3. 434ad30791/toolkit/javascripts/list-entry.js
4. http://twitter.github.io/hogan.js/
2016-09-29 09:27:38 +01:00
Chris Hill-Scott
4a596c1dd2 Add a new banner for telling you about trial mode
We’ve found in research that developers have no idea they’re in trial
mode until they hit an error. And even then they don’t really know what
trial mode means.

So this commit:
- adds a message to the API integration page about trial mode
- puts it in a really yellow banner to draw attention to it
- adds the same banner to the settings page
2016-09-28 17:00:46 +01:00
Chris Hill-Scott
f514d377f7 Add a new pattern for sub-navigation
This is like the ‘pill’ pattern that we use for filtering lists of
notifications. However it is meant for navigating between discrete
things, not a filtered view of the same list.

This is why is has a gutter between each item, and no selected state.

Turns out we already had a pattern about this on the dashboard, so this
commit also changes the dashboard to use the same code.
2016-09-28 17:00:46 +01:00
Chris Hill-Scott
dfa3a9242f Add a separate page for linking to documentation
It’s going to get too cluttered to have these links on the API index
page.
2016-09-28 17:00:45 +01:00
Chris Hill-Scott
70a9582c91 Make ‘add new’ button line up with <h1>
Having changed the layout of the API keys page a bit the vertical
misalignment was apparent.
2016-09-28 17:00:45 +01:00
Chris Hill-Scott
d9cc936972 Add an index page for the API integration
This commit adds a placeholder page which, for now, just has links to
the API keys page and links to the clients.

There’s more stuff to come on this page, but this commit just does the
reorganising so that it’s easier to review.
2016-09-28 17:00:45 +01:00
Chris Hill-Scott
c22eb0f081 Reorganise templates for API keys page
This adds another layer of folder structure to the templates to match
the new URLs, which have another layer of hierarchy.
2016-09-28 17:00:44 +01:00
Chris Hill-Scott
234e0b3e6e Change URL for the API keys page
We’re going to have an ‘index’ page for a service’s API integration,
so the keys page needs to move down one level in the hierarchy.
2016-09-28 17:00:43 +01:00
Chris Hill-Scott
2c945902af Merge pull request #955 from alphagov/fix-template-inheritance-without-navigation
Don’t inherit directly from admin template
2016-09-28 15:12:43 +01:00
Chris Hill-Scott
79e0881a23 Don’t inherit directly from admin template
Pages that don’t have navigation shouldn’t extend the top-level admin
template directly.

They should extend `withoutnav_template.html` instead, because then they
get a wrapping `<main>` element, which is good semantically and for
accessibility, and also defaults the font size to `19px`.
2016-09-28 15:10:01 +01:00
Chris Hill-Scott
232eada842 Merge pull request #954 from alphagov/update-password-hints
Update password hint text
2016-09-28 15:00:32 +01:00