Commit Graph

12 Commits

Author SHA1 Message Date
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
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
8bfb67c702 Go fullscreen for row-level errors in spreadsheets
Two bits of context:

1. As we start dealing with letters, which have more columns, it’s more
   likely that people’s spreadsheets won’t fit in our current layout.

2. We already removed the view of the template from the page that shows
   row-level errors (eg bad phone number or missing personalisation) in
   spreadsheets because you don’t need to know about the content of the
   message in order to fix the errors.

This commit goes further by removing anything that isn’t to do with
the errors, including the normal GOV.UK header and the service’s
navigation.

This means the content can go the width of the page, which means it can
be allowed to scroll horizontally without being a usability car
crash. Which means that the layout doesn’t break with a spreadsheet that
has lots of columns.
2017-12-20 12:09:18 +00:00
Chris Hill-Scott
5b4a4ea1b1 Remove message preview from row error page
Two reasons to remove this:

1. It’s potentially confusing because you’ll see a preview of the first
   message, but the first row might not appear in the table shown on
   screen if it doesn’t have any errors.

2. If there are row-level errors in your file then they’re not related
   to the template – it’s a distraction.
2017-08-14 15:59:09 +01:00
Chris Hill-Scott
5c872e7936 Put file name in error message
‘Your data’ sounds ambiguous and computery. Using the name of the file
is better because it’s a thing you know about.
2017-08-14 15:57:51 +01:00
Chris Hill-Scott
25e7015537 Remove stuff about test jobs on row errors page
The send yourself a test flow doesn’t reference any kind of
file/rows/table in the front end any more, and doesn’t create a CSV in
the background (except for letters). And it should validate any mistakes
before getting to the check page.

So any user doing a send yourself a test flow should never get to this
template, which means we can remove some redundant code.
2017-08-14 15:56:05 +01:00
Chris Hill-Scott
849b3737be Track errors in analytics on multiple row errors
Accidentally missed out on adding the tracking code to this particular
error message.
2017-08-14 15:55:19 +01:00
Chris Hill-Scott
82233340b6 Track errors when uploading spreadsheets
Uses the new javascript event tracking stuff so that we can see what
errors people are getting when they upload spreadsheets.
2017-07-20 12:06:15 +01:00
Chris Hill-Scott
56945565ba Don’t indent column headings if no row errors
The reason to indent the first column heading is so that the number 1
lines up with the numbers of subsequent rows.

This only happens when the subsequent rows are indented because of the
red bars. This is only when there are row errors, not when there are
more general errors.
2017-07-20 12:01:59 +01:00
Chris Hill-Scott
94bc8191ae Remove irrelevant stuff from error check pages
If you have errors in your file then there’s stuff you’re not going to
see on the page. So this doesn’t need to be in the Jinja templates that
are only used when there are errors.

Basically the conditional stuff is moving up to the level above these
templates.
2017-07-20 11:56:37 +01:00
Chris Hill-Scott
ddeed88210 Refactor check page into 3 separate templates
The check page is a very complex Jinja template. It needs breaking up
to make it easier to understand what’s going on.

I think there are three di
2017-07-20 11:47:04 +01:00