Commit Graph

5382 Commits

Author SHA1 Message Date
Leo Hemsted
60a79131e6 Merge pull request #1941 from alphagov/rtgl-org-info
Add what we know of agreements to go live request
2018-03-09 12:20:57 +00:00
Leo Hemsted
34d039d85a Merge pull request #1945 from alphagov/org-invite-api-fix
fix org invite api client
2018-03-09 12:18:25 +00:00
Leo Hemsted
7771410873 Merge pull request #1943 from alphagov/fix-miscounted-users
Fix count of users on request to go live
2018-03-09 12:18:15 +00:00
Athanasios Voutsadakis
7828afe0d7 Sort requirements 2018-03-09 11:56:34 +00:00
Leo Hemsted
09f7de8015 fix org invite api client 2018-03-09 11:45:20 +00:00
Chris Hill-Scott
240f11e715 Fix count of users on request to go live
We were counting users who had the `manage_settings` permission. This
is the old name for it, therefore there would never be any users with
this permission, so the tick would never go green.

The new name for the permission is `manage_service`. This commit fixes
the error, and adds an extra safeguard against something like this
happening again.
2018-03-09 10:52:13 +00:00
Athanasios Voutsadakis
440f1bdc7c assets' 413.html is not used anymore 2018-03-09 10:51:48 +00:00
Athanasios Voutsadakis
1764499a25 Merge branch 'master' into error-handling 2018-03-09 10:17:17 +00:00
Chris Hill-Scott
5d4fc23128 Merge pull request #1931 from alphagov/letter-status-colour
Don’t change colour of sent date for letters
2018-03-09 09:51:40 +00:00
Chris Hill-Scott
ed5f2e5e62 Merge pull request #1936 from alphagov/quis-patch-1
Fix typo
2018-03-09 09:51:33 +00:00
Chris Hill-Scott
6e869bfdef Merge pull request #1909 from alphagov/request-to-go-live-automation
Add a checklist to the request to go live page
2018-03-09 09:51:27 +00:00
Athanasios Voutsadakis
249ae41c24 Add error handling
This adds an /error/XXX endpoint that triggers the corresponding XXX
error code and its handling.

Related: https://github.com/alphagov/notifications-aws/pull/331
2018-03-08 17:49:08 +00:00
Chris Hill-Scott
d92ecc9237 Add human-readable form of a government domain
This makes it easier to write a good message in the request to go live
submission. And encapsulating it in the `GovernmentDomain` class keeps
the view nice and clean.
2018-03-08 16:50:18 +00:00
Chris Hill-Scott
ce704a979d Add what we know of agreements to go live request
When we process a go live request it’s a pain to have to go fishing in
the Google Drive to see if there’s a signed agreement in there. This
should make it easier when we know there’s already an agreement.
2018-03-08 16:48:43 +00:00
Chris Hill-Scott
57a77318c9 Merge pull request #1939 from alphagov/ons-no-on
Add alternative ONS domain
2018-03-08 16:10:20 +00:00
kentsanggds
d11fafdf0d Merge pull request #1926 from alphagov/ken-remove-link-from-preview-precompiled
Remove link from preview precompiled view and dashboard
2018-03-08 15:28:47 +00:00
Chris Hill-Scott
b0278c5649 Refactor to put user logic inside class 2018-03-08 15:26:55 +00:00
chrisw
a4a3472191 add catch for http error on invite token check 2018-03-08 14:36:31 +00:00
Chris Hill-Scott
f6f5faa361 Bring in refactored CSV processing
Shouldn’t be any functional changes here, just things being named more
clearly.
2018-03-08 13:30:20 +00:00
Chris Hill-Scott
59fd55432c Add alternative ONS domain 2018-03-08 12:59:37 +00:00
kentsanggds
2e170a00ba Merge pull request #1938 from alphagov/letter_preview_use_api_not_template_preview
Letter preview use api not template preview
2018-03-08 12:57:50 +00:00
Ken Tsang
8857b4ab80 Fix preview image location 2018-03-08 12:35:35 +00:00
Ken Tsang
4628b99445 Refactor to move preview logic to API
* Moved the notifications code to go to admin to get the the template

preview document rather than go to template preview.

This will remove the logic from admin and place it in api so it is
easier to expand on later when there are precompiled PDFs

* Added some error handling if API returns an API error.

Caught the error and displayed an error PNG so it is obvious something
failed. Currently it displayed a thumbnail of a png over the top of the
loading page, and therefore it wasn't obvious of the state.
2018-03-08 12:25:07 +00:00
Chris Hill-Scott
99ff30d3b3 Fix typo 2018-03-08 10:30:57 +00:00
Ken Tsang
1d5f8ce15e Remove template link from precompiled letters from dashboard 2018-03-07 23:13:36 +00:00
Ken Tsang
bcf86239c6 Remove template link from preview for precompiled letters 2018-03-07 23:13:36 +00:00
Chris Hill-Scott
61b8c9040a Merge pull request #1933 from alphagov/fix-letter-borders
Fix border around letter images
2018-03-07 16:28:46 +00:00
Chris Hill-Scott
b8373329e9 Merge pull request #1935 from alphagov/public-sector-pricing
Updated the pricing page to reflect public sector pricing
2018-03-07 16:28:38 +00:00
Chris Hill-Scott
9ed5ba165b Merge pull request #1919 from thomchambers/patch-4
Update Pricing content
2018-03-07 16:28:31 +00:00
Chris Hill-Scott
3811e87165 Merge pull request #1920 from thomchambers/patch-5
Update Using Notify content
2018-03-07 16:28:24 +00:00
Chris Hill-Scott
8aebe4f717 Merge pull request #1928 from alphagov/pyup-update-freezegun-0.3.9-to-0.3.10
Update freezegun to 0.3.10
2018-03-07 16:27:18 +00:00
Chris Hill-Scott
ebc6772869 Merge pull request #1927 from alphagov/pyup-update-pytest-3.4.1-to-3.4.2
Update pytest to 3.4.2
2018-03-07 16:27:10 +00:00
Pete Herlihy
2c675a3746 Updated the pricing page to reflect public sector pricing 2018-03-07 15:15:21 +00:00
chrisw
e32cb5df31 update organisation name 2018-03-06 17:28:04 +00:00
Chris Hill-Scott
6d3da2d91f Merge pull request #1924 from alphagov/pyup-update-coveralls-1.2.0-to-1.3.0
Update coveralls to 1.3.0
2018-03-06 16:11:54 +00:00
Chris Hill-Scott
152b1f5256 Fix border around letter images
Things in CSS stack top to bottom like this:
- image
- `box-shadow`
- `background`

We are drawing the border around the letter using `box-shadow`. This was
working fine because the images of our letters had a transparent
background, so you could see the border through them.

At some point our letters have changed to have a white background. So
you can no longer see the border.

This commit:
- adds a new pseudo element which stacks above the image of the letter
- moves the border from the image itself to said pseudo element
2018-03-06 15:50:56 +00:00
Chris Hill-Scott
dde4191e9f Merge pull request #1932 from alphagov/commas-in-columns
Prevent cells containing commas breaking downloads
2018-03-06 15:36:37 +00:00
Chris Hill-Scott
35f523c957 Prevent cells containing commas breaking downloads
If a cell in the original file contains a comma, it comes back as two
cells in the downloaded file.

The CSV writer has logic to deal with this. It seems to work a lot
better that just concatenating the columns with commas ourselves.
2018-03-06 15:11:59 +00:00
Chris Hill-Scott
8f40574c83 Merge pull request #1930 from alphagov/revert-1918-letter_preview_use_api_not_template_preview
Revert "Letter preview use api not template preview"
2018-03-06 14:28:13 +00:00
Chris Hill-Scott
4384c1df15 Merge pull request #1929 from alphagov/show-download-letters
Show CSV download link for letter jobs
2018-03-06 14:28:00 +00:00
Chris Hill-Scott
d90cdc1f81 Don’t change colour of sent date for letters
For text messages/emails it makes sense for ‘sending’ to be gray and
‘delivered’ to be black. But since we don’t show sending/delivered for
letters it doesn’t make sense for the text to change colour.
2018-03-06 13:51:50 +00:00
Rebecca Law
bc731ec54d Revert "Letter preview use api not template preview" 2018-03-06 13:47:43 +00:00
Leo Hemsted
92b4cee033 Merge pull request #1917 from alphagov/permissions-refactor
Permissions refactor
2018-03-06 13:21:17 +00:00
Leo Hemsted
3be4b57bbd fix imports 2018-03-06 13:10:37 +00:00
Leo Hemsted
793d79c242 ensure invited user permissions show up correctly 2018-03-06 13:08:07 +00:00
Leo Hemsted
7f268c0ab3 don't allow us to create permissions decorator without permissions
ie: not for an organisation, and not for a service
2018-03-06 13:08:07 +00:00
Leo Hemsted
d14f33ea70 has_permissions() now checks user's orgs for <org_id> view args
view args are parameters within the route. for example,
`/organisation/<org_id>/users`. If there is an org_id, then check that
the user is part of that organisation (users.organisations is a list of
all orgs that user is a member of).

* platform admins ignore this check if restrict_admin_usage=False
* if an endpoint has both org_id and service_id, org_id takes
  precedence, but we should probably revisit this if we ever need
  to create such an endpoint.
* you now call `@user_has_permissions()` with no arguments for
  organisation endpoints - we can look at this if we decide we want
  more clarity.
* you should never call user_has_permissions without any arguments
  for endpoints that aren't organisation-based. We'll raise
  NotImplementedError if you do.
2018-03-06 13:08:07 +00:00
Leo Hemsted
3d589887ce remove useless properties from user model
we don't need them to mask private variables if we're not doing anything unusual.
2018-03-06 13:08:07 +00:00
Leo Hemsted
8acf5115d5 add restrict_admin_usage flag to more of the send flow 2018-03-06 13:08:07 +00:00
Leo Hemsted
3afc193624 remove any_ from has_permissions
we branch on any_ to either say "require ALL these permissions" or
"require ANY of these permissions". But we only ever call the decorator
with one permission, or with any_=True, so it's unnecessary
2018-03-06 13:08:07 +00:00