Commit Graph

2056 Commits

Author SHA1 Message Date
Rebecca Law
c4fde48c53 Merge pull request #2005 from alphagov/3-years
Limit number of navigable financial years to 3
2018-04-04 14:42:19 +01:00
Chris Waszczuk
6153389e01 Revert "add pagination to inbox page" 2018-04-04 14:18:03 +01:00
Chris Waszczuk
628d8ac5a8 Merge pull request #1985 from alphagov/add-pagination-to-inbox-page
add pagination to inbox page
2018-04-04 13:15:29 +01:00
Chris Hill-Scott
ba9935c49e Remove ‘check’ page’s reliance on session
A of this commit’s parent we are storing `template_id` and
`original_file_name` in the URL. Getting them from the URL is better,
so the check page no longer needs to look for them in the session. This
commit removes the code that looks for these values in the session.
2018-04-04 11:37:43 +01:00
Chris Hill-Scott
3dab34cd38 Store template ID and original file name in URL
At the moment you can’t press refresh on the check page if there’s
errors. This is because the session gets cleared when there’s errors.
This is a bad user experience.

The data that this page is relying on (from the session) is:
- template ID
- original file name

Neither of these things need to be in the session because:
- they are not secret
- the user can modify them already (by choosing a different template or
  renaming their file locally)

So this commit additionally stores them in the URL.
2018-04-04 11:30:27 +01:00
Chris Hill-Scott
d75f89daf5 Limit number of navigable financial years to 3
Because more than 3 looks ugly.
2018-04-03 18:13:38 +01:00
Leo Hemsted
0dabd4ffc0 remove any old file upload data on sign in
if a user signs in again, clear their file upload data from any
aborted journeys from before, so that their cookies don't fill up

also add some temporary logging when the session starts getting full.
2018-04-03 14:58:50 +01:00
chrisw
50661faac0 add pagination to inbox page 2018-04-03 12:12:30 +01:00
Chris Hill-Scott
8fb909101b Reword the download agreement page 2018-04-03 10:58:48 +01:00
Chris Hill-Scott
becee15e1e Add logging for session not being set bug
This is so we can be alerted to it before our users alert us to it.
2018-03-29 12:07:37 +01:00
Chris Hill-Scott
e74d261ec3 Don’t store info about bad uploads in session
Because we now[1] store info about each file upload separately in the
session the session isn’t overridden every time you upload a file. This
is good because you can do multiple file uploads idempotently.

Generally we are cleaning up after ourselves because we pop anything to
do with that upload from the session. However there is an edge case: if
you never send the file then the info about the file stays in the
session in perpetuity[2]. This is generally happening when people are
uploading files that are impossible to send, ie ones that have errors.

So this commit makes two changes:

1. remove info about a file upload from the session as soon as we know
   that it contains errors
2. `POST` reuploads to the same endpoint as initial uploads because
   otherwise we need to keep info about bad uploads in the session,
   which would prevent us from doing 1.

1. https://github.com/alphagov/notifications-admin/pull/1968
2. or at least until the session is cleared by the user logging out
2018-03-29 11:56:53 +01:00
Chris Hill-Scott
dca5546cbd Only offer agreement download to non-crown for now
We don’t have the crown agreement in a nice downloadable format at the
moment.
2018-03-28 12:43:03 +01:00
Chris Hill-Scott
68292d2299 Add endpoints to serve the agreement
Rather than making users contact us to get the agreement, we should just
let them download it, when we know which version to send them.

This commit adds two endpoints:
- one to serve a page which links to the agreement
- one to serve the agreement itself

These pages are not linked to anywhere because the underlying files
don’t exist yet. So I haven’t bothered putting real content on the page
yet either. I imagine the deploy sequence will be:

1. Upload the files to the buckets in each environment
2. Deploy this code through each enviroment, checking the links work
3. Make another PR to start linking to the endpoints added by this
   commit
2018-03-27 11:35:17 +01:00
Chris Waszczuk
59803348a4 Merge pull request #1974 from alphagov/org-links-dont-show-if-user-doesnt-have-permissions
Org links don't show if user doesn't have permissions
2018-03-21 16:15:42 +00:00
chrisw
c47a4ab830 org links don't show if user doesn't have permissions 2018-03-21 15:23:01 +00:00
Chris Hill-Scott
0f8a6ca2fb Merge pull request #1969 from alphagov/no-free-text-from-url
Don’t populate support form with arbitrary text
2018-03-21 14:34:19 +00:00
Chris Hill-Scott
64b5f03dcd Don’t populate support form with arbitrary text
I don’t think it’s a massive risk (we’re certainly mitigating against
any XSS), but having a page on a GOV.UK domain where you can prefill
text on the page from a query string probably isn’t great.

So this commit restricts prefilling the support form to a set of
named questions.
2018-03-20 16:07:23 +00:00
Chris Waszczuk
5f65bb5e56 Merge pull request #1968 from alphagov/fixed-session-overriding-while-uploading-csvs-2
Fixed sessions overriding while uploading csvs
2018-03-20 13:45:33 +00:00
chrisw
287230acac fixed sessions overriding while uploading csvs 2018-03-20 12:15:17 +00:00
Leo Hemsted
e000552e56 redirect to show_accounts_or_dashboard on login
show_accounts_or_dashboard has logic about where you should redirect
to. If we let it do this, then that's nicer than duplicating its
logic. We found that it wasn't accounting for orgs in redirects
properly.
2018-03-19 16:41:16 +00:00
Leo Hemsted
90c40075c8 Merge pull request #1954 from alphagov/choose-accounts
Choose accounts
2018-03-19 15:26:06 +00:00
Chris Hill-Scott
cd3910556c Merge pull request #1960 from alphagov/dont-validate-across-channels
Don’t validate phone numbers when sending emails
2018-03-16 14:59:42 +00:00
Chris Hill-Scott
5a2fafb66b Don’t validate phone numbers when sending emails
If you have a placeholder called `((phone number))` in your email
template, and you try to send a one-off message then the form input will
attempt to validate your ‘phone number’.

This is not helpful if you’re trying to put a landline number in your
email, for example.

This only affects messages being sent through the one-off interface.

This commit makes the form be aware of template type, which fixes the
problem.
2018-03-16 14:17:43 +00:00
Chris Hill-Scott
c2bc7eca2c Make pricing page consistent in talking about MoU
We shouldn’t tell people on one page (the terms page) that we know about
their organisations agreement and then on the pricing page tell them to
contact us to find out what we know about the agreement.

So this commit adds the same logic from the terms page to the pricing
page, with wording that makes sense in the pricing context.
2018-03-16 13:10:40 +00:00
Leo Hemsted
666e77e699 redirect (301 MOVED PERMANENTLY) from old choose endpoints 2018-03-16 11:51:19 +00:00
Chris Hill-Scott
056c4ebb88 Rename GovernmentDomain to AgreementInfo
This better describes the data encapsulated by this class, and how we
are now using it.
2018-03-15 10:45:34 +00:00
Chris Hill-Scott
dd7fb71706 Merge pull request #1955 from alphagov/remove-mou-question
Clean up request to go live page
2018-03-15 10:25:24 +00:00
Chris Hill-Scott
1ce4c874ad Allow message to be prefilled on feedback page
So that people don’t have to remember what they are supposed to be
asking for and go to the effort of typing out the message.
2018-03-14 16:02:09 +00:00
Chris Hill-Scott
6c47375d9f Make terms page smarter about the agreement
People are emailing us asking if their organisation has signed the
agreement. In some cases they have, so this is a waste of their and
our time.

This commit adds a bit of logic to the terms of use page to tell users
when their organisation has already signed the agreement.
2018-03-14 16:00:59 +00:00
Leo Hemsted
5f2e0d4e49 organisations can be edited by anyone who belongs to that org 2018-03-14 15:39:55 +00:00
Leo Hemsted
d5108d0418 fix my awful rebasing skills 2018-03-14 15:39:55 +00:00
Leo Hemsted
a94fa5472d platform admins can go back to any service 2018-03-14 15:39:55 +00:00
Leo Hemsted
2f37e37278 rename choose_service to choose_account 2018-03-14 15:39:55 +00:00
Leo Hemsted
1cd8000236 remove browsableitem
it was only used by the choose service page, and then only in kludgy
ways (eg: creating a list containing one item called "add service"),
so lets rip it out and make this page bespoke. Especially now that it's
changed so much.
2018-03-14 15:39:55 +00:00
Leo Hemsted
dc5c3ba2b8 services-or-dashboard (name TBD) now redirects to orgs too
if there's a service in the session, go there.
if there's an org in the session, go there.
if the user has one service and no orgs, go there.
if the user has one org and no services, go there.
else go to choose service page
2018-03-14 15:39:55 +00:00
Leo Hemsted
b37613cbc6 show organisations on the choose-service page (name TBD)
layout as follows

```
ORG_1
  SERVICE_1
  SERVICE_2
--------------------
ORG_2
--------------------
SERVICE_3
SERVICE_4
--------------------
Add a new service...
```

* org 1 and 2 are organisations that the user has access to.
* Service 1 and 2 are part of org 1, AND the user has access to them.
  - There may be more services in org_1 that the user doesn't know
    about.
* Service 3 and 4 are services the user has access to.
  - They MAY be part of an organisation that the user does not know
    about. They can't be part of org_1 or org_2 tho.
2018-03-14 15:39:55 +00:00
Leo Hemsted
4fd0ce338c change org page to have org permissions rather than platform admin permissions 2018-03-14 15:39:55 +00:00
Leo Hemsted
ffd062c415 fix imports 2018-03-14 15:39:55 +00:00
Leo Hemsted
ad6e34eb43 dont use has_permissions to check for platform admins
platform_admin is a separate concept to permissions, so by removing the
checks for it from the current_user.has_permissions function, we can
simplify things greatly. We already record on the user whether they're
a platform admin anyway.
2018-03-14 15:39:55 +00:00
Chris Waszczuk
7b6520988c Merge pull request #1940 from alphagov/adjust-email-auth-token-error-message
Add catch for http error on invite token check
2018-03-14 10:43:16 +00:00
Chris Hill-Scott
a2544a4d79 Remove the MoU question from request to go live
This question was designed to make people feel like it was OK to submit
their request without getting the MoU signed. We reckoned that this was
the fastest way of getting their service live (because the MoU is the
bit that’s most likely to slow them down).

We now have a better way of telling people:
- if they’ve signed the MoU already
- or to contact us if they haven’t (which is what the majority of teams
  seem to do now)

We were never actually using the answer to this question – we were still
checking for every service whether they had it signed.

So this commit removes this now-redundant question.
2018-03-13 11:55:39 +00:00
Rebecca Law
3a604ff7d8 Merge pull request #1949 from alphagov/fix-inbound-search
Fix bug with inbound message page
2018-03-12 13:32:41 +00:00
Rebecca Law
58de759ef4 Fix bug with inbound message page
The get notifications endpoint needs the template_type for search. The inbox page for inbound sms messages was not passing that through, which caused a 400 response.
This resolves that by passing the template_type to the api.
2018-03-12 12:44:32 +00:00
kentsanggds
0d4bed1e55 Merge pull request #1946 from alphagov/ken-show-provided-as-pdf-for-precompiled-letters
Set template subject to Provided as PDF for precompiled letters
2018-03-12 10:47:05 +00:00
Chris Waszczuk
4b929aaa6c Merge pull request #1934 from alphagov/update-service-name
Update Organisation Name
2018-03-12 10:13:57 +00:00
Chris Hill-Scott
548ece6c22 Merge pull request #1925 from alphagov/refactored-csv-processing
Bring in refactored CSV processing
2018-03-09 15:16:37 +00:00
Sakis
aae04227a7 Merge pull request #1944 from alphagov/error-handling
Error handling
2018-03-09 14:33:34 +00:00
Richard Chapman
86a474ce8b Moved the call to retrieve the pdf into the is_precompiled_letter block
as it did not need to be called for standard letters.

Changed the tests to use the mock from get_notification_letter_preview
instead of a generic NotificationApiClient.get. This will hopefully
protect any subsequent changes or calls from not being tested in future.
2018-03-09 13:30:16 +00:00
Richard Chapman
e25c6cd3b9 Updated so that a precompiled pdf page count can be passed to the
rendering template. Currently it uses the template from the API to
calculate this which for a precompiled template is always 1.

Gets the PDF and then uses the utils method to get the page count.

* Added logic for precompiled letters
* Added test to test the new path
* Updated existing tests now the path has changed
2018-03-09 13:30:16 +00:00
Ken Tsang
89a04aa6a0 Set template subject to Provided as PDF for precompiled letters
- easier to change the text in Admin rather than do a database update on API and should be easy to change if the text should change in the future
2018-03-09 12:32:36 +00:00