Commit Graph

2606 Commits

Author SHA1 Message Date
Katie Smith
e72540d3f9 Merge pull request #3065 from alphagov/rename-endpoint
Remove ft from method and url, it doesn't add any meaning.
2019-07-29 10:07:31 +01:00
Katie Smith
123b769771 Change code order for Redis delete decorator
Before, the delete decorator would delete the keys from Redis and then
we made the request to api to change the data. However, it is possible
that the cache could get re-populated in between these two things
happening, and so would cache outdated data.

This changes the order to send the api request first. We then always
delete the specified keys from Redis. Changing the order of the code in
the decorator changes the order in which the cache keys get deleted, so
the tests have been updated.
2019-07-26 16:29:50 +01:00
Katie Smith
dc1c73c647 Delete service cache when changing an organisation's sector
When we change an organisation's sector we now also change the sector of
all its services, so we need to delete those services from Redis.
2019-07-26 16:26:20 +01:00
karlchillmaid
92343aa45e Update change links and headings (#3064)
* Update Settings titles
* Update Change links on settings
* Update Team members Change link
* Update Settings pages headings
2019-07-25 11:52:13 +01:00
Rebecca Law
cc29764d43 Update unit test for the content changes. 2019-07-24 12:03:30 +01:00
Chris Hill-Scott
45ae5b1782 Merge pull request #3041 from alphagov/delete-letter-contact
Let users delete letter contact blocks
2019-07-24 10:47:48 +01:00
Katie Smith
9dc13f1d8e Add new report to show monthly notification stats for each service
This report will be used by the engagement team. There is a form to give
a start and end date for the report, and the form is then downloaded
as a CSV file when the form is submitted.
2019-07-23 11:32:28 +01:00
Pea (Malgorzata Tyczynska)
1bd5ff1dfc Merge pull request #3057 from alphagov/new_org_types_part_1
Introduce new org types
2019-07-22 15:56:31 +01:00
Rebecca Law
e0bcad77f5 Remove ft from method name and url, it doesn't add any meaning. 2019-07-22 14:34:15 +01:00
Chris Hill-Scott
06bb0e997e Merge pull request #3056 from alphagov/spellcheck-email
Set autocomplete and spellcheck attributes on email field
2019-07-22 12:09:14 +01:00
Chris Hill-Scott
44d5dc44d3 Allow deleting default letter contact blocks
It’s possible to delete default letter contact blocks because there is a
fallback – having a blank letter contact block. This is different to SMS
senders and reply to addresses.

For this to make sense it also means:
- adding the ‘blank’ letter contact block to the list of letter contact
  blocks
- having a way of setting the default back to being blank
2019-07-22 11:57:11 +01:00
Chris Hill-Scott
17bf06d04c Let users delete letter contact blocks
Because they can delete email reply to addresses and text message
senders.
2019-07-22 11:57:11 +01:00
Chris Hill-Scott
19fd89a2ee Fix tests 2019-07-19 16:20:27 +01:00
Pea Tyczynska
eae1ccf607 Refactor following review 2019-07-19 16:10:55 +01:00
Pea Tyczynska
c8ed608c9a Only show nhs radios if user has nhs domain email
Also split local NHS into two groups following designer advice
on readability.
2019-07-18 17:07:42 +01:00
Chris Hill-Scott
2e78981648 Merge pull request #3054 from alphagov/remove-old-agreement-pages
Remove the user-specific agreement pages
2019-07-17 13:07:39 +01:00
Chris Hill-Scott
92ea5894bb Add autocomplete attribute to password fields
This helps the browser autocomplete them with the right thing.

Value based on https://www.w3.org/TR/WCAG21/#input-purposes
2019-07-16 17:15:17 +01:00
Chris Hill-Scott
30eeaec154 Add autocomplete to email address on register form
GOV.UK Design System recommends:
> You should also set the autocomplete attribute to email. This lets
> browsers autofill the email address on a user’s behalf if they’ve
> entered it previously.

Only doing this on the register and sign in forms because it’s unlikely
to be helpful where a user is trying to enter someone else’s email
address.
2019-07-16 17:14:49 +01:00
Chris Hill-Scott
88242c31d1 Don’t spellcheck email addresses
The GOV.UK Design System recommends:
> setting the spellcheck attribute to false so that browsers do not
> spellcheck the email address
2019-07-16 17:14:49 +01:00
Pea Tyczynska
77d281f44f Introduce new org types 2019-07-16 17:00:26 +01:00
Katie Smith
b6ebbe6f67 Add organisation_type property to Service model
This will return the organisation_type of the service's organisation (if
there is one), or the organisation_type of the service if not.
2019-07-16 11:36:19 +01:00
Katie Smith
53214937a8 Stop allowing the service org type to be changed
The service organisation type will either be the same as the org type of
the service's organisation or will be set by a user when creating a new
service. This removes the ability to change it from the platform admin
settings table.
2019-07-16 11:36:19 +01:00
Chris Hill-Scott
a256b9c33a Remove the user-specific agreement pages
We used to give users the right version of the agreement by guessing
their organisation from their email address.

Now we do it by looking at the organisation of the service they’re
looking at.

In other words, users should only be downloading the agreement as part
of the go live journey, not outside it. This is because we think that
users will get confused if they download the agreement and:
- find there’s nowhere to physically sign it
- think that accepting the agreement is all they need to do to go live

Maintaining two paths to download the agreement also makes the code more
complicated, and makes it harder to update the content on these pages.
2019-07-15 15:25:05 +01:00
Chris Hill-Scott
c17aa249dc Make query string comparison ignore order
Query string ordering is non-deterministic. This can cause tests to fail
in a non helpful way when we’re comparing two URLs. The values in the
query string can match, but the string won’t because the order is
different. This commit adds some code to split up the URL and check that
each part of it matches, rather than checking the thing as a whole.
2019-07-15 14:38:01 +01:00
Chris Hill-Scott
886992af17 Merge pull request #3043 from alphagov/add-first-letter-contact-experience
Make adding a ‘letter contact block’ for the first time make sense
2019-07-12 15:14:18 +01:00
Chris Hill-Scott
8307e31cb4 Merge pull request #3051 from alphagov/revise-thanks-wording
Make ‘thanks’ page consistent with support page
2019-07-12 12:04:41 +01:00
karlchillmaid
a68db38dd5 Update 'your message' 2019-07-12 11:43:54 +01:00
Chris Hill-Scott
e1c4e51995 Make ‘thanks’ page consistent with support page
On the support page we now promise that we’ll:
- look at tickets within half an hour
- reply within one working day

The thanks page was always promising a reply within half an hour, during
business hours or an emergency. This commit changes the ‘thanks’ page to
be consistent with the support page.
2019-07-12 11:43:32 +01:00
karlchillmaid
c8a3564329 Merge pull request #3050 from alphagov/contact-call-to-action-update
Make 'contact us' links consistent
2019-07-12 11:30:23 +01:00
Chris Hill-Scott
6cd69be66e Fix tests 2019-07-12 11:10:56 +01:00
Chris Hill-Scott
c9f76e427d Fix tests 2019-07-10 10:18:30 +01:00
Chris Hill-Scott
04144b55be Merge pull request #3044 from alphagov/count-orgs-and-services-on-choose
Add count of organisations and live services for platform admin user
2019-07-09 14:53:17 +01:00
Chris Hill-Scott
cca19df73c Stop JSONModel hiding attribute errors
`__getattr__` is called whenever an attribute error is raised.

This means that if something deep inside a property on a model raised
an attribute error, that error would be caught by `__getattr__`, which
would then raise an exception that looked like the property itself
didn’t exist. Very confusing.

The solution seems to be to override `__getattribute__` instead, which
handles _all_ attributes, not just those that aren’t explicitly defined.
We then only intervene if the desired attribute is one of the
`ALLOWED_PROPERTIES`, otherwise falling through to the built in methods
of the underlying `object`.
2019-07-09 14:06:49 +01:00
Chris Hill-Scott
6d5f542a88 Count of orgs and live services for platform admin
This makes it consistent that an option which contains more options has
a hint about how many options it contains.

Also adds a formatter to get us ready for 1,000 services 🎉
2019-07-08 12:31:31 +01:00
Chris Hill-Scott
7fef51aa6a Apply sender to template when adding
If you’ve come from a template to add a new letter sender then it’s
because you want those words on that template. This commit adds the
extra API call to make that happen.
2019-07-08 11:20:28 +01:00
Chris Hill-Scott
90f56353ab Always offer option to add new sender
Not sure why we had this logic. We shouldn’t make you jump over to the
settings page if none of the available options are right for this
letter.
2019-07-08 10:48:40 +01:00
Chris Hill-Scott
fe7c3259c2 Go straight to add if no contact blocks yet
Same as previous commit, but for going forward, not back.
2019-07-08 10:48:40 +01:00
Chris Hill-Scott
8e080d6079 Go back to template if coming from template
Most users don’t have multiple contact blocks. So by default it should
feel like you’re just editing the one contact block, rather than
managing a collection of them. So this page skips the ‘choose’ page when
the user doesn’t yet have any contact blocks.
2019-07-08 10:46:43 +01:00
Chris Hill-Scott
c709d7668e Merge pull request #3024 from alphagov/style-org-breadcrumb
Adjust type and spacing to accommodate organisation breadcrumb
2019-07-04 16:38:47 +01:00
Pea Tyczynska
0118787a56 Can't cancel letter job if job not processed yet
Also add more tests for showing or not the cancel those letters link

Also check if all notifications already in database

Upgrade delete button text logic to handle more cases

Also corrections following review
2019-07-04 14:44:22 +01:00
Pea Tyczynska
4a679a6583 Letter job can't be cancelled if already printed
Non-cancellable letter statuses mean that it's too late to cancel a job
2019-07-04 14:44:21 +01:00
Pea Tyczynska
ab953896ab User can cancel a letter job - happy path 2019-07-04 14:43:37 +01:00
Chris Hill-Scott
e731dd70d1 Use chevrons not slashes to separate folders
It looks weird to have two different visual treatments for showing a
navigable hierarchy.

I reckon losing the slash won’t make things less folder like – Windows
for example uses chevrons as foler separators.
2019-07-03 15:17:36 +01:00
Chris Hill-Scott
96bd0a55b2 Move the breadcrumb inside the link
Putting the background image on the preceding breadcrumb item will allow
us to replace it with a pseudo element in a subsequent commit.
2019-07-03 15:17:34 +01:00
Chris Hill-Scott
a91f0e0515 Merge pull request #3038 from alphagov/add-more-info-when-creating-org
Require more information when creating organisations
2019-07-03 14:10:44 +01:00
Chris Hill-Scott
08bc893ddf Redirect to new organisation after creation
The thing you want to do after creating an org is probably set some
domains or default branding, so let’s take you to the page where you can
do that.
2019-07-03 13:34:12 +01:00
Chris Hill-Scott
a6b3561cf7 Don’t create new organisations with no crown status
We need the crown status set so that we can let them accept the
agreement online.
2019-07-03 13:34:11 +01:00
Chris Hill-Scott
0916b2ba6b Require more information when creating organisations
Currently we set not-very-useful defaults for organisation type and
crown status when creating an organisation. This commit adds two field
to the form (in addition to the existing name field) to explicitly ask
for:
- organisation type
- crown status

We need these for all organisations before we can make any of their
services live.

This commit also records any new organisation as not having accepted the
data sharing and financial agreement, because if we don’t know about the
organisation already then they definitely won’t have signed it.
2019-07-03 13:34:11 +01:00
Chris Hill-Scott
b620b677d3 Have permissions decorators check user signed in
Rather than force us to write the decorators in a specific order let’s
just have one decorator call the other. This should make fewer lines of
code, and fewer annoying test failures. It also means that the same way
of raising a `401` (through the `current_app` method) is used
everywhere.
2019-07-03 09:54:35 +01:00
Chris Hill-Scott
3da9e84ece Enforce order of permissions decorators
At the moment we mostly have `user_has_permissions` execute first. It
shouldn’t matter, but it feels right for us to check that a user is
logged in before we check their permissions to a service. Otherwise a
malicious user could (maybe) check if a service ID belongs to a real
service, and go on to do something malicious with that information.

This commit adds some extra test code to enforce that the order is
always the same.

N.B. decorators in Python execute from closest to furthest (from the
line on which the function is defined).
2019-07-03 09:54:17 +01:00