Commit Graph

8068 Commits

Author SHA1 Message Date
karlchillmaid
edbb1ee1da Update app/templates/views/pricing/how-to-pay.html
Co-Authored-By: Chris Hill-Scott <me@quis.cc>
2019-07-08 16:08:34 +01:00
karlchillmaid
a6c455fe24 Update app/templates/views/pricing/how-to-pay.html
Co-Authored-By: Chris Hill-Scott <me@quis.cc>
2019-07-08 16:08:26 +01:00
karlchillmaid
05e38ecb78 Updated How to pay content 2019-07-05 12:01:21 +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 (Malgorzata Tyczynska)
dff20485b3 Merge pull request #3026 from alphagov/cancel-lettre-jobbe
Cancel letter job
2019-07-04 14:58:16 +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
b5db1ce61e Pull in latest utils 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
e751f57dc4 Merge pull request #3033 from alphagov/pyup-update-freezegun-0.3.11-to-0.3.12
Update freezegun to 0.3.12
2019-07-04 10:34:46 +01:00
Chris Hill-Scott
7901d08781 Style soft folder separators
If you can see a folder but not its parents we concatenate the
breadcrumb into one link.

This styles folder separators inside these links a bit differently to
make them do a bit less visual separation than the ones outside the
links.
2019-07-03 15:17:36 +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
acd992183c Use design system icon for breadcrumb
This is nicer because it’s drawn with CSS (so is resolution independent)
and is a bit darker to match the border colour (visually if not
actually).
2019-07-03 15:17:36 +01:00
Chris Hill-Scott
40fdf711e1 Use full width for folder heading if no manage link
If you don’t have permission to manage a folder we don’t show the link.
But we should also claw back the space that the link would have taken.
2019-07-03 15:17:35 +01:00
Chris Hill-Scott
b4dde3842e Make spacing below template folder heading even
It was a bit inconsistent depending on whether there was/wasn’t a search
box or channel tabs on the page.

I found this just too complicated to do in pure CSS, so added a new
spacing class which gets toggled on and off.
2019-07-03 15:17:35 +01:00
Chris Hill-Scott
003e926f27 Stop service name overflowing
This is just to stop it looking broken. 50% column width chosen to
maintain the rhythm of the grid.
2019-07-03 15:17:35 +01:00
Chris Hill-Scott
555b811fa7 Push headings down a bit
Now that there’s a bit more stuff in the service name area at the top
of the page it looks a bit cramped. Moving the heading down gives it a
bit more space to breath, and associates the heading a bit more closely
with the content after it.
2019-07-03 15:17:35 +01:00
Chris Hill-Scott
6338795e52 Make ‘switch service’ the same as ‘Change’ links
It looks inconsistent when the switch service link is 16px, right next
to a change link and organisation breadcrumb which is 19px.
2019-07-03 15:17:35 +01:00
Chris Hill-Scott
d382385b69 Make things line up
This commit aligns and spaces elements on the page to show which are
related to others.

This needs some adjustment now because we potentially have more things
on the page now – we need to make space for them.
2019-07-03 15:17:34 +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
27f1eeca0b Restrict max width of org and service name
Service names can be quite long. Organisation names can be quite long.
Together they can be very long. This isn’t great because:
- sometimes they overflow the width of the container, which looks broken
- even if they’re not that long they can make the UI look quite
  cluttered

This commit restricts them to widths that should stop the above from
happening. In the case of the organisation name the width has
specifically been chosen to line up with the ¼ and ¾ column grid
used by the navigation.
2019-07-03 15:11:42 +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
abd66f1e6e Merge pull request #3036 from alphagov/test-all-route-permissions
Ensure all service route have permission decorators
2019-07-03 14:08:37 +01:00
Chris Hill-Scott
038e6598b8 Merge pull request #3040 from alphagov/merge-test-requirements
Merge test requirements
2019-07-03 14:08:12 +01:00
Chris Hill-Scott
849a04d283 Freeze requirements 2019-07-03 13:52:58 +01:00
Chris Hill-Scott
d227ca11d5 Combine test-related Pyup changes 2019-07-03 13:48:28 +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
44a78d3cd1 Refactor create organisation code into model
So the view layer is cleaner.
2019-07-03 13:34:11 +01:00
Chris Hill-Scott
1c02e611e4 Use same layout as other organisation pages
So it feels consistent from moving from one page to another, rather
than jumping in and out of the platform admin view.
2019-07-03 13:34:11 +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
Chris Hill-Scott
91f2da8b68 Ensure all service route have permission decorators
We accidentally miss these sometimes. This code adds a test which
inspects the code to automatically check that any function which:
- handles a route
- accepts a service_id

For each function it checks that each of these routes have the
permissions decorator we’d expect.

Most of the introspection/AST code is adapted from here:
https://mvdwoord.github.io/exploration/2017/08/18/ast_explore.html
2019-07-03 09:47:20 +01:00
Chris Hill-Scott
14e9d763f1 Merge pull request #3039 from alphagov/quis-patch-2
Fix hard coded organisation name
2019-07-02 17:35:21 +01:00
Chris Hill-Scott
1f02a2d3ab Determine agreement by service not user’s org
A user might not have a guessable organisation type, even if the service
they’re working on does have an organisation set. This can happen for
users with @nhs.net email addresses, for example.
2019-07-02 17:22:36 +01:00
Chris Hill-Scott
5368ddabbc Fix hard coded organisation name
😳
2019-07-02 16:46:23 +01:00
Rebecca Law
3fc072af09 Merge pull request #3037 from alphagov/fix-org-invite
Fix a bug with inviting existing users to an organisation.
2019-06-28 11:06:52 +01:00
Chris Hill-Scott
6026ce3f8d Refactor model to put add_to… methods on user
An invited user can’t be added to an organisation or service, only a
real user can. So the methods to do this should be on the user model,
and take the details of the invite as arguments.
2019-06-27 15:48:29 +01:00
Rebecca Law
d344bc7006 Fix a bug with inviting existing users to an organisation.
The method to add the user to the organisation was missing the user id. This PR fixes that.
2019-06-27 15:34:23 +01:00
Chris Hill-Scott
305920733a Merge pull request #3019 from alphagov/sign-online
Allow online acceptance of the contract/memorandum of understanding
2019-06-27 15:26:41 +01:00
Chris Hill-Scott
fa5f3945bf Direct users to contact us if crown status unknown
If we’re not sure whether a user belongs to a crown organisation or not
we want to fix that before.

This is a last-ditch fallback because we shouldn’t be adding new
organisations without also setting their crown status.
2019-06-27 14:46:58 +01:00
pyup-bot
98d0aaa5ed Update freezegun from 0.3.11 to 0.3.12 2019-06-27 12:41:08 +01:00
Chris Hill-Scott
c260816213 Merge pull request #3027 from alphagov/add-permissions-to-missing-page
Fix a bug were the user_has_permission.
2019-06-27 12:40:47 +01:00
Rebecca Law
21c23c276f Fix a bug were the user_has_permission.
This is an immediate fix to add the permission checks to the callback page.
However, we have a plan to add a unit test to check for permission introspectively for all routes that have service_id.
2019-06-27 12:20:58 +01:00
Katie Smith
149003c52c Merge pull request #3022 from alphagov/dont-show-org-🍞crumbs-in-trial-mode
Don't show org breadcrumbs for trial mode services
2019-06-26 10:22:18 +01:00
Katie Smith
458b37d0aa Merge pull request #3025 from alphagov/bump-utils
Bump utils to add alt text to email branding
2019-06-26 10:22:10 +01:00
Katie Smith
a9ff4b1d48 Bump utils to add alt text to email branding
Utils 33.0.0 adds alt text to email branding - the HTMLEmailTemplate now
initializes slightly differently as a result (with both `branding_name`
and `branding_text`).
2019-06-25 16:56:45 +01:00
Katie Smith
f3ff7ee84d Don't show org breadcrumbs for trial mode services
Platform admin users can still see the organisation breadcrumbs for
trial mode services, but others uses can only see organisation
breadcrumbs for live services.
2019-06-20 16:58:53 +01:00
Chris Hill-Scott
0dddd0f5dc Merge pull request #3020 from alphagov/org-view-of-service-pages
Allow organisation team members to see team and usage
2019-06-20 15:53:36 +01:00