Commit Graph

8803 Commits

Author SHA1 Message Date
Tom Byers
c1de4cc51b Explain .gitignore & .cfignore differences 2019-12-02 17:19:08 +00:00
Tom Byers
ccbad51ebd Move app/.gitignore entries to .gitignore
`app/.gitignore` existed to list anything that we
wanted ignored from the repository but not listed
in `.cfignore` (which just symlinked the
`.gitinore` at the root).

Now `.gitignore` and `.cfignore` are split, this
is no longer necessary.
2019-12-02 17:00:55 +00:00
Tom Byers
200a9d479a Add .pytest_cache to the deploy-exclude list 2019-12-02 17:00:55 +00:00
Tom Byers
3e1af6078f Remove app/templates/vendor from .cfignore
It's created by `npm run build` so needs to be
part of the code zipped up by
`make build-paas-artifact`.
2019-12-02 16:58:42 +00:00
Tom Byers
73b9807102 Replace .cfignore symlink with .gitignore
Instead of having `.cfignore` as a symlink to
`.gitignore`, have them as separate files,
with the same content.
2019-12-02 16:23:02 +00:00
Tom Byers
fcb806f380 Merge pull request #3212 from alphagov/remove-templates-vendor-folder
Add templates vendor folder to gitignore & delete
2019-12-02 15:17:21 +00:00
Tom Byers
c3d055a140 Add templates vendor folder to gitignore & delete
It was added by mistake in this commit:

3c208a8b11
2019-12-02 15:03:56 +00:00
Leo Hemsted
c0056c1d14 Merge pull request #3211 from alphagov/flake8-fix
Flake8 fix
2019-11-29 15:49:56 +00:00
Leo Hemsted
6ad9ec8d21 flake8 2019-11-29 15:25:37 +00:00
Leo Hemsted
d59c3abf2b combine flake8 configs
also, importantly, remove the `select` config, as this implicitly
ignores every other warning type
2019-11-29 15:25:37 +00:00
Chris Hill-Scott
5f9323f863 Merge pull request #3202 from alphagov/more-letter-validation-clean-up
Clean up more things to do with letter validation
2019-11-29 15:24:25 +00:00
Tom Byers
c30b5a25d4 Merge pull request #3207 from alphagov/fix-tests-console-output
Fix console output for JS tests
2019-11-28 16:07:15 +00:00
Tom Byers
5c11d89792 Fix console output for JS tests
The string identifying the tests run shouldn't
include their status, that's added by
`display_result`.
2019-11-28 15:26:24 +00:00
David McDonald
19bafd9caf Merge pull request #3206 from alphagov/healthcheck
Change http healthcheck invocation timeout to 10 seconds
2019-11-28 13:41:14 +00:00
David McDonald
f8dc3936fc Change http healthcheck invocation timeout to 10 seconds
We have seen multiple issues in production where healthchecks have
failed for our applications as responses have taken longer than 1 second
(the default health check invocation timeout) to respond and this has
marked the instance as unhealthy and restarted it. This restarting has
dropped inflight requests and caused 502s for our users.

We are not entirely sure why the healthchecks sometimes take longer than
expected. One hypothesis is large amounts of traffic slowing response
times of the apps, however we have also seen contradictory evidence
where health checks can still fail even when apps are getting very low
levels of traffic. There could also be an issue with the actual
healthcheck process itself.

Regardless of the cause, we think by changing the timeout to 10 seconds
it might stop our apps being restarted when they are infact still
healthy enough to serve requests to users. Further investigation will
also be done by the PaaS team into the health check process itself to
see if this throws any more light on the situation.

10 seconds was a fairly abritary choice that was significantly longer
than 1 second.
2019-11-28 13:35:54 +00:00
Tom Byers
b24a59f3ad Merge pull request #3205 from alphagov/more-fixes-for-move-to-govuk-frontend
More fixes for move to govuk frontend
2019-11-28 11:57:43 +00:00
Tom Byers
a4482ee734 Set font-family on buttons to NTA temporarily
Until we change all the buttons to use GOVUK
Frontend we need this CSS to give them the New
Transport (NTA) font-family.

Was previously in GOVUK Template CSS but missed
out from being moved across when this was removed:

f164b2825b/source/assets/stylesheets/_basic.scss (L6)
2019-11-28 11:38:45 +00:00
Tom Byers
f05f7b2661 Return main content area to position: static
Was set to `position: relative` to solve an issue
on the produce page. This introduced other issues
with the sticky JS and the fix is only needed for
the product page so this moves it to that CSS.

The previous fix was applied here:

9441dd0b37
2019-11-28 11:32:32 +00:00
Tom Byers
dea3f296ad Replace js-footer class on global footer
Was on old footer from GOVUK Template but not
moved across when we adopted the GOVUK Frontend
footer component.
2019-11-28 11:32:11 +00:00
Tom Byers
512094c52c Merge pull request #3204 from alphagov/replace-removed-govuk-template-anchor-focus-styles
Replace GOVUK Template anchor focus styles
2019-11-27 16:54:18 +00:00
karlchillmaid
133e75192a Merge pull request #3203 from alphagov/update-purchase-order-information
Update purchase order content
2019-11-27 16:47:38 +00:00
Tom Byers
fe3baa25c2 Replace GOVUK Template anchor focus styles
Not moved across when the GOVUK Template CSS was
removed.
2019-11-27 16:42:07 +00:00
karlchillmaid
317227e95b Update content 2019-11-27 16:35:57 +00:00
Chris Hill-Scott
37d844ba12 Clean up more things to do with letter validation
Missed these in https://github.com/alphagov/notifications-admin/pull/3201
2019-11-27 16:25:25 +00:00
Chris Hill-Scott
41113081f3 Merge pull request #3201 from alphagov/remove-letter-validation-preview
Remove the letter validation preview endpoints
2019-11-27 15:53:27 +00:00
Pea M. Tyczynska
5e60095584 Merge pull request #3200 from alphagov/finetune-letter-uploads-valdiation-failed
Add re-upload button and back link to the preview page
2019-11-27 15:17:19 +00:00
Chris Hill-Scott
e70dcadc76 Fine tune spacing under the _upload again_ button
This makes it match the upload CSV page which has 30px of space between
the button and the following heading.

bottom-gutter-1-2 = 15px
form-group = 15px

15px + 15px = 30px
2019-11-27 15:11:18 +00:00
Pea Tyczynska
02beccd066 Add re-upload button and back link to the preview page
Re-upload button is only shown if file failed validation.

Change wording of re-upload buttons

Make test we test right buttons on letter upload preview page

Also remove double backlink
2019-11-27 15:11:14 +00:00
Tom Byers
5e9837324a Merge pull request #3198 from alphagov/replace-govuk-template-for-govuk-frontend-third-attempt
Replace govuk template for govuk frontend third attempt
2019-11-27 14:42:03 +00:00
Chris Hill-Scott
b9de27d1c2 Remove the letter validation preview endpoints
We can use the ‘Uploads’ feature to check if letters are printable now.

This code works in a completely different way, so if we kept it we’d
have to maintain two different code paths, and make sure that they
didn’t diverge.

Also deletes the related HTML templates.
2019-11-27 14:28:42 +00:00
Tom Byers
39d955d93f Replace anchor style removed by mistake
Removed in:

c8de91c161
2019-11-27 14:15:32 +00:00
Tom Byers
eccd943c1a Rewrite URLs in CSS based on environment
Fix for issue that caused this revert:

https://github.com/alphagov/notifications-admin/pull/3196

Note:

gulp-css-url-adjuster operates on an Abstract
Syntax Tree (AST) derived from `main.css`. The
CSS output from this loses the compression
gulp-sass applies.

This moves compression out of Sass, to a step
after the URLs are adjusted.
2019-11-27 14:15:32 +00:00
Tom Byers
bc4e99ce2f Remove gitignore reference to govuk_template
This change was missing from the previous pull
request.
2019-11-27 14:15:32 +00:00
Tom Byers
3c208a8b11 Move GOVUK Frontend templates from node_modules
`node_modules` isn't available in a live
environment so the `.njk` templates we're now
using from GOVUK Frontend need to go in the repo'
code.

Adds them in a new `app/templates/vendor` folder
to match how we do that in
`app/assets/stylesheets`.
2019-11-27 14:15:32 +00:00
Tom Byers
34ef51980c Move global CSS to top of cascade
The global CSS we're keeping from the GOVUK
Template styles needs to go in the same position
as it was before, above GOVUK Elements.

This means we can't use any variables from GOVUK
Frontend in it so this changes the link colour
back to what it was (until all links get updated).
2019-11-27 14:15:32 +00:00
Tom Byers
bb9b7f9005 Switch to using gulp-better-rollup
Means our rollup bundling doesn't leave any
artefact files lying around that we'd then have to
deal with.

Also includes:
- removal of some JSHint config' marking the
  artefacts as scripts to ignore
- use of streamqueue package to allow the same
  ordering of scripts as before
2019-11-27 14:15:32 +00:00
Tom Byers
e1dc6ddaef Clean up JS files created by modules build
Any files left over can effect future builds.
2019-11-27 14:15:32 +00:00
Tom Byers
21f9ecfcda Make use of JS Modules less confusing
It's not obvious how the code that includes JS
Modules in the frontend build works.

This adds lots of comments to explain the various
bits and flattens `modules/all.mjs` to just be a
single function that starts off the window.GOVUK
namespace.

Also removes `module/all.js` from the repo'. It's
an artefact used by the frontend build so
shouldn't be included as source code.
2019-11-27 14:15:32 +00:00
Tom Byers
8890b7c4de Fix footer on smaller screens 2019-11-27 14:15:32 +00:00
Tom Byers
204a825f0b Put id back on cookie message for JS to hook onto 2019-11-27 14:15:32 +00:00
Tom Byers
cd877fe0db Add JS modules support & use for GOVUKFrontend
The JS for GOVUKFrontend components is available
individually so you can only include what you
need:

https://github.com/alphagov/govuk-frontend/blob/v2.13.0/docs/installation/installing-with-npm.md#option-2-import-javascript

This uses the JS Modules syntax:

*[JS module](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules)

Our JS is delivered as one file so we need to use
a bundler to convert the modules to a single file.

This adds a build step to transpile all modules
into a single file, which is then added to the
files combined into the one that get delivered.

Rollup is used as the simplest bundler to use for
this purpose. It also introduces the least
boilerplate JS.

Note: the CommonJS plugin is needed as GOV.UK
Frontend components are published as UMD modules.

In future, this work should let us work on this
story dependencies:

https://www.pivotaltracker.com/story/show/165380360
2019-11-27 14:15:32 +00:00
Tom Byers
f962ef9400 Put footer content back into prescribed columns 2019-11-27 14:15:32 +00:00
Tom Byers
ec72bcd00c Fix issues raised in pull request
Includes:
- replacing of conditional with statement that
  returns the same values
- making lins to GDS page actually go there
2019-11-27 14:15:32 +00:00
Tom Byers
ae27e94a35 Remove GOVUK Template files
Includes Sass that targeted GOV.UK Template HTML
and also moves some link styles to `globals.scss`.

Also removes bits of frontend build that copied
over GOVUK Template files.
2019-11-27 14:15:32 +00:00
Tom Byers
2ded09a8b9 Fix tests broken by GOV.UK Frontend template
Fix test broken by removal of GOV.UK logo image
- tests/app/main/views/test_notifications.py

Fix tests that ref GOV.UK template CSS files
- tests/app/main/views/test_index.py

Fix test broken by govuk-visually-hidden
- tests/app/main/views/test_send.py

Fix tests broken by header menu link -> button
- tests/app/main/views/test_service_settings.py
- tests/app/main/views/test_template_folders.py

Fix tests broken by removing div#content
- tests/app/main/views/accounts/test_choose_accounts.py
- tests/app/test_navigation.py

Remove references to GOV.UK CSS
- tests/app/main/views/test_index.py

Fix tests querying the header navigation
- tests/app/test_navigation.py
2019-11-27 14:15:32 +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
c06c8c0e5c Put basic print stylesheet back in
Replicates the GOV.UK template one, adjusted for
the GOV.UK Frontend template HTML.
2019-11-27 14:15:32 +00:00
Tom Byers
ab4ec7197a Put cookies message back in
The cookie_message block was part of GOV.UK
template but is not included in the GOV.UK
Frontend template.

This adds it back in along with JS to set the
cookies from GOV.UK template and styles, taken
from the Design System's website (which I assume
has the right colour contrast).
2019-11-27 14:15:32 +00:00
Tom Byers
e1b7042ea3 Add js-hidden class to globals.scss
It's used by the conditional content pattern
from GOV.UK Elements (which uses JS from the
GOV.UK Frontend Toolkit).
2019-11-27 14:15:32 +00:00
Tom Byers
a2075ecdd2 Replace removed global GOV.UK Template styles
GOV.UK Template included styles targeting elements
by their tag name, so affected all elements of
that type. Removing these files removes certain
styles from the top of the cascade.

Moving all components to GOV.UK Frontend (that are
possible) should fix this further down the
cascade. This adds them back to plug the gap in
the cascade until that work happens.
2019-11-27 14:15:32 +00:00