Commit Graph

12617 Commits

Author SHA1 Message Date
Chris Hill-Scott
f1bf991a3c Update prometheus-client from 0.14.0 to 0.14.1 2022-05-26 14:58:27 +01:00
karlchillmaid
bef0382cca Merge pull request #4252 from alphagov/update-review-date-for-roadmap
Update review date
2022-05-26 13:02:59 +01:00
karlchillmaid
f2a87ebf43 Update review date
Update review date to fit IP’s timings for our new roadmap.
2022-05-26 12:13:36 +01:00
Katie Smith
e60eb91631 Merge pull request #4249 from alphagov/add-link-types
Add the filetype to download links
2022-05-25 08:19:26 +01:00
Katie Smith
0d167984f1 Add filetype to platform admin report download buttons 2022-05-24 10:27:27 +01:00
Katie Smith
cdfe852d25 Add filetype to all links to download user reports / examples 2022-05-24 10:27:27 +01:00
Katie Smith
4338953d5f Add filetype to MOU links 2022-05-24 09:54:33 +01:00
Katie Smith
073636d74f Fix links on the '/features/security' page
- Changed the 'contact us' link to point to our support form, not the
  Notify homepage
- Updated the link to the details about CHECK based testing, since the
  site we were linking to no longer exists.
2022-05-24 09:54:33 +01:00
Chris Hill-Scott
d1c6e06bf1 Merge pull request #4248 from alphagov/pyup-pin-core
Stop pyup trying to upgrade blocked dependencies
2022-05-20 11:26:43 +01:00
Chris Hill-Scott
83bb7fa8b1 Stop pyup trying to upgrade blocked dependencies
We can’t upgrade Jinja or Werkzeug until we’re on Flask 2.x.x. We can’t
upgrade Flask to 1.1.3 because it pins older versions of Jinja and
Werkzeug than the ones we’re using. We can’t upgrade Flask to 2.x.x
until we upgrade itsdangerous to 2.x.x, which is blocked by
https://github.com/alphagov/notifications-admin/pull/4044/files
2022-05-19 11:13:57 +01:00
Katie Smith
2e637f801f Merge pull request #4247 from alphagov/page-count-fun
Fix bug where "Bad Request: Letter does not have a page x" was seen in logs
2022-05-17 09:08:22 +01:00
Katie Smith
d00c438802 Include placeholders in letter length check
When filling in the letter address having clicked 'back'
(https://www.pivotaltracker.com/story/show/181513431).
2022-05-16 15:44:52 +01:00
David McDonald
19e6e38426 Calculate page count based on template values when previewing
Similar to the bug shown here
https://www.pivotaltracker.com/story/show/181513431, but to fix the case
when previewing a letter send using a CSV upload it wasn't using
template values to calculate the page length.
2022-05-16 15:44:05 +01:00
David McDonald
732bfffb93 Remove duplicative call to get_page_count_for_letter
For some reason we were calling it twice. We can just reuse the
value already calculated
2022-05-16 11:26:05 +01:00
Chris Hill-Scott
e467167c62 Merge pull request #4245 from alphagov/pip-compile-upgrade
Run `pip-compile --upgrade`
2022-05-16 11:10:14 +01:00
Chris Hill-Scott
7e57bfd6a1 Run pip-compile --upgrade
This upgrades all the sub-dependencies which we don’t pin in
requirements.txt
2022-05-13 15:41:00 +01:00
Chris Hill-Scott
5de6171db3 Merge pull request #4244 from alphagov/xlrd-2
Upgrade xlrd to version 2 and force `.xlsm` files to open with pyexcel-xlsx instead
2022-05-13 15:31:52 +01:00
Chris Hill-Scott
42de68e6a0 Update other Excel-related dependencies
Make sure the latest versions of all Excel-related dependencies all work
nicely together.
2022-05-13 13:24:36 +01:00
Chris Hill-Scott
80854ab2cc Force xlsm files to open with pyexcel-xlsx
`.xlsm` files are like `.xlxs` files but with macros enabled. They store
data in the same XML-based format as `.xlsx` files.

Pyexcel will try to use the xlrd package to parse `.xlsm` files. This
used to work because xlrd used to support reading `.xlsx` files. xlrd
has dropped support for `.xlsx` files in version 2 because of security
concerns. This means that when pyexcel asks xlrd to parse a `.xlsm` file
it causes an error.

This commit adds some branching to force `.xlsm` files to be opened
with pyexcel-xlsx instead, which does support `.xlsx` files.
2022-05-13 13:17:55 +01:00
Chris Hill-Scott
ded87706c7 Upgrade xlrd to version 2
xlrd is a library for reading data and formatting information from
Excel files in the historical .xls format.

Version 2 of xlrd no longer supports anything other than .xls files.

We were using it to also support reading .xlsm files (old Excel files
with macro support).

We could keep using the old version of this dependency, but hopefully
this niche version of an ancient file format is obscure enough that
no-one is using it, and we can drop support, keeping our dependencies
up to date.
2022-05-12 15:48:12 +01:00
Ben Thorner
5641ce2c15 Merge pull request #4243 from alphagov/fix-usage-api-181935935
Fix keys used to render monthly usage
2022-05-11 13:56:16 +01:00
Ben Thorner
4abb6110c8 Fix keys used to render monthly usage
These were out-of-sync with the API.
2022-05-11 13:28:33 +01:00
Ben Thorner
84dde0f824 Merge pull request #4229 from alphagov/monthly-usage-multirate-181935935
Support multiple rates in monthly SMS usage
2022-05-11 11:26:44 +01:00
Chris Hill-Scott
5c4b361345 Merge pull request #4240 from alphagov/humanize-4.1.0
Update humanize from 4.0.0 to 4.1.0
2022-05-11 10:06:48 +01:00
Ben Thorner
bb0fb73bc8 Minor tweaks in response to PR comments
In response to [^1] and [^2].

[^1]: https://github.com/alphagov/notifications-admin/pull/4229#discussion_r869181152
[^2]: https://github.com/alphagov/notifications-admin/pull/4229#discussion_r869186063
2022-05-10 17:00:51 +01:00
Ben Thorner
9ac33f7baf Merge pull request #4242 from alphagov/fix-missing-audit-task-182116071
Fix missing audit task in package.json
2022-05-10 13:25:25 +01:00
Ben Thorner
51f9b0cef0 Fix missing audit task in package.json
This was intended to go in [^1] but I think it got lost in a rebase.

[^1]: https://github.com/alphagov/notifications-admin/pull/4237
2022-05-10 11:33:24 +01:00
Chris Hill-Scott
478f222419 Merge pull request #4238 from alphagov/whitespace-api-key-js
Remove whitespace around API key in JS templates
2022-05-10 11:08:47 +01:00
Chris Hill-Scott
6f856fdece Make terminology around visually hidden prefix clearer and more consistent
Co-authored-by: Ben Thorner <benthorner@users.noreply.github.com>
2022-05-10 10:33:27 +01:00
Chris Hill-Scott
381bd2cd1c Update humanize from 4.0.0 to 4.1.0 2022-05-10 10:13:12 +01:00
Ben Thorner
d5f2f913d8 Merge pull request #4237 from alphagov/add-npm-audit-181889734
Add better-npm-audit to check production packages
2022-05-09 15:08:10 +01:00
Chris Hill-Scott
e82970d490 Remove whitespace around API key in JS templates
We removed whitespace in the HTML of the copy to clipboard component
in https://github.com/alphagov/notifications-admin/pull/4236/files

When the Javascript on the page loads it re-renders the component,
using HTML which is embedded in the .js file.

This means we also need to apply the same change to the .js file
to remove any extraneous whitespace.
2022-05-09 12:38:18 +01:00
Ben Thorner
b348e8ed03 Add better-npm-audit to check production packages
This is the same as [^1].

[^1]: https://github.com/alphagov/document-download-frontend/pull/120
2022-05-09 12:05:42 +01:00
Chris Hill-Scott
4ce1bf436d Merge pull request #4236 from alphagov/fix-whitespace-copy
Remove whitespace from copy to clipboard component
2022-05-09 12:01:43 +01:00
Ben Thorner
efb45c0baa Merge pull request #4235 from alphagov/regroup-npm-packages-181889734
Fix incorrect group for NPM dependencies
2022-05-06 15:42:00 +01:00
Ben Thorner
d97ed69f0b Turn off NPM auditing on installation
This isn't useful as it mostly pertains to dev dependencies, where
we're not concerned about vulnerabilities as they run in isolation.
2022-05-06 12:31:52 +01:00
Ben Thorner
da7dd3a852 Fix incorrect group for NPM dependencies
This means we can use tools like "npm audit" to look for security
vulnerabilities we definitely need to fix as they could pose a
direct risk to users. I've checked each of them with @tombye and
also against an external set of principles [^1].

Note: I've skimmed through the package-lock.json to check the only
changes are to add "dev: true", as well as a few integrity hashes.

[^1]: https://betterprogramming.pub/is-this-a-dependency-or-a-devdependency-678e04a55a5c
2022-05-06 12:31:10 +01:00
Chris Hill-Scott
4d825ece9f Merge pull request #4231 from alphagov/allow-editing-pending-users
Allow editing of pending users
2022-05-06 12:29:13 +01:00
Chris Hill-Scott
f2bcc79dbd Merge pull request #4233 from alphagov/update-some-core-dependencies
Update minor and patch versions of some core dependencies
2022-05-06 11:36:58 +01:00
Chris Hill-Scott
1dd8b2513d Merge pull request #4232 from alphagov/update-test-dependencies
Update test dependencies to latest versions
2022-05-06 11:36:52 +01:00
Tom Byers
532289e677 Merge pull request #4234 from alphagov/fix-alert-area-list
Fix alignment regression error with area lists
2022-05-06 10:20:30 +01:00
Chris Hill-Scott
c6fb0e6694 Remove whitespace from copy to clipboard component
If there is whitespace in the element containing the value to be copied
then Firefox[1] includes that space in the value it puts in the clipboard.

This is obviously annoying since `foo-bar` might be a valid API key where
`foo-bar ` is not.

This commit fixes that by using the `-` in Jinja to gobble whitespace.

I also looked at doing this in the Javascript, but the browser API for
selecting some text and copying it doesn’t give an obvious place for
using `String.prototype.trim()`.

1. Tested with Firefox 100.0 on Mac OS 12.2.1
2022-05-05 15:42:05 +01:00
Ben Thorner
b6321ef4ae Remove unused "del" package
This was added in [^1] and later removed in [^2].

[^1]: e1dc6ddaef
[^2]: https://github.com/alphagov/notifications-admin/pull/3198
2022-05-05 14:51:19 +01:00
Tom Byers
65d337959d Fix alignment regression error with area lists
When we changed the layout for each alert on the
current/past/rejected alerts pages to use flexbox,
we added a fallback for older browsers that set
text-align: justify on the container:

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

This has led to items in the list of areas an
alert will be sent to being laid out as justified
content when they were left-aligned.

These changes set the correct alignment.
2022-05-05 14:49:52 +01:00
Chris Hill-Scott
6f95e4e0ca Pin Werkzeug to below 2.1.x
We can’t upgrade to Werkzeug 2.1.0 because the `BaseResponse` class
has been renamed. The old version of Flask we are using tries to import
`BaseResponse` causing an error.

    See https://github.com/pallets/werkzeug/issues/1963
2022-05-05 14:13:24 +01:00
Chris Hill-Scott
75a57568b6 Pin Jinja to below 3.1.x
We can’t upgrade to Jinja 3.1.0 because the `escape` module has been
moved to the `markupsafe` library. The old version of Flask we are
using tries to import `escape` from `jinja2`, causing an error.

See https://jinja.palletsprojects.com/en/3.1.x/changes/#version-3-1-0
2022-05-05 14:12:48 +01:00
Chris Hill-Scott
7a0ba988bb Update flake8 error code
flake8-print moved its namespace from `T0*` to `T2*` as a breaking
change in version 5.0.0 – see https://github.com/jbkahn/flake8-print#500---2022-04-30
2022-05-05 13:50:54 +01:00
Chris Hill-Scott
80ad40f587 Update minor and patch versions of some core dependencies 2022-05-05 13:45:42 +01:00
Chris Hill-Scott
1794344306 Update test dependencies to latest versions 2022-05-05 13:40:24 +01:00
Chris Hill-Scott
c6dc0d513e Allow editing of pending users
At the moment if a user is pending we don’t show the ‘change’ link.

This is unhelpful because:
- there’s no way to remove this user
- there’s no way to change their phone number, if the reason that
  they are still pending is because they’ve been unable to receive
  the two factor code at the number they first provided
2022-05-05 09:42:14 +01:00