Commit Graph

7492 Commits

Author SHA1 Message Date
Tom Byers
a4bca73b80 Make Jenkins use Node 10 2019-04-12 15:36:57 +01:00
Tom Byers
4766390f17 Remove gulp-load-plugins
It's not being updated at the moment and has a few
vulnerabilities listed against its dependencies.
2019-04-12 15:36:57 +01:00
Tom Byers
a8a29698cb Replace gulp-base64 with gulp-base64-inline
The gulp-base64 package has 11 dependencies with
vulnerabilities listed against them as of this
time. It also doesn't seem to be maintained any
more. The last commit was in 2015 and there are
issues and pull requests up to bump the
dependencies.

This replaces it with gulp-base64-inline.

gulp-base64-inline takes a single path, which it
prepends to any image paths it finds. Our image
paths are actually URLs, not filesystem paths so
we need to send it a relative path to repoint the
URL.

This commit includes changes that remove a few
`@import`s from one of our sass partials.

They aren't needed as those files are imported
further up the stack and `_typography.scss` has an
import in it that overwrites the new
`_url-helpers.scss` we added here.
2019-04-12 15:36:57 +01:00
Tom Byers
fa851dcfec Bump remaining NPM packages used on client-side
Means that only the following packages will now be
out of date:

1. govuk_template_jinja
2. jquery

Reasons:

GOVUK Template Jinja

This bumps it to 0.24.1, after which the only
changes are to add analytics tracking to the
GOV.UK logo and cookie banner.

We don't need to track either of these and they
were added for GOVUK analytics work.

jQuery

jQuery stops supporting IE<9 after version
1.12. This is pretty much our support now but if
we move to IE>8 we shouldn't do it by bumping the
version. This would just increase the amount of
broken JS we ship to IE8.

Also: both are deprecated and we will move off
them in the near future.
2019-04-12 15:36:57 +01:00
Tom Byers
01b97986f6 Update diff-dom package to 3.1.0
Since it moved to ES Modules in version 2.3.1,
diff-dom stopped including the `diffDOM.js` file
in its NPM package.

We don't do any kind of bundling in our build yet,
just concatenation of our scripts and some
minification of the results so we can't take
advantage of this yet.

The `diffDOM.js` file is still available in the
Github release so this moves to referencing that
in the `package.json` instead, until we start
using a bundler.

I opened an issue to check this is what the author
intended:

https://github.com/fiduswriter/diffDOM/issues/84

The latest version also adds Rollup as a peer
dependency.
2019-04-12 15:36:57 +01:00
Tom Byers
05f3cb6797 Bump JSHint 2019-04-12 15:36:57 +01:00
Tom Byers
fed3381209 Bump Babel to 7.4.0
Requires replacing `babel-preset-es2015` for
`babel-preset-env` as Babel switched to this as of
version 6:

https://babeljs.io/docs/en/babel-preset-es2015

Note: this also moves all Babel packages to using
the scoped packages syntax, descended from the
`@babel` namespace.

https://docs.npmjs.com/about-scopes
2019-04-12 15:36:57 +01:00
Tom Byers
71463182f1 Stop using Babel to transpile gulpfile
Bumping NodeJS to 10.15.3 removes the need to
transpile `gulpfile.js` as this version includes
all the ES6 features used..

Also removes .babelrc file. This was included to
ensure the gulpfile was transpiled correctly so it
is no longer needed.
2019-04-12 15:36:57 +01:00
Tom Byers
b83053ddd1 Fix sass-lint
Sass-lint was bumped when gulp-sass-lint was
bumped. This brought in a new version which
changed the interface of `sassLint.format`.

It doesn't look like the `sassLint.format` method
ever defined any arguments or did anything with
the `arguments` variable. That being the case, our
sending it an instance of the 'stylish' ESLint
reporter did nothing in the previous version but
this wasn't obvious because sass-lint defaults to
'stylish' for its output styling.

The latest version (1.4.0) introduced an argument
of a writable stream which, if defined, will be
used to write the output to. This caused a problem
with our sending in the instance of 'stylish'.

This moves the selection of stylish into the
sass-lint config, as described in the
[sass-lint docs](https://github.com/sasstools/gulp-sass-lint/tree/master#sasslintformatwritable).
2019-04-12 15:36:57 +01:00
Tom Byers
c3a1e6ed59 Bump Gulp to 4.0.0
Brings in a new API which is a breaking change:

https://github.com/gulpjs/gulp/blob/master/CHANGELOG.md#400

Requires gulpfile.babel.js to be a CommonJS module
and for all tasks to be exported.

Replaces using ES6 modules for the CommonJS to
include other packages to match the type of module
the gulpfile now is.

Updates to 4.0.0 include `series` and `parallel`
methods which remove the need for the
`run-sequence` package.

Also bumps gulp-specific libraries.
2019-04-12 15:36:57 +01:00
Tom Byers
c7f3b688cd Bump version of NodeJS to 10.15.3
Updates the README to reference this.

If running this locally, it's recommended to use
the 'n' NPM package to manage your version of
NodeJS, as described in the README:

https://github.com/alphagov/notifications-admin#first-time-setup
2019-04-12 15:36:57 +01:00
Chris Hill-Scott
b41c3779c4 Merge pull request #2906 from alphagov/auto-service-counts
Automate counting of live services and orgs
2019-04-12 14:15:41 +01:00
Chris Hill-Scott
9863aa3c48 Automate counting of live services and orgs
Returns the data calculated by the API. Stored in Redis against a
hardcoded key so that no-one hammering the home page is directly hitting
the database.
2019-04-12 13:59:33 +01:00
Alexey Bezhan
df1a1b5b66 Merge pull request #2905 from alphagov/pin-gunicorn-pyup
Stop pyup from trying to upgrade gunicorn
2019-04-12 10:21:21 +01:00
Chris Hill-Scott
278317b222 Merge pull request #2907 from alphagov/no-go-live-without-checklist
Block incomplete requests to go live
2019-04-11 16:23:55 +01:00
karlchillmaid
f997b446ff Update app/templates/views/service-settings/request-to-go-live.html
Co-Authored-By: quis <me@quis.cc>
2019-04-11 15:44:28 +01:00
Chris Hill-Scott
436d023722 Block incomplete requests to go live
Dealing with users who request to go live but haven’t completed all the
steps still represents a significant support overhead for our team.
We’ve made some improvements to the percentage of incomplete requests
with a better page design, but ultimately because it still shows the
button people think it’s OK to press the button while some of the items
on the page still say [Not completed].

We can do this now because organisations are in the database, which
means we can mark the agreement signed as soon as we get it back,
without having to deploy code.
2019-04-11 14:35:30 +01:00
Alexey Bezhan
3c302e4595 Stop pyup from trying to upgrade gunicorn 2019-04-10 11:04:55 +01:00
Katie Smith
55eaa066f1 Merge pull request #2892 from alphagov/add-audit-events
Add audit event when a service manager changes someones profile
2019-04-10 11:00:17 +01:00
Katie Smith
19fe587640 Make InvitedUser class always expect folder_permissions to be returned
InvitedUsers now always have folder_permissions (if they can't view any
folders their folder permissions will be `[]`).
2019-04-09 14:37:37 +01:00
Katie Smith
88e9a0ff61 Add audit event when a service manager changes someones profile
We should audit when a service manager changes a user profile that is not
their own. This can be recorded in our events table, which is currently
only used to record successful logins.

This adds two new types of event, `update_user_email` and
`update_user_mobile_number` which store the
- browser fingerprint
- IP address
- user id of the user being updated
- user id of the service manager  making the change
- original email address and new email address (for `update_user_email`
events)
- original mobile number and new mobile number (for
`update_user_mobile_number` events)
2019-04-09 14:37:37 +01:00
Leo Hemsted
a249382e69 Merge pull request #2898 from alphagov/user-permission-count
add count of folders visible per user to the team members page
2019-04-05 14:20:52 +01:00
Chris Hill-Scott
04c0b5cd4b Merge pull request #2900 from alphagov/cefas.co.uk
Let Centre for Environment Fisheries and Aquaculture Science sign up for Notify
2019-04-05 11:58:31 +01:00
Chris Hill-Scott
e56aeaefda Merge pull request #2899 from alphagov/update-service-count
Updated service and org counts
2019-04-05 11:48:20 +01:00
Chris Hill-Scott
86c15771e0 Let Centre for Environment Fisheries and Aquaculture Science sign up for Notify 2019-04-05 11:46:59 +01:00
Pete Herlihy
23b3710875 Updated service and org counts 2019-04-05 10:29:57 +01:00
Leo Hemsted
249b80762a add count of folders visible per user to the team members page
Shows a count of how many folders that user can see - this doesn't do
anything smart with parent folder stuff, it's just "how many checkboxes
are ticked on the edit page".

* doesn't show if service has no folders
* doesn't show if service hasn't got folder permissions enabled
2019-04-04 17:55:37 +01:00
Leo Hemsted
16d1526c46 bump utils to 31.2.4
brings in dev logging filter
2019-04-04 14:05:15 +01:00
Tom Byers
eb8a856c10 Merge pull request #2880 from alphagov/add-logic-to-autofocus
Prevent autofocus when page has scrolled
2019-04-03 15:37:25 +01:00
Chris Hill-Scott
79eb7d0f45 Merge pull request #2894 from alphagov/fix.lancaster.gov.uk
Fix name of Lancaster City Council
2019-04-03 14:50:27 +01:00
Tom Byers
cf07579a6b Correct name of forceFocus data attribute
Data attributes need to be '-' separated strings
in the HTML to appear as camelCase keys in the
`.dataset` (`.data()` in jQuery) property.

This corrects the assumption that the camelCasing
would carry through from the HTML.

More info:

https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes
2019-04-03 14:41:09 +01:00
Tom Byers
cb55fbb344 Fix reference to non-existent jQuery collection
Raised on PR as comment:

e4b4be9d45 (r270781103)
2019-04-03 14:41:09 +01:00
Tom Byers
8d5e7e70ab Prevent autofocus when page has scrolled
If users scroll a page with an autofocus component
on so it is off-screen it seems safe to assume
they won't want it focused if they return to it.

This prevents that happening.

This adds a data-attribute flag to allow this
behaviour to be overridden.

We have some situations where the assumption here
isn't appropriate, for example on pages where the
component with autofocus is in a sticky element.
This means it will appear offscreen when the page
loads but, when its parent becomes sticky, will be
visible again.
2019-04-03 14:41:09 +01:00
Chris Hill-Scott
9619c64cb3 Fix name of Lancaster City Council
The county council is _Lancashire_
2019-04-03 14:25:50 +01:00
Leo Hemsted
1984128d1f Merge pull request #2893 from alphagov/copy-service-folder
fix bug with copying template from folder in other service
2019-04-03 14:13:27 +01:00
Chris Hill-Scott
a754eca29f Merge pull request #2886 from alphagov/hint-current-email-branding
Say what the current email branding is
2019-04-03 14:05:54 +01:00
Leo Hemsted
3e3c11f3a0 fix bug with copying template from folder in other service 2019-04-03 13:59:44 +01:00
Chris Hill-Scott
c2367010c4 Merge pull request #2891 from alphagov/dorsetcouncil.gov.uk
Add alternate domain for Dorset Council
2019-04-03 13:25:10 +01:00
Chris Hill-Scott
d749586f25 Add alternate domain for Dorset Council 2019-04-03 13:13:47 +01:00
Chris Hill-Scott
b1b496ba56 Say what the current email branding is
We keep getting people requesting branding when they already have the
branding they want set. Seems like they don’t realise we’re doing it
automatically. This might help.
2019-04-03 11:54:33 +01:00
Chris Hill-Scott
a85ee2a8e9 Merge pull request #2890 from alphagov/lancaster.gov.uk
Mark agreement signed by Lancaster County Council
2019-04-03 11:38:51 +01:00
Chris Hill-Scott
7d680ba37f Mark agreement signed by Lancaster County Council 2019-04-03 11:27:38 +01:00
Chris Hill-Scott
7436a568dd Merge pull request #2884 from alphagov/team-members-not-users
Say ‘team members’ not ‘users’ for permissions
2019-04-02 15:52:49 +01:00
Chris Hill-Scott
70d2b709ce Merge pull request #2887 from alphagov/fix-alignment-sticky-links
Fix alignment of links in sticky footer
2019-04-02 15:52:33 +01:00
Pea (Malgorzata Tyczynska)
3e251783de Merge pull request #2888 from alphagov/folder-user-permissions-2
Only show user permissions section for a folder to users with manage_users permission
2019-04-02 15:34:54 +01:00
Pea Tyczynska
bd66cc220b User permissions section for a folder noy visible if service only has one user
If no manage users permission then don't pass user folder permissions to api
2019-04-02 15:03:41 +01:00
Pea Tyczynska
9d44c45e90 Only users who can manage team members see folder permissions 2019-04-02 12:07:11 +01:00
Alexey Bezhan
8ab859138b Merge pull request #2865 from alphagov/check-folder-permissions
Check folder permissions
2019-04-02 10:33:01 +01:00
Katie Smith
3ae1f30ac9 Merge pull request #2885 from alphagov/phone-number
Pass API correct attribute to search inbound SMS
2019-04-02 09:59:40 +01:00
Chris Hill-Scott
a1a4b7f3d4 Fix alignment of links in sticky footer
The delete link was inheriting 1px of extra top padding meant to align
it when displayed alongside a button. In this case it’s not being
displayed alongside a button, so doesn’t need the extra padding.
2019-04-02 09:59:18 +01:00