Commit Graph

5809 Commits

Author SHA1 Message Date
Chris Hill-Scott
84b05ab29c make freeze-requirements 2018-08-03 16:13:41 +01:00
pyup-bot
77d43b8fed Update notifications-python-client from 4.10.0 to 5.0.0 2018-08-03 16:10:57 +01:00
Chris Hill-Scott
776d54ed54 Merge pull request #2201 from alphagov/bump-utils-29.3.4
Bump utils to 29.3.4
2018-08-03 15:05:30 +01:00
Chris Hill-Scott
55054b81b5 Include test key data by default on platform admin
This is the existing behaviour. It’s broken by this issue in WTForms
2.2.1: https://github.com/wtforms/wtforms/issues/401

This commit hand-crafts the default value, because WTForms is ignoring
the `default` argument on the form object attribute.

Not really sure how this ever worked 🤔
2018-08-03 14:53:40 +01:00
Chris Hill-Scott
0d2de75e84 Bump utils to 29.3.4
https://github.com/alphagov/notifications-utils/compare/29.3.2...bullet-for-bullet
2018-08-03 13:57:55 +01:00
Chris Hill-Scott
dd2364654a Merge pull request #2166 from alphagov/basic-view-description
Revise how we talk about what basic view is
2018-08-02 17:41:26 +01:00
Chris Hill-Scott
26823b6122 Fix straight apostrophe 2018-08-02 17:35:37 +01:00
karlchillmaid
8eaf7caa05 Updated hint text
Updated hint text
2018-08-02 17:31:16 +01:00
Chris Hill-Scott
6d7c47111c Merge pull request #2198 from alphagov/basic-event-keys
Fix broken keys for basic view event tracking
2018-08-02 17:13:48 +01:00
karlchillmaid
48ddce8410 Removed reference to 'their' sent messages
Removed reference to 'their' sent messages – because users will be able to see all sent messages
2018-08-02 17:09:20 +01:00
karlchillmaid
5c5fe54cb4 Updated content to include next steps
Updated content to explain what users need to do next.

Includes explicit instructions and a repetition of 'team members'.
2018-08-02 16:58:43 +01:00
Chris Hill-Scott
cabb0a74c1 Fix broken keys for basic view event tracking
Bad copy/paste…
2018-08-02 16:44:15 +01:00
Chris Hill-Scott
d92340b7cf Merge pull request #2197 from alphagov/track-basic-view
Track onboarding of basic view in Google Analytics
2018-08-02 16:17:14 +01:00
Chris Hill-Scott
c655826b17 Merge pull request #2195 from alphagov/geo.gov.uk
Add Government Equalities Office to domain list
2018-08-02 15:24:30 +01:00
Chris Hill-Scott
fc5f3ee132 Merge pull request #2192 from alphagov/jobs-one-off
Show uploaded files in basic view
2018-08-02 15:23:58 +01:00
Chris Hill-Scott
8e6efadb23 Track virtual page view when enabling basic view
So we can see what pages people go to after turning it on.
2018-08-02 15:23:52 +01:00
Chris Hill-Scott
77d96032bf Track event when someone previews basic view
We’re interested to know which services are looking at the basic view
preview (even if they’re not turning it on).

This commit logs their service IDs as events into Google Analytics.
2018-08-02 15:23:52 +01:00
Chris Hill-Scott
291b919e78 Add Government Equalities Office to domain list
They have been using Notify for the Gender Pay Gap service for ages.
2018-08-01 12:54:36 +01:00
Chris Hill-Scott
c551ce9a42 Show jobs in basic view
There are some teams who send jobs on a daily/weekly basis. They have
team members who only use Notify for this purpose. So they would
probably benefit from basic view, because they don’t need to see the
dashboard.

This commit:
- adds a new item (uploaded files) to the basic view navigation for
  teams that have sent at least one job
- makes the job pages visible to basic view users

I think we should do this now, rather than as a later enhancement to
basic view. We only have one chance to announce the feature, so teams
who do send jobs may otherwise discount it as not useful for them and
the opportunity to have them use it is lost.
2018-08-01 10:45:02 +01:00
Rebecca Law
505c8b1224 Merge pull request #2194 from alphagov/fix-template-duplication
Edit, don’t duplicate, existing templates
2018-07-31 16:31:56 +01:00
Rebecca Law
d512f330cd Edit, don’t duplicate, existing templates 2018-07-31 16:23:46 +01:00
Chris Hill-Scott
b35f6e9d5f Merge pull request #2180 from alphagov/service-model
Make a service model
2018-07-31 13:31:09 +01:00
karlchillmaid
6b33bc7956 Remove reference to 'one-off' messages
Basic view should work for sending multiple messages too.
2018-07-31 12:35:36 +01:00
Chris Hill-Scott
9d2e0ae2f3 Merge pull request #2191 from alphagov/json-boolean
Store boolean values in Redis as valid JSON
2018-07-31 12:24:38 +01:00
Chris Hill-Scott
45579c59cd Store boolean values in Redis as valid JSON
Calling `.set()` with `True` stores the byte string `'True'` which
cannot subsequently be decoded from JSON (because boolean values in
JSON are lowercase, ie `true`).
2018-07-31 12:17:28 +01:00
Chris Hill-Scott
1073b8f178 Merge pull request #2178 from alphagov/cache-has-jobs
Check if any jobs exist before querying jobs
2018-07-31 11:17:42 +01:00
Alexey Bezhan
5af1183218 Merge pull request #2153 from alphagov/pin-all-requirements
Pin all requirements in requirements.txt
2018-07-31 10:25:04 +01:00
Chris Hill-Scott
0906eb019d Check that API is not called when result is cached
Good to explicitly test this (rather than relying on an exception not
being raised).
2018-07-31 10:05:10 +01:00
Chris Hill-Scott
eb8e433820 Rename variable to be more descriptive
> "normal" is a word that does not really tell much, could we maybe name
> this constant better?

‘Non-scheduled’ more explicitly describes that statues in this set.
2018-07-31 09:57:55 +01:00
Chris Hill-Scott
1af288fc1c Merge pull request #2189 from alphagov/pyup-update-pytest-3.6.4-to-3.7.0
Update pytest to 3.7.0
2018-07-31 09:56:52 +01:00
pyup-bot
369ad2b457 Update pytest from 3.6.4 to 3.7.0 2018-07-31 02:16:50 +01:00
Alexey Bezhan
5bae92c738 Make pyup ignore requirements.txt
We don't want pyup.io upgrading sub-dependencies listed in the
requirements.txt file since it does it whenever a new version is
available regardless of what our application dependencies require.
2018-07-30 16:43:44 +01:00
Alexey Bezhan
2f876243ae Pin all requirements in requirements.txt
The list of top-level dependencies is moved to requirements-app.txt,
which is used by `make freeze-requirements` to generate the full
list of requirements in requirements.txt.

(See alphagov/notifications-api#1938 for details.)
2018-07-30 16:43:03 +01:00
Chris Hill-Scott
41e0f7941f Refactor to avoid duplicated method definitions
Each of these methods does the same thing, so this refactors into an
attribute lookup, which saves writing boilerplate code and makes it
easier to add new properties.
2018-07-30 14:56:36 +01:00
Chris Hill-Scott
92a258dc41 Use model for template previews 2018-07-30 14:56:36 +01:00
Chris Hill-Scott
1304561a70 Use service model to look up service attributes
This is better than just keying into the JSON because it means you get
an exception straight away when looking up a key that doesn’t exist
(which via mocking you could ordinarily miss).
2018-07-30 14:56:36 +01:00
Chris Hill-Scott
036923c382 Make a service model and use for permissions
Having the service floating about as JSON is a bit flakey. Could easily
introduce a mistake where you mistype the name of a key and silently
get `None`.

Also means doing awkward things like `if 'permission' in
current_service['permissions']`, whereas for users we can do the
much cleaner `user.has_permission()`.

So this commit:
- introduces a model
- adds a `.has_permission` method similar to the one we have for users
2018-07-30 14:56:36 +01:00
Chris Hill-Scott
3056731cbb Merge pull request #2174 from alphagov/copy-template
Add option to copy existing template when adding
2018-07-30 13:02:46 +01:00
karlchillmaid
8b608f7a89 Updated caseworker permissions content
Updated description of caseworker / basic view permissions
2018-07-30 11:53:00 +01:00
karlchillmaid
cef8c6d90e Updated content
Updated the description of what basic view does
2018-07-30 11:50:39 +01:00
Chris Hill-Scott
2070314cb1 Fix missing organisation services from user search
The list of services this page was looking at only included those not
belonging to an organisation.

On production this excludes services we’ve added to organisations to
make the management of those services easier (eg ‘GDS’ and ‘DVLA’).
2018-07-30 11:31:52 +01:00
Chris Hill-Scott
19632ea4ab Add option to copy existing template when adding
Sometimes when setting up a service you might have a few very similar
templates, in which only a small amount of content. Or you might even
have a few of services, which are used by different teams but have
similar templates.

Copy and pasting, especially from one service to another, is a pain.
This commit makes it easier by allowing users to copy an existing
template when choosing to add a new one, instead of starting from
scratch.
2018-07-30 11:31:51 +01:00
Chris Hill-Scott
078096eecc Merge pull request #2183 from alphagov/pyup-update-notifications-python-client-4.8.2-to-4.10.0
Update notifications-python-client to 4.10.0
2018-07-30 11:31:21 +01:00
Chris Hill-Scott
9490c791dd Merge pull request #2187 from alphagov/pyup-update-beautifulsoup4-4.6.0-to-4.6.1
Update beautifulsoup4 to 4.6.1
2018-07-30 11:31:09 +01:00
Chris Hill-Scott
505de52d38 Check if any jobs exist before querying jobs
At the moment the dashboard does two API calls to find out if a service
has:

1. Scheduled jobs
2. Normal jobs

API calls are slow because they are synchronous, go over the network and
touch the database. We can’t cache these API calls because:
- a scheduled job could become a normal job at any time
- the statistics on a normal job are constantly updating

However there are plenty of services which don’t have any jobs, and
probably never will. And finding out if a service has any jobs is
reliably cacheable (because as soon as a service creates its first job
it has some jobs).

So this commit:
- refactors the way we get scheduled/normal jobs into the job_api_client
  to make the view a bit slimmer
- makes an additional, Redis-wrapped call to find out if any jobs exist
  before trying to get the jobs

This should result in a speedup on the dashboard, and can be used in the
future if there’s anywhere else we want to show or hide something
depending on whether a service has created any jobs (I have some ideas).
2018-07-30 11:14:01 +01:00
Chris Hill-Scott
c1b2f63671 Merge pull request #2173 from alphagov/gamblingcommission.gov.uk
Mark agreement signed by the Gambling Commission
2018-07-30 10:44:38 +01:00
Chris Hill-Scott
bbf710c0a6 Merge pull request #2185 from alphagov/pyup-update-pytest-xdist-1.22.2-to-1.22.5
Update pytest-xdist to 1.22.5
2018-07-30 10:38:36 +01:00
Chris Hill-Scott
0d1fcb2018 Merge pull request #2186 from alphagov/pyup-update-pytest-3.6.3-to-3.6.4
Update pytest to 3.6.4
2018-07-30 10:38:22 +01:00
pyup-bot
b278382d92 Update beautifulsoup4 from 4.6.0 to 4.6.1 2018-07-29 00:49:48 +01:00
pyup-bot
7f82cc9fbb Update pytest from 3.6.3 to 3.6.4 2018-07-28 18:15:46 +01:00