Commit Graph

456 Commits

Author SHA1 Message Date
Martyn Inglis
af713b1583 Removed flask config property lookup. 2016-01-10 21:38:53 +00:00
Chris Hill-Scott
86db5fa0b9 Make wording on 2nd-level pages match prev. commit 2016-01-08 17:17:34 +00:00
Chris Heathcote
11ea68e471 Wording changes on service settings page 2016-01-08 16:45:48 +00:00
Chris Hill-Scott
a289335661 Merge pull request #49 from alphagov/error-pages
Error pages
2016-01-08 15:13:44 +00:00
Chris Hill-Scott
4d10eec1e2 Rename submit_form component to page_footer
Submit form was
- a confusing name in itself
- not descriptive, because it also has an optional ‘back’ link

This commit also puts this component in as many pages as possible, stripping
out any hard-coded buttons and links.

It replaces any usage of buttons for ‘back’, because these are links, not
buttons (ie they don’t change any data).
2016-01-08 15:02:08 +00:00
Chris Hill-Scott
0b62d1e755 Add confirm loop
For pages where
- we want you to be sure that you want to do what you’re about to do
- we want to be sure it’s you trying to do the thing

This adds a page that asks the user to confirm their password.
2016-01-08 14:59:30 +00:00
Chris Hill-Scott
3989d1b576 Add pages for ‘service settings’ flow
Adds the pages and wires them together, so that it’s possible to click
through them.

The wording is not quite English, but attempts to be an rough description of
what the consequences are for each of the four actions.
2016-01-08 14:56:14 +00:00
Adam Shimali
1d038c1021 Better page title 2016-01-08 09:44:00 +00:00
Martyn Inglis
35fe1ae5a3 Live was set to debug mode 2016-01-07 16:24:10 +00:00
Adam Shimali
dfbcfa9d49 Removed redundant return of None 2016-01-07 16:12:29 +00:00
Rebecca Law
548d086cbf Merge pull request #47 from alphagov/integrate-logging
Integrated logging from the utils repo
2016-01-07 15:58:05 +00:00
Adam Shimali
479ecbd699 pep8 suggested name change 2016-01-07 15:55:55 +00:00
Adam Shimali
d64e3b81fb Add basic error pages 2016-01-07 15:54:05 +00:00
Rebecca Law
afd03ea5bf Merge pull request #46 from alphagov/add-useful-headers
Add some useful owasp suggested headers
2016-01-07 15:39:51 +00:00
Martyn Inglis
ef8964284c Integrated logging from the utils repo 2016-01-07 15:39:36 +00:00
Adam Shimali
78b8aed96b Add some useful owasp suggested headers 2016-01-07 13:58:38 +00:00
Nicholas Staples
7001d8261d Fix for security hole with setting session['user_id'] before second factor of authentication has been authorised. 2016-01-07 12:43:10 +00:00
Nicholas Staples
10c2978f85 Merge with master and test fix. 2016-01-06 17:17:02 +00:00
Nicholas Staples
0a4ea6ca2e Merge branch 'master' into provide_logout_link 2016-01-06 17:06:04 +00:00
NIcholas Staples
c7f130e503 Merge pull request #40 from alphagov/form_views_refactor
Form views refactor
2016-01-06 17:03:36 +00:00
Nicholas Staples
52df795743 Review fix. 2016-01-06 17:00:01 +00:00
Nicholas Staples
79c15ec9cf Code checks and all tests passing. 2016-01-06 16:51:35 +00:00
Nicholas Staples
5905229714 Logout functionality and test added. 2016-01-06 16:40:38 +00:00
Martyn Inglis
03d81e5b47 Unicoded the £ sign and the ' needed to render the job page. 2016-01-06 13:22:15 +00:00
Martyn Inglis
416fa30929 Make the £ string a unicode string 2016-01-06 12:57:09 +00:00
Nicholas Staples
34bf03bae2 Readded git submodules. 2016-01-06 12:36:04 +00:00
Nicholas Staples
546b0b68b2 Merge branch 'master' into form_views_refactor 2016-01-06 11:46:58 +00:00
Nicholas Staples
6fc39d1814 Add in macro import to our template, not govuk_template 2016-01-06 11:37:59 +00:00
Nicholas Staples
4a43163603 Removed redundancy of removed included macro. 2016-01-06 11:10:23 +00:00
Martyn Inglis
b9895a805c Added encoding to file 2016-01-06 11:03:29 +00:00
Nicholas Staples
921c10a1fa Merge with master. 2016-01-06 10:55:45 +00:00
Nicholas Staples
f2732eed14 Added back in span element in form. 2016-01-06 10:22:36 +00:00
Nicholas Staples
9d7c3566aa Removed validation check for unique mobile number on the system. 2016-01-06 09:54:10 +00:00
Chris Hill-Scott
84cdd2f4f0 Add Javascript feature detection for oninput
This commit adds a feature detection for the `oninput` event, which isn’t
supported in older browsers[1].

This means that the code that highlights placeholders will only be run in
browsers that support the `oninput` event.

1. http://caniuse.com/#feat=input-event
2016-01-06 09:39:42 +00:00
Chris Hill-Scott
74da3b1adf Use EcmaScript 6, w/ transpiling for compatibility
ES6 has some nice new features. Specifically relevant to this piece of
work are:

Arrow functions[1], whose `this` context is bound the value of `this` in the
current scope and can’t be overidden. The code is cleaner as a result, and
doesn’t need the addition of a bind polyfill for older browsers.

Template strings[2], which are similar to triple-quoted multi line strings in
Python. This means less fiddly and error-prone string concatenation.

This commit adds Babel[3] to the Gulp pipeline. This transpiles Javascript
written to the ES6 specification into code which is compatible with older
browsers that don’t understand ES6 syntax.

It also rewrites the gulpfile itself using some ES6 syntax, for the same reasons.

1. https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Functions/Arrow_functions
2. https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/template_strings
3. https://babeljs.io
2016-01-06 09:39:42 +00:00
Chris Hill-Scott
3ed415fb75 Enhance message textbox by styling placeholders
Users can add placeholders to their messages, eg

> …your vehicle ((registration number))

when the message is sent, this gets replaced with the data the user uploads, eg

> …your vehicle LC12 BFL

We reckon that it will be useful to see that the placeholder has been
recognised, ie that its syntax is correct, before uploading any data.

We reckon that the best way to do this is by styling it differently to the rest
of the text that the user types.

This is not a trivial problem. There are two possible ways to do it:

1 Write a Google Docs-style text rendering engine, which completely replaces
  the native HTML `<textarea>` with a custom control, and programme what should
  happen when the user types something that looks like a placeholder, or
  presses an arrow key, or makes a selection, or…
2 Leave the `<textarea>` in place, unmodified, and duplicate layers in front
  of/behind it to visually replace a placeholder with the blue lozenge

Unsurprisingly, this commit implements 2.

There are four layers. Each layer contains live-updated copy of the text in the
textbox, and each is styled differently:
- one layer behind the textbox to make the blue background
- the textbox itself
- a layer with the white text, which overlays the black text of the textbox
- a layer with an inner shadow to knock back the brackets

This is because of some interesting limitations:
- The text in the foreground and background must occupy the same physical space,
  so no deleting characters from the duplicated layers
- Words can’t be split up into multiple elements,
  eg `<span>((</span>regist…`:—this results in slightly different kerning to
  `((regis…`, which messes up the alignment of the layers
- The textbox can’t be completely overlapped with a block of colour, because
  the cursor disappears behind it. Trying to edit text when you can’t see the
  cursor is hard.

Implementation

Technically this makes use of Paul Hayes work on Javascript modules in the
GOV.UK frontend toolkit[1].

It also makes use of the `oninput` event to detect changes to the textbox’s
contents. This is much more performant than `onkeydown`, `onpaste`, etc. Without
it the delay between user input and the layers all updating is too slow and you
see misalignment of the layers.

1. https://github.com/alphagov/govuk_frontend_toolkit/pull/227
2016-01-06 09:39:42 +00:00
Chris Hill-Scott
ba48707371 Add routing and pages for managing templates
So that users can see what it the flow is like to:
- add new templates
- edit existing templates
2016-01-06 09:39:42 +00:00
Chris Hill-Scott
5e0777b696 Add messages to the current job’s history
This mocks out a data structure for a job’s messages, and renders this data:
- on the notification page, as a table, which links through to…
- …the page for an indidivual message
2016-01-06 09:39:42 +00:00
Chris Hill-Scott
5ec1978dcb Make data consistent from dashboard -> job
- adds a table of recent activity to the job page, which is shared by the
  dashboard page
- uses the same filename and message template as the first job shown on the
  dashboard
- sets the time of file uploads/message delivery/message sending to always
  match ‘just now’
2016-01-06 09:39:42 +00:00
minglis
503c931a0a Merge pull request #36 from alphagov/service-activity-flow
Service activity flow
2016-01-06 09:36:23 +00:00
minglis
a109c6e82b Merge pull request #34 from alphagov/quarter-width-nav
Make navigation column 1/4 width
2016-01-06 09:35:35 +00:00
minglis
13b700bd0d Merge pull request #33 from alphagov/node-based-asset-compilation
Use a Node-based tools for handling assets
2016-01-06 09:34:19 +00:00
Nicholas Staples
ecc3485d72 Merge conflicts with master. 2016-01-05 17:24:13 +00:00
Nicholas Staples
4fcc4efea2 Small comments. 2016-01-05 17:11:44 +00:00
Nicholas Staples
0ebacd6929 Refactor for code_not_received, sign_in, two_factor and verify. 2016-01-05 17:08:50 +00:00
Nicholas Staples
1f520116f0 Sign in view, form and template refactored. 2016-01-05 14:30:06 +00:00
Chris Hill-Scott
450c7aaeaa Remove log of activity from single notification
Having the full history of the message is more information than is necessary.
We should only show what stage the message is at, and the time that it reached
that stage.

We can do research later on to find out if users understand or care about the
different stages.
2016-01-05 13:31:54 +00:00
Chris Hill-Scott
cad5698754 Add big numbers to dashboard
A suggestion of what high-level information users might need on the dashboard
page.
2016-01-05 13:31:54 +00:00
Chris Hill-Scott
96c3291600 ‘Messages’ is a more human word than ‘notifications’ 2016-01-05 13:31:54 +00:00
Chris Hill-Scott
31e6e53d46 Make data consistent from dashboard -> job
- adds a table of recent activity to the job page, which is shared by the
  dashboard page
- uses the same filename and message template as the first job shown on the
  dashboard
- sets the time of file uploads/message delivery/message sending to always
  match ‘just now’
2016-01-05 13:31:54 +00:00