Commit Graph

2067 Commits

Author SHA1 Message Date
Chris Hill-Scott
549e48de49 Merge pull request #2434 from alphagov/send-one-off-letter
Let people send one-off letters from the admin app
2018-11-02 09:33:04 +00:00
Chris Hill-Scott
54bd321504 Make the example spreadsheet scroll horizontally
This replicates how we let large spreadsheets scroll horizontally.

Pro: this looks nicer and is more usable

Con: the code for this feels a bit fragile, especially the calling of
`.maintainWidth` twice, ie as many times as a it takes to get stuff to
render properly.
2018-11-01 15:31:14 +00:00
Chris Hill-Scott
8200514461 Fix double error border 2018-11-01 14:45:12 +00:00
Chris Hill-Scott
d6b785d3fa Style ‘Download PDF’ link 2018-10-31 14:29:38 +00:00
Chris Hill-Scott
1675e6c8d2 Show error banner for one off letter in trial mode
In trial mode you can’t send letters. But it’s still useful to be able
to build up a letter to see how it work.

Best place to put this error is before someone tries to send a letter
for real.
2018-10-31 14:25:49 +00:00
Chris Hill-Scott
a79dfd1d6e Always show download link for PDF
This feature is useful for people to try the letter thing out and see
how it feels, maybe print one on their own printer before incurring
cost.
2018-10-31 14:22:27 +00:00
Chris Hill-Scott
3a62946ecd Let people send one off letters
We didn’t used to allow this because it wasn’t really possible with the
old DVLA set up and we didn’t think there’s a need.

We think it’s possible now because, even though it’s cumbersome, it’s
better than the manual process.
2018-10-31 12:19:19 +00:00
Chris Hill-Scott
086b83d65b Merge pull request #2431 from alphagov/grid-invite
Fix misaligned elements on invite page
2018-10-31 10:09:12 +00:00
Chris Hill-Scott
1a87126bb3 Update pricing on page where you turn letters on
It didn’t match the new rates for 1st class.
2018-10-31 10:02:12 +00:00
Chris Hill-Scott
bf13ea021f Fix misaligned elements on invite page
This page doesn’t need a grid any more (everything goes full width).
2018-10-31 09:59:03 +00:00
Chris Hill-Scott
d26ddb48a7 Merge pull request #2423 from alphagov/make-service-model-wrap-more-things
Move more things from the view layer to the service model
2018-10-31 09:39:19 +00:00
Chris Hill-Scott
dea1ffa569 Merge pull request #2424 from alphagov/templates-page-spacing
Make spacing tighter on templates page
2018-10-31 09:39:00 +00:00
Chris Hill-Scott
1e2608d2e0 Refactor settings page to use service model
There’s a lot of code in service settings which:
- talks to the API directly through the clients
- passes that information through to the Jinja template

By encapsulating this logic in the service model:
- the Jinja template can access the data directly
- the logic can be reused across multiple methods
2018-10-30 15:07:52 +00:00
Chris Hill-Scott
526f2d7900 Use service model for the copy page
The view here is rebuilding a pseudo-service object. Now that service
objects have templates it’s cleaner to use the actual service object.

Requires a small change to the `templates_by_type` method so that it can
filter by one or many template types (a user should be able to copy any
template whose type is enabled for their service, and the service
they’re copying from).
2018-10-30 15:05:47 +00:00
Chris Hill-Scott
e1197c54a5 Don’t allow indexing on service model
Making people use a property is a sure way to make sure they’re spelling
the name of the property correctly, and allows us to easily swap out
properties that call through to the underlying JSON, and properties
which are implemented as methods.
2018-10-30 14:55:01 +00:00
Chris Hill-Scott
b48305c50d Don’t have service model inherit from dict
Inheriting from `dict` has some unexpected side effects that don’t
happen with plain object. The one we want to avoid right now is that
a dict doesn’t seem to implement `__dict__` in a normal way, which
is required by `werkzeug.utils.cached_property`.
2018-10-30 14:55:00 +00:00
Chris Hill-Scott
1e6b79a546 Put templates on service model
We do a lot of logic around choosing which templates to show. This logic
is all inside one view method.

It makes it cleaner to break this logic up into functions. But this
would mean passing around variables from one function to another.
Putting these methods onto a class (the service model) means that
there’s a place to store this data (rather than having to pass it around
a lot).

Making this code more manageable is important so that when we have
templates and folders it’s easy to encapsulate the logic around
combining the two.
2018-10-30 14:55:00 +00:00
Chris Hill-Scott
3caaf74c4a Split paragraph into two
There was an awkward line break in this text, and the line length was
too long because there was no grid on the page.

Splitting it into two paragraphs makes it:
- read nicer
- avoids any awkward line breaks
2018-10-30 13:11:50 +00:00
Chris Hill-Scott
d5d1f7394d Remove old API key and service ID combo
Once all our users have upgraded to the latest clients they won’t need
this. The latest clients only use the combined key and service ID.

Discuss: when can we safely remove it?
2018-10-30 10:01:37 +00:00
Chris Hill-Scott
846b927459 Make spacing tighter on templates page
The prototype for folders tightens up the templates page to fit more
templates on the screen. Partly because it looks better, and partly
because the sticky bottom toolbar means that there’s less available
space. So reducing the spacing means that roughly the same number of
templates fit on the screen.

For those who won’t see the checkboxes (people who don’t have the send
permission) or use folders, this just means that they’ll have slightly
less scrolling to do if they have a lot of templates.

Doing this before adding the folders so that:
- we roll out changes more gradually
- once we add the folders we can see if the spacing has stayed
  consistent
- changing where the margins are applied to resolve the inconsistent
  spacing when there is/isn’t tabbed navigation or a search box shown
2018-10-29 15:00:17 +00:00
Chris Hill-Scott
f1a9761ea1 Show letters that fail validation as cancelled
At the moment we show precompiled letters that have failed the
validation as having been sent. This is confusing.

We should communicate it as having been cancelled (rather than failed),
with the implication being that Notify has come along and cancelled the
letter before printing it. I think this is conceptually what makes the
most sense.

From the user’s point of view any letters that show up as cancelled
probably need to be fixed and resent, so it makes sense to group them
with the same name.
2018-10-29 12:13:33 +00:00
Chris Hill-Scott
bbb4b87cac Show count of cancelled letters on dashboard 2018-10-29 11:51:43 +00:00
Chris Hill-Scott
c01d761a3c Show if a letter has been cancelled
At the moment we are manually cancelling letters for people when they
ask us to. Once’s we’ve done this there is no indication that it’s
happened except for the date going red on the list of letters.

This commit adds some error messaging and styling to show when a letter
is cancelled.

Letting people cancel their own letters will be a future enhancement.
2018-10-29 11:51:41 +00:00
Katie Smith
ae79a3ac75 Add platform admin button for edit_folders permission
Added a platform admin button to allow / remove the edit_folders
permission for a service.
2018-10-25 12:09:26 +01:00
Pete Herlihy
285d91f5bc Updated service count to 410 and 127 orgs 2018-10-23 15:43:59 +01:00
Chris Hill-Scott
86b9ca6381 Make resend email page consistent
Its grid and copy weren’t consistent with the original page you see when you’ve first been sent the confirmation email.
2018-10-11 11:59:33 +01:00
Chris Hill-Scott
9bc0b6ecd4 Merge pull request #2370 from alphagov/service-count
Up to 393 services and 123 organisations
2018-10-11 10:25:04 +01:00
Leo Hemsted
2bd5ec6ec3 Merge pull request #2351 from alphagov/precompiled_validation_preview
Preview the validation of precompiled letters
2018-10-10 14:58:23 +01:00
Pete Herlihy
9a8b079413 Up to 393 services and 123 organisations 2018-10-10 14:11:59 +01:00
Pete Herlihy
acec8922c6 Update pricing for 1 October onwards - adding first class rates 2018-10-09 14:37:07 +01:00
Pea Tyczynska
3be129241f Add letter validation preview functionality
- add get/post view
- create a pdf upload form
- add a template where user can upload the file
- check boundaries of the letter by calling template-preview
- display banner messages with boundaries validation result
- display pages of the document, with visible boundaries overlay
if the document did not pass validation, and without overlay
if they do pass validation
2018-10-05 15:46:44 +01:00
Katie Smith
0d842d3700 Pluralize notification type correctly on usage page
This change makes sure that we display '1 letter' instead of '1 letters',
and '1 text message' instead of '1 text messages' on the usage page.
2018-10-03 15:15:19 +01:00
Katie Smith
4188c0297d Display letter postage on the usage page
The monthly letter cost was already broken down by price on the usage
page, but this change adds postage details to the usage page too.
2018-10-03 13:20:44 +01:00
Rebecca Law
2ac5926529 Fix page with missing import and added unit test. 2018-10-02 13:44:55 +01:00
Chris Hill-Scott
fde444a37a Fix missing page title on email branding page
It’s not a service-specific page so trying to set the service-specific page title does nothing.
2018-10-01 16:08:14 +01:00
Chris Hill-Scott
351a3dc4f3 Merge pull request #2314 from alphagov/validate-rtgl
Don’t trigger HTML5 validation on any form
2018-10-01 14:18:16 +01:00
Chris Hill-Scott
abac89ca2f Merge pull request #2329 from alphagov/remove-table-options
Remove redundant variable definition
2018-10-01 11:28:42 +01:00
Chris Hill-Scott
6de0374492 Merge pull request #2327 from alphagov/add-mou-to-checklist
Add line about the data sharing and financial agreement to the checklist
2018-09-26 16:33:13 +01:00
Chris Hill-Scott
c251c1326e Remove ‘Download the’ call to action
Users come to this page from various places, including the new 'Sign
the…' link on the request to go live page.

Of these users:
- some won't have signed it
- some will have signed it
- some will see that it's complete and wonder why, as they haven’t
  actually done anything

So it’s more appropriate for the title of this page to be descriptive,
rather than an action.
2018-09-26 16:14:50 +01:00
Chris Hill-Scott
3fa877bdd3 Make wording around agreement more straightforward
We think that the next page explains the nuance around service vs
organisation sufficiently well.
2018-09-26 10:37:30 +01:00
Chris Hill-Scott
901b924e35 Remove redundant variable definition
This unused variable is a hangover from when the permissions
were displayed horizontally in a table.
2018-09-25 17:00:54 +01:00
Pea (Malgorzata Tyczynska)
6d32d8b756 Merge pull request #2324 from alphagov/state_postage
Display postage on letter notification page
2018-09-25 13:36:34 +01:00
Pea Tyczynska
d982385042 Change wording following content review 2018-09-25 11:05:32 +01:00
Chris Hill-Scott
5dd45da08c Add line about MOU to checklist
2/3 of our incomplete requests to go live are incomplete because the
Data Sharing and Financial Agreement isn’t signed.

We reckon we can be pushier about this by saying it’s ‘incomplete’ where
we know the agreement is signed.

Where the agreement is signed we should confirm this, rather than make
the line disappear. This is so it makes more sense to someone who sees
it as ‘incomplete’, signs it, then comes back to the page.

If we don’t know whether or not the agreement is signed we should wait
until someone has got in touch with us by requesting to go live to
figure it out. So that’s why we’re not showing that line at all.
2018-09-25 10:33:50 +01:00
Chris Hill-Scott
c2ef522986 Make task list read better for screen readers
This duplicates how the task list pattern is coded in the GOV.UK
Prototype kit[1]. It adds ARIA attributes and the use of a
semantically-meaningful element (`<strong>`) to give more information to
screen reader users.

1. https://govuk-prototype-kit.herokuapp.com/docs/templates/task-list
2018-09-25 10:31:40 +01:00
Chris Hill-Scott
45b1b11abb Refactor go-live readyness into service model
All this info is info about the service. So it’s better to put it on
the service model because:
- encapsulation
- later reuse
2018-09-24 14:52:30 +01:00
Pea Tyczynska
64f356d7b0 Display postage on letter notification page 2018-09-24 11:29:33 +01:00
Katie Smith
fee47aa348 Hide Postage setting when letters are not enabled for service
We don't show the sender addresses and letter branding on the settings page
if a service doesn't have letters enabled, so we should also hide the
postage for services that can't send letters.

(Postage can only be seen by Platform Admin users at the moment, but this will
change later).
2018-09-20 15:46:32 +01:00
Katie Smith
2726467fc7 Minor quote and heading fixes 2018-09-19 16:53:31 +01:00
Chris Hill-Scott
d9da219b7e Use a macro for form tags
This will stop us repeatedly forgetting to add `novalidate` and
`autocomplete='off'` to our forms (which is how most of them are set
up).

It uses sensible defaults, based on how we most-commonly configure
forms:
- most of our forms are `post`ed (but this can be overridden)
- `autocomplete` should only be enabled where it makes sense, otherwise
  it’s more annoying than useful (but this can be overriden)
- we should never be using HTML5 form validation because our own error
  styles and messages are better
2018-09-19 12:43:15 +01:00