Commit Graph

5047 Commits

Author SHA1 Message Date
Chris Hill-Scott
f93ef2eb3d Convert domain list to YAML
YAML is easier to edit than Python code, and having it in the root
directory of the app makes it nice and easy to find.
2018-02-26 08:53:46 +00:00
Chris Hill-Scott
91ab54e9c1 Allow lookup of org details
This commit:
- makes the logic around looking up a domain a bit more sophisticated
  by matching on the longest domain name first
- exposes the details about an organisation to consumers of the
  `GovernmentDomain` class
2018-02-26 08:53:46 +00:00
Chris Hill-Scott
911fc3ff4c Start adding extra information about each domain
In some cases we can tell based on someone’s email domain whether they
work for a central or local government organisation, and whether they
will need to sign the MOU or agreement in order to go live. So this
commit creates a structure to store this information.
2018-02-26 08:53:46 +00:00
Chris Hill-Scott
156625a994 Remove raw string notation
Makes it fiddlier to add new domains, and is only needed to generate the
regular expression. Much cleaner to just insert them as part of
generating the regular expression.
2018-02-26 08:53:46 +00:00
Chris Hill-Scott
3e79ae1bfe Encapsulate domain list in class
Code shouldn’t be accessing this list directly; the class should provide
a sensible interface to the data.
2018-02-26 08:53:46 +00:00
Chris Hill-Scott
7c339b808e Refactor logic around gov domains into a class
This gives us space to add more logic in the future, and expose more
information than whether a given domain is/isn’t government.
2018-02-26 08:53:45 +00:00
Chris Hill-Scott
96aac519cc Extend user client to count users with permission
One of the things we need to know for a service to go live is whether
they have at least two users with the ‘manage service’ permission.

So this commit adds a method to the client to count how many users have
a given permission. We can do logic on this count later. But having the
counting done in the client feels like a cleaner separation of concerns.

Meant some refactoring of the way `service_id` is extracted from the
request, in order to make it easier to mock.
2018-02-26 08:53:45 +00:00
Chris Hill-Scott
56833b1d10 Add test for existing get users client method
Want to make sure it’s doing what I expect before I build another method
that calls through to it.
2018-02-26 08:53:45 +00:00
Chris Hill-Scott
51f0320aec Add API client method to count templates
When users request to go live we check stuff like:
- if they’ve added templates
- if they have email templates (then we can check their reply to
  address)

This commit adds a method to do this programatically rather than
manually.

We _could_ do this in SQL, but for page that’s used intermittently it
doesn’t feel worth the work/optimisation (and the client method is at
least in place now if we do ever need to lean on this code more
heavily).
2018-02-26 08:53:45 +00:00
Chris Hill-Scott
103a36a5da Hide ‘request to go live’ from API only users
Users who have the ‘manage API keys’ permission can see the settings
page. But they don’t have permission to request to go live.

At the moment they can still see the link, though clicking it gives them
a 403 error. This commit changes it so that they can’t see the link, and
tells them who they should speak to about going live (their manager).
2018-02-26 08:53:45 +00:00
Pete Herlihy
24f6b7246d Late entry with DVSA enforcement.... 2018-02-26 08:53:45 +00:00
Pete Herlihy
6abbc4b1d6 160-165 services and 65-66 orgs
4 Pembrokeshire services and 1 new Hackney service
2018-02-26 08:53:45 +00:00
kentsanggds
b7b25c7d16 Merge pull request #1894 from alphagov/ken-add-precompiled-letter-button
Add button to toggle precompiled letters on/off
2018-02-22 11:40:43 +00:00
Chris Hill-Scott
c4c54472df Merge pull request #1887 from alphagov/two-step-go-live
Split request to go live into two pages
2018-02-22 10:53:53 +00:00
Pete Herlihy
6672056e5a Merge pull request #1893 from alphagov/153-160-and-62-65
Up to 160 and 65 organisations
2018-02-21 18:43:57 +00:00
Ken Tsang
df41fcfdd0 Add button to toggle precompiled letters on/off 2018-02-21 17:41:19 +00:00
Pete Herlihy
f776d8eed7 Up to 160 and 65 organisations 2018-02-21 16:14:31 +00:00
Katie Smith
fbaf49e232 Merge pull request #1881 from alphagov/pyup-update-eventlet-0.22-to-0.22.1
Update eventlet to 0.22.1
2018-02-21 11:30:08 +00:00
Katie Smith
1483d0f521 Merge pull request #1882 from alphagov/pyup-update-pytest-xdist-1.22.0-to-1.22.1
Update pytest-xdist to 1.22.1
2018-02-21 11:30:01 +00:00
Katie Smith
91f8ce44fa Merge pull request #1890 from alphagov/pyup-update-pytest-3.4.0-to-3.4.1
Update pytest to 3.4.1
2018-02-21 11:29:52 +00:00
pyup-bot
65889eeba0 Update pytest from 3.4.0 to 3.4.1 2018-02-20 22:09:48 +00:00
Chris Hill-Scott
c5b51bc5ec Link to request to go live from the guidance
If we know what service someone has been using, we can take them to the
right place.
2018-02-20 12:36:39 +00:00
Chris Hill-Scott
4a6d0d08d4 Add grid column to go live checklist page
To keep the line length of the text nice and comfortable.
2018-02-20 12:31:19 +00:00
Chris Hill-Scott
8a857d2618 Move expectation-setting text to initial page
We have tickets from people asking how long the process takes. I suspect
that this is because they’re not getting to the bottom of the form
before they’re ready to go live.
2018-02-20 12:30:15 +00:00
Chris Hill-Scott
7dc278c959 Split into two pages
A lot of users aren’t reading or paying attention to the checklist on
the request to go live page. We think that we can get more people to
read it by putting it on its own page, where users won’t jump straight
to filling in the form.

This will, later on, let us make this page smarter by automatically
detecting if they’ve done the necessary things.
2018-02-20 12:28:32 +00:00
Chris Hill-Scott
4e2b4b5ac7 Rename endpoint
Every endpoint in this file is to do with a service. Putting service in
the name is redundant.
2018-02-20 12:27:53 +00:00
Chris Waszczuk
ce4ffcde3c Merge pull request #1868 from gov-cjwaszczuk/organisation-dashboard
Organisation dashboard
2018-02-20 11:50:01 +00:00
chrisw
14b80622b7 link-service-to-organisations-tweaks 2018-02-20 11:30:46 +00:00
pyup-bot
a3bde8f948 Update pytest-xdist from 1.22.0 to 1.22.1 2018-02-19 22:28:29 +00:00
chrisw
dd2231056d organisation dashboard page 2018-02-19 16:56:16 +00:00
Ken Tsang
c1e3658a8f Add load org before request to allow current_org to be accessible from request context 2018-02-19 16:56:16 +00:00
chrisw
96b66829a1 organisation-dashboard 2018-02-19 16:56:16 +00:00
Chris Hill-Scott
41425481b3 Merge pull request #1878 from alphagov/pyup-update-pytest-mock-1.6.3-to-1.7.0
Update pytest-mock to 1.7.0
2018-02-19 10:38:26 +00:00
pyup-bot
29643231f9 Update eventlet from 0.22 to 0.22.1 2018-02-17 18:24:25 +00:00
pyup-bot
11f43988e3 Update pytest-mock from 1.6.3 to 1.7.0 2018-02-16 21:23:23 +00:00
Rebecca Law
b8239085f5 Merge pull request #1874 from alphagov/add-min-validation-for-sms-sender
Added a validation for a minimum of 3 character.
2018-02-15 17:18:04 +00:00
Rebecca Law
2b739535d4 Added an edge case test 2018-02-15 16:39:42 +00:00
Rebecca Law
6bd99e0599 Added a validation for a minimum of 3 character.
If the SMS sender is less than 3 characters one of our providers will return an error.
2018-02-15 16:06:44 +00:00
Rebecca Law
fcc5c4e3e9 Merge pull request #1871 from alphagov/remove-allow-pdf-button
Remove allow/stop send pdf letters button
2018-02-15 09:45:46 +00:00
Rebecca Law
3f52454691 Remove allow/stop send pdf letters button.
Now that we only use the pdf letter flow, we can remove the button for the platform admin users.
2018-02-14 17:09:13 +00:00
Chris Hill-Scott
24a82b4812 Merge pull request #1870 from alphagov/147-153
147-153 services and 62-63 organisations
2018-02-14 16:30:27 +00:00
Chris Hill-Scott
56969c2379 Merge pull request #1865 from alphagov/no-slash-dashboard
Remove dashboard from dashboard URL
2018-02-14 16:30:17 +00:00
Pete Herlihy
3d26d4563b 147-153 services and 62-63 organisations
MoJ O2 Transition Project – Ministry of Justice
Academies Financial Reporting Division – Department for Education
Money Claims Service Line – HM Courts & Tribunals Service
HR and Organisational Development – Calderdale Council
Family & Civil Service Line – HM Courts & Tribunals Service
Electronic Patient Discharge Questionnaire – Public Health England
2018-02-14 16:19:52 +00:00
Leo Hemsted
5005a0db51 Merge pull request #1864 from alphagov/pytest-env
Automatically set environment vars before tests
2018-02-14 15:11:53 +00:00
Leo Hemsted
7322cf126b Merge pull request #1869 from alphagov/email-validation
validate email addresses in one-off flow
2018-02-14 15:11:44 +00:00
Leo Hemsted
e8f262c632 Merge pull request #1867 from alphagov/fail-fast
Stop pytest on 10th failing test
2018-02-14 15:11:35 +00:00
Leo Hemsted
31a4cc15c9 validate email addresses in one-off flow
previously we were just using the wtforms builtin email validator,
which is much more relaxed than our own one. It'd catch bad emails when
POSTing to the API, resulting in an ugly error message. It's easy work
to make sure we validate email addresses as soon as they're entered.
2018-02-14 14:35:16 +00:00
Chris Hill-Scott
14b5f9e778 Allow up to 10 tests to fail before stopping
This is a sensible compromise between 1 test and ALL THE TESTS.

Uses the `maxfail` option as documented here:
https://docs.pytest.org/en/latest/usage.html#stopping-after-the-first-or-n-failures
2018-02-14 13:25:41 +00:00
Chris Waszczuk
34f1b40dbc Merge pull request #1858 from gov-cjwaszczuk/link-service-to-organisation
Link services to organisations (Admin)
2018-02-14 12:30:15 +00:00
Katie Smith
8bbfde5845 Merge pull request #1861 from alphagov/let-service-change-punctuation-in-name
Pass service_id through to API '/service/unique' endpoint
2018-02-14 11:53:03 +00:00