Commit Graph

12467 Commits

Author SHA1 Message Date
Katie Smith
b5fa270cd2 Bump all test dependencies
This results in some new errors from flake8-bugbear:
```
B020: Loop control variable overrides iterable it iterates
```
I can't see an issue with the places that we do this, so have ignored
these warnings. If we keep getting these and they look fine, we can
create a global rule to ignore B020.
2022-04-06 12:17:09 +01:00
Katie Smith
0bec5e8f0a Update pyproj from 3.2.1 to 3.3.0 2022-04-06 12:17:09 +01:00
Katie Smith
f3db221fcb Bump notifications-utils to 55.1.2
This brings in a change to allow pyproj to be updated.
2022-04-06 12:06:36 +01:00
Katie Smith
777f719185 Update pyexcel from 0.6.7 to 0.7.0 2022-04-06 10:30:53 +01:00
Katie Smith
0feb37743a Update pytz from 2021.3 to 2022.1 2022-04-06 09:37:27 +01:00
Katie Smith
7e5e4b18a0 Update flask-login from 0.5.0 to 0.6.0 2022-04-06 09:29:37 +01:00
Katie Smith
57f8a724c1 Update flask-wtf from 1.0.0 to 1.0.1 2022-04-06 09:25:32 +01:00
Katie Smith
8d3eedd88e Remove importlib-metadata from requirements file
This was pinned in
ee3fb2f175
to prevent version conflicts. It only seems to be required by packages
when the version of Python is 3.8 or lower
(e.g. 21d3c70d67/docs/source/release-notes/3.8.0.rst (new-dependency-information)),
so is now not required anyway.
2022-04-06 08:54:57 +01:00
Ben Thorner
a72aa4f853 Merge pull request #4199 from alphagov/provider-fixes-181574489
Support changing priorities with inactive SMS provider
2022-04-05 16:17:44 +01:00
Ben Thorner
e02dbde378 Small changes to address PR comments
In response to [^1] and [^2].

[^1]: https://github.com/alphagov/notifications-admin/pull/4199#discussion_r842653983
[^2]: https://github.com/alphagov/notifications-admin/pull/4199#discussion_r842667340
2022-04-05 15:55:07 +01:00
Ben Thorner
59f6b0b5d8 Replace "primary", etc. with "first", etc.
Using "primary" made sense when the other "secondary" provider was
new, but today we see them as equivalent and the terminology is a
bit confusing. In future we may add a third provider as well.
2022-04-05 15:55:06 +01:00
Ben Thorner
55e2a2f96b Stop reversing the order of SMS providers
This makes no functional difference but does make it easier to read.
2022-04-05 15:55:05 +01:00
Ben Thorner
9355c4f8d1 Only show active providers when changing priority
This fixes a bug where a third inactive provider would (potentially)
appear in place of one of the two active ones, depending on the order
of its identifier compared to the other two.

In future we may look at simplifying this to cope with more than two
active providers. For now, the existing UI will continue to work when
we add a new, inactive SMS provider for Reach.
2022-04-05 15:55:04 +01:00
Ben Thorner
f9749c0ae3 Standardise priorities / names for test providers
Only multiples of 10 are possible in practice. This will make it
easier to use this test data in the next commits.
2022-04-05 15:55:03 +01:00
Ben Thorner
0f9b73f73c Use fixtures instead deep-copying constants
This is more conventional and removes the ambiguity about whether
the deepcopy was actually necessary for new tests.
2022-04-05 15:55:02 +01:00
Ben Thorner
396e9e3743 Split up provider test data into separate vars
This makes it easier to follow which dict is being referred to as
the indices didn't convey this.
2022-04-05 15:55:01 +01:00
Ben Thorner
7a7d8f8aa6 Link to history for SMS providers
Although the priority history is shown on the "Change priority"
page, this doesn't show active/inactive changes.
2022-04-05 15:54:58 +01:00
Richard Baker
a1c6b24749 Merge pull request #4202 from alphagov/node_16
Add package-lock.json & update to Node 16 LTS
2022-04-05 15:54:24 +01:00
Richard Baker
799949a3f4 Add .nvmrc & use NVM to manage installed Node version
We have decided to use NVM to manage installed Node versions locally
and in CI to ensure they match and produce consistent builds.

Running `nvm install` will install the Node version specified in the
`.nvmrc` file.

This is now consistent with Document Download Frontend.
See: alphagov/document-download-frontend#114

Signed-off-by: Richard Baker <richard.baker@digital.cabinet-office.gov.uk>
2022-04-05 12:09:53 +01:00
Richard Baker
5fa324a680 Add package-lock.json file using Node 16 LTS & NPM 8
Creates a "v2" package-lock.json file for consistent dependency
installation.

Lock file created using `npm i --package-lock-only`

Signed-off-by: Richard Baker <richard.baker@digital.cabinet-office.gov.uk>
2022-04-05 11:36:33 +01:00
David McDonald
9a2f6f27df Merge pull request #4195 from alphagov/pricing-page-update-1-april-22
Update text message allowances and cost
2022-04-01 10:02:50 +01:00
karlchillmaid
7c208c48b4 Update text message allowance and cost 2022-04-01 09:14:24 +01:00
karlchillmaid
7ec5c7262a Update text message cost 2022-04-01 09:11:56 +01:00
Ben Thorner
2b8a2f3a81 Merge pull request #4196 from alphagov/branding-refactorings-2-181415991
Final set of refactorings for email branding
2022-03-31 09:58:19 +01:00
Ben Thorner
c7951f8667 Split out email and letter branding request tests
In response to: [^1].

I've named the file to distinguish it from the admin endpoints to
set branding.

[^1]: https://github.com/alphagov/notifications-admin/pull/4196#discussion_r838734482
2022-03-30 17:46:55 +01:00
Ben Thorner
a27b5eb12b Move service setting tests into subdirectory
In response to: [^1].

This makes it clearer that the tests are split between files.

[^1]: https://github.com/alphagov/notifications-admin/pull/4196#discussion_r838734482
2022-03-30 17:46:54 +01:00
Ben Thorner
6030e9e5bb Decouple the set of org types from their labels
In response to: [^1].

[^1]: https://github.com/alphagov/notifications-admin/pull/4196#discussion_r838383086
2022-03-30 17:46:53 +01:00
Ben Thorner
fa01889d01 Rearrange branding tests to group email / letters
Previously I found it hard to audit these tests when they flipped
between emails and letters when scrolling vertically.

While these have much in common, they are still separate features
and will evolve separately.
2022-03-30 17:46:52 +01:00
Ben Thorner
543dff4a18 Remove redundant scenario for email branding test
This is no longer possible since [^1].

[^1]: https://github.com/alphagov/notifications-admin/pull/4180
2022-03-30 17:46:51 +01:00
Ben Thorner
e2929118c8 Remove redundant letter branding UI test
This is now covered by the unit tests for the new branding module.
Showing the "something else" text box is also already covered by
another UI test, so we don't need it for that either.
2022-03-30 17:46:50 +01:00
Ben Thorner
1a7ecd85c9 Add tests for branding options conditional on name 2022-03-30 17:46:49 +01:00
Ben Thorner
15247bd780 Add missing test cases for default branding 2022-03-30 17:46:48 +01:00
Ben Thorner
3beb56be57 DRY-up tests by parametrizing on existing branding
This is possible now we're testing letters and emails separately.
I've added a few missing cases for NHS and non-central branding.
In the next commits we'll look at the remaining special cases.
2022-03-30 17:46:47 +01:00
Ben Thorner
330c23ad30 Remove excess tests for other org types
These all behave the same as each other so there's little value in
testing all of them - if we had 100 org types we wouldn't test them
all, but it's easy to get carried away when there are fewer.
2022-03-30 17:46:46 +01:00
Ben Thorner
e7d59263d1 Split out tests for letter and email branding
This also fills a gap where we weren't checking the central org
case for letters.
2022-03-30 17:46:45 +01:00
Ben Thorner
332c240b01 Use "get_email_choices" directly in branding view 2022-03-30 17:46:44 +01:00
Ben Thorner
b4b1c91fb9 Remove redundant "something else" branding check
This is always allowed and there was no test for it.
2022-03-30 17:46:43 +01:00
Ben Thorner
8a7eed9b26 Minor refactorings to help read branding rules
I did consider having a "has_govuk_branding" variable, but I think
it's better to reinforce what this means with comments.
2022-03-30 17:46:42 +01:00
Ben Thorner
1cc5413f96 Move and clarify "NHS_BRANDING_ID" constant
This is specific to email branding [^1]. Using the name to match
the current branding is more error-prone.

[^1]: a165f62b60
2022-03-30 17:46:41 +01:00
Ben Thorner
21eea0189d DRY-up listing NHS organisation types
The model should be the source of truth for this.
2022-03-30 17:46:40 +01:00
Ben Thorner
8f55972aae Split "get_available_choices" by branding type
We already had different functionality for email branding and will
soon be adding more for email branding pools.

Note that the "get_available_choices" class method was only used for
email branding - we can do it in the constructor for letters.
2022-03-30 17:46:39 +01:00
Ben Thorner
f022836f4d Move letter-specific logic down to its form class
For letters we still have the conditional reveal on the radio form
for the "something else" option.
2022-03-30 17:46:38 +01:00
Ben Thorner
352cdb80fa Remove remaining uses of ChooseBrandingForm
This was missed in a previous commit.
2022-03-30 17:46:37 +01:00
Pea Tyczynska
7d5ca324d0 Merge pull request #4166 from alphagov/allow_user_delete_mobile_number
Let users on email auth delete their mobile numbers
2022-03-25 16:02:38 +00:00
Pea Tyczynska
190381c578 Make sure delete mobile number only shown when needed
Users who have no mobile number set, users who are not on email auth
and users who are not on "Change mobile number" page should not
see the delete link.
2022-03-25 15:49:03 +00:00
Ben Thorner
3a6ceac910 Merge pull request #4198 from alphagov/service-history-link
Show link to service history in the settings page
2022-03-25 09:49:00 +00:00
Ben Thorner
3164134260 Merge pull request #4197 from alphagov/show-api-keys-broadcast-179120842
Make it easy to see API keys for broadcast service
2022-03-25 09:48:51 +00:00
Ben Thorner
422b4c1091 Show link to service history in the settings page
Based on discussion in [^1].

[^1]: https://github.com/alphagov/notifications-admin/pull/4157
2022-03-24 12:58:56 +00:00
Ben Thorner
808f248782 Rename "page-footer-delete-link" class
This doesn't set any deletion-specific attributes so it's valid to
just call it "page-footer-link".
2022-03-24 12:58:08 +00:00
Ben Thorner
b6bc598e8c Make it easy to see API keys for broadcast service
This made it easier to debug a problem with the functional tests
due to the fixtures not working correctly [^1]. It's a platform
admin only convenience over knowing the page URL.

We may want to expose the top-level "/api-integration" page but
that will require more work to show which broadcasts were sent with
which key - currently it's oriented around "messages". For now I
think it's useful to see what keys a service has.

[^1]: https://github.com/alphagov/notifications-functional-tests/pull/411#pullrequestreview-920069799
2022-03-24 12:33:09 +00:00