Commit Graph

56 Commits

Author SHA1 Message Date
Kenneth Kehl
14f70620f9 code review feedback 2023-12-20 10:26:14 -08:00
Kenneth Kehl
9855856aba fix flake8 2023-12-19 08:08:02 -08:00
Jonathan Bobel
af2da54ffc Decided not to use the template and include the USWDS alert one-by-one 2023-10-06 11:31:28 -04:00
Jonathan Bobel
fd196c6534 814 - Adding alert component to CSV error area 2023-10-05 16:20:37 -04:00
Jonathan Bobel
dedb41f67e Fixing styling issues on the send message flow 2023-09-15 12:26:31 -04:00
Jonathan Bobel
b1c6a768ec Committing before merge 2023-08-30 11:07:38 -04:00
Jonathan Bobel
a4fc40bcba Renamed components folder, put failing tests back in to get some assistance with those 2023-08-22 12:40:53 -04:00
Jonathan Bobel
348e29fb40 - Removed links to the gov uk stylesheets
- Deleted /stylesheets folder
- Removed sass build from gulpfile
- Changed gov links to usa links
- Changed other govuk styles, like breadcrumbs
- Changed name of uk_components file to us_components
- Fixed a few tests that broke on account of the changes
2023-08-08 16:19:17 -04:00
Jonathan Bobel
f266084ddb Test passed, good time to commit 2023-06-16 14:55:24 -04:00
Jonathan Bobel
f342e0fb6c Updating site to use USWDS styles (#509)
* Updated header and footer
* Updated fonts
* Moved files around and updated gulpfile to correct the build process when it goes to production
* Adjusted grid templating
* Added images to assets
* Update app/templates/components/uk_components/footer/template.njk

Co-authored-by: Steven Reilly <stvnrlly@users.noreply.github.com>
2023-06-06 15:28:24 -04:00
stvnrlly
ac1d5f0983 move vendored uk components to templates 2022-12-14 11:55:21 -05:00
stvnrlly
944715ac46 big commit with letters removal 2022-12-05 15:33:44 -05:00
Katie Smith
1860b2b690 Move back link above main content for straightforward cases
This moves the back link to be above the `<main>` tag by making use of
the new `backLink` block. This doesn't change the pages which are using
a back link as part of the `page_header` macro yet.
2021-08-03 11:28:15 +01:00
Chris Hill-Scott
24b579418f Replace message count macros with formatters
We prefer formatters now. Removing uses of the aliasing macro lets
remove it entirely.
2021-01-07 14:53:12 +00:00
Tom Byers
55a4ca6579 Remove set-to-string conversion from upload code
Also changes the allowed_spreadsheet_file_extensions
variable to allowed_file_extensions for
consistency.
2020-12-17 13:04:27 +00:00
Tom Byers
b8f8d743d5 Set accepted files for job spreadsheet upload 2020-12-16 14:48:10 +00:00
Tom Byers
8659e46828 Remove skiplink & fix table caption on bulk send
error pages

The skiplink in those pages is in the error summary
at the top. In this case, it seems redundant
because:
- it jumps to a section of the page just below it
- the section it would jump to is the only error
  on the page

Because of this, and because The Digital
Accessibility Centre (DAC) reported that the
skiplinks in these pages may not be needed, we
decided to remove it.

This commit also adds a prefix to the table caption to
indicate that it only contains the errors from the
CSV, not the rest of its contents.
2020-08-19 11:29:17 +01:00
Chris Hill-Scott
4df99bd27f Don’t allow paragraphs without class attribute
All paragraphs should have class="govuk-body", or be otherwise
custom-styled. This commit adds some extra checks to our test fixture
that looks for paragraphs that don’t have any styling. Our test coverage
is pretty good, so this should check almost all pages, and prevent
regressions.

I’ve done this in such a way that it can be extended for other elements
(e.g. links) in the future.
2020-05-29 17:11:01 +01:00
Chris Hill-Scott
f5649d72c9 Explain 3 required address columns
Our rules about address columns are relaxing, so that none of them are
mandatory any more. Instead you just need any 3 of the 7 to make a valid
address.

This commit updates our error messaging to reflect that.
2020-04-27 16:47:49 +01:00
Tom Byers
ee9f348ce4 Update all links to use GOVUK Frontend style
Includes:
- turning off :visited styles to match existing
  design
- swapping heading classes used to make links bold
  for the GOVUK Frontend bold override class
- adding visually hidden text to some links to
  make them work when isolated from their context

We may need to revisit whether some links, such as
those for documentation and features, may benefit
from having some indication that their target has
been visited.
2020-02-25 10:47:24 +00:00
Tom Byers
5b306dde4d Revert "Convert all links to govuk frontend" 2020-02-24 11:56:38 +00:00
Tom Byers
cd36182ea6 Update all links to use GOVUK Frontend style
Includes:
- turning off :visited styles to match existing
  design
- swapping heading classes used to make links bold
  for the GOVUK Frontend bold override class
- adding visually hidden text to some links to
  make them work when isolated from their context

We may need to revisit whether some links, such as
those for documentation and features, may benefit
from having some indication that their target has
been visited.
2020-02-20 09:11:26 +00:00
Tom Byers
e5bc33be84 Replace all existing back-links with component
Includes:
- all existing macros
- all imports for the existing macros
2019-12-03 13:13:21 +00:00
Tom Byers
c1b8fb7531 Replace all visually-hidden classes
These have been replaced:

https://design-system.service.gov.uk/get-started/updating-your-code/#helper-class-names
2019-11-27 14:15:32 +00:00
Tom Byers
e09d510ab8 Revert "Replace govuk template with govuk frontend components - rewrite" 2019-11-26 12:14:09 +00:00
Tom Byers
2bd7ce8cf6 Replace all visually-hidden classes
These have been replaced:

https://design-system.service.gov.uk/get-started/updating-your-code/#helper-class-names
2019-11-25 11:43:30 +00:00
Tom Byers
e02f94f238 Revert "Replace govuk template with govuk frontend components" 2019-11-25 10:37:35 +00:00
Tom Byers
c3b2d3c521 Replace all visually-hidden classes
These have been replaced:

https://design-system.service.gov.uk/get-started/updating-your-code/#helper-class-names
2019-11-22 17:45:45 +00:00
Chris Hill-Scott
3d2f7c3fcf Refine error messages and fix tests
Removing the word ‘duplicate’ because:
- it suggests that the whole column is the same, which it might not be
- it suggests that having duplicate column names is a problem, which is
  only true in the case of recipient columns

Reverts back to saying the column names ‘need to’ match, because we feel
it’s more instructive.
2019-10-03 14:24:28 +01:00
karlchillmaid
dd1ff2cbf4 Update button text 2019-09-27 12:03:10 +01:00
karlchillmaid
2e5b724adb Update error messages 2019-09-27 12:01:32 +01:00
karlchillmaid
05b2930826 Add 'some' for readability 2019-09-18 16:13:16 +01:00
karlchillmaid
592ab58f37 Update spreadsheet validation errors 2019-09-18 16:11:46 +01:00
Chris Hill-Scott
74fb30ce5f Add GOV.UK Design System style back links
The Design System has standardised on back links being at the top of the
page, decorated with a small text-coloured arrow.

I think this makes more sense than having them at the bottom, because it
suggests, in some way, being able to go back before commiting to any of
the forms on the page. Whereas the things at the bottom of the page
should be performing actions on what’s in the page.

The reason for making this change now is that it de-clutters the area
around the green buttons. This was presenting a design challenge where
multiple levels of interaction were happening in the same form. Moving
these back links to the top of the page should mean that, in these
complicated forms, there’s one fewer thing to compete for the user’s
attention.

I’ve componentised this into a `page_header` macro so that the change is
easier to roll out and maintain.
2019-04-30 15:29:39 +01:00
Chris Hill-Scott
88f9d156c7 Warn if a file has been sent already
We have some teams who haver a series of files they have to send each
day. It’s easy to get muddled up and accidentally send the same file
again, if you think you haven’t already sent it.

This commit blocks you from sending the same combination of template
version and filename more than once on the same day[1].

This won’t affect teams who re-use the same template to give (for
example) updates on an incident for business continuity. These teams
edit the template between each send, thereby updating the version
number of the template.

1. This is based on how the `limit_days` argument to the API works - you
can dig into the code here: 2bd4f74ad0/app/dao/jobs_dao.py (L50)
2019-02-04 14:44:54 +00:00
Chris Hill-Scott
8200514461 Fix double error border 2018-11-01 14:45:12 +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
ea6620083b Persist original file name when previewing row 2018-06-07 11:03:09 +01:00
Chris Hill-Scott
e74d408953 Allow users to preview all letters in trial mode
If you’re in trial mode you can’t send letters for real. But you can
still upload a spreadsheet with multiple rows, and there’s no reason why
you shouldn’t be able to explore how Notify populate the letter for each
row of the spreadsheet (since this is something we let you do when you
can send the messages for real).
2018-06-07 11:03:09 +01:00
Chris Hill-Scott
403d856fde Fix truncation message for large file
We do show the initial rows now.
2018-05-02 09:24:16 +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
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
a4424e999f Catch duplicate recipient columns in spreadsheets
If someone has duplicate recipient columns in their file we don’t know
which one to use. This commit adds an error message which should help
them fix the duplication.

This commit doesn’t go to the extra effort to actually show the
correct values for duplication in the preview. Don’t think it’s worth
the effort/complexity for how infrequently we’ve seen this error.

Depends on:
- [ ] https://github.com/alphagov/notifications-utils/pull/376
2018-03-02 13:18:04 +00:00
Chris Hill-Scott
c6f54966bf Change tables to scroll in-page, not full screen
There were three problems with showing tables fullscreen:
- it was over-optimised for very big spreadsheets, whereas most users
  will only have a few columns in their files
- it was jarring to go from full screen and back to the normal layout
- it was a bit change for existing users, where we prefer incremental
  changes that make things better without disrupting people’s work
  (where possible)

So this commit changes the big table to scroll horizontally in the page,
not take up the full width of the page.

From the fullscreen table it keeps:
- the shimming method to keep the horizontal scrollbar at the bottom of
  the screen at all times

It introduces some more refinements to make it nicer to use:
- fixing the first column, so you always know what row you’re on
- adding shadows indicate where there is content that’s scrolled outside
  the edges of the container
2017-12-20 12:09:18 +00:00
Chris Hill-Scott
eb395db2d6 Fix error when file has header rows but no data
Previously the error was saying ‘It needs at least one row of data, and
columns called None’.
2017-12-20 11:59:51 +00:00
Chris Hill-Scott
6995ddc8f5 Don’t list all letter address cols if some missing
If you’ve spelt ‘postcode’ wrong, or missed only ‘address_line_2’ then
it’s pretty noisy to be told that your file needs columns called address
line 1, address line 2, and postcode.

It’s better to be specific about which column you need to fix in order
to get past this error. As a principle, we’ve found it better to tell
get people to fix one error at a time, rather than overwhelm them with a
list of errors to correct – this is why we split the recipient column
errors out separately in the first place.
2017-11-10 10:10:34 +00:00
Chris Hill-Scott
4154dbba1f Only mandate mandatory address columns
If you miss ‘postcode’ from your file then you get told that you need
‘address_line_1’, ‘address_line_2’, ‘address_line_3’, etc.

This is incorrect – the only required address columns are lines 1 and 2,
plus the postcode. So this commit corrects the error message to be
factually accurate.

We had a user report this to Fajer as a bug.
2017-10-03 14:08:25 +01:00
Pete Herlihy
7a7e71ce5d Adding Using Notify to the footer links 2017-08-31 11:10:39 +01:00
Chris Hill-Scott
4ff674158c Ensure trial mode error overrides too many rows
Telling users that they can’t send to more than 50 recipients in trial
mode doesn’t apply for letters (they can’t send to _any_ recipients).

So we should make sure that the error message about not being able to
send to any recipients always comes up instead of the 50 recipients one,
whether you’re trying to upload a file with 1 or 111 rows.
2017-08-08 11:13:48 +01:00
Chris Hill-Scott
8f40cbd2bb Don’t let users in trial mode send letters
Users in trial mode haven’t signed the MOU. This means that they haven’t
agreed to pay for any costs they incur.

Unlike text messages and emails, we don’t give you any free allowance of
letters. Sending _any_ letters will cost the user money.

Therefore we shouldn’t let users who haven’t agreed that they will pay
for the service to incur costs by sending letters.

The pattern used for this is roughly the same as other trial mode errors
that we have already, ie a red box that says you’re not allowed. Not
sure if this is exactly right because it’s not exactly an error so the
pattern might feel too heavy-handed.

Getting this in place means we can turn letters on for users in trial
mode without worrying that they’ll accidentally send real letters, which
would result in:
- us having to absorb those costs
- some awkward conversations
2017-08-08 10:10:06 +01:00