Commit Graph

8559 Commits

Author SHA1 Message Date
karlchillmaid
d4c19140e8 Update text message rate 2022-04-26 12:05:57 +01:00
karlchillmaid
45884b6a2e Update text message rate 2022-04-26 12:05:16 +01:00
karlchillmaid
c63660d56d Merge pull request #4217 from alphagov/may-2022-price-changes
Announce May 2022 text message price increase
2022-04-22 15:20:56 +01:00
karlchillmaid
e1ff1bc4b2 Update date 2022-04-22 14:57:37 +01:00
Leo Hemsted
19d501e2aa Merge pull request #4214 from alphagov/0-free-allowance
Hide remaining free allowance if it starts at 0
2022-04-22 13:32:16 +01:00
Leo Hemsted
3bda2aa36c remove redis_enabled flag
there's no reason we need to configure this per environment. You can
still use it as before for local development
2022-04-22 12:21:27 +01:00
Ben Thorner
4a3ba97115 Remove redundant conditional for CF Redis
This is now used in all environments and we've removed support for
non-CF Redis [1].

[1]: https://github.com/alphagov/notifications-admin/pull/4213
2022-04-20 11:32:57 +01:00
karlchillmaid
518ef0b272 Add announcement of text message price change 2022-04-20 11:30:22 +01:00
Chris Hill-Scott
d11beee5b6 Hide remaining free allowance if it starts at 0
If your free allowance starts a 0 (which we have done for some services
this year) it’s redundant to say ‘0 of 0 remaining’.
2022-04-20 10:53:05 +01:00
Ben Thorner
be1fc9de79 Remove redundant CloudFoundry config code
These env vars can be set directly in the manifest, like we do for
Template Preview [^1].

[^1]: c08036189b/manifest.yml.j2 (L23-L26)
2022-04-13 14:45:29 +01:00
Ben Thorner
339ca93d9b Add support for migrating to Redis on PaaS
Similarly to https://github.com/alphagov/notifications-api/pull/3508
2022-04-12 17:46:45 +01:00
Leo Hemsted
1bed87b67d Merge pull request #4206 from alphagov/daily-sms-vols-reports
add new daily sms provider volumes report
2022-04-12 15:48:36 +01:00
Leo Hemsted
c2472e55aa clean up info tables to not over-use safe markdown filter
the safe filter is quite dangerous - it allows HTML to be rendered as
passed through (the default action is to escape all html), so should
only be used with trusted input. Move it so we only apply it to fields
we specifically expect to have HTML in - in this case, some tables
contain links to other pages.

Also, clean up the variable names for some of these info tables, as they
didn't really make sense.
2022-04-11 14:40:32 +01:00
Leo Hemsted
b3f5bb6435 add new daily sms provider volumes report
nearly identical to the daily-volumes-report but sms only, and split up
by provider
2022-04-11 14:40:31 +01:00
Ben Thorner
355a74d202 Make SMS provider inputs easier to interpret
In response to: [^1].

[^1]: https://github.com/alphagov/notifications-admin/pull/4205#discussion_r847204574
2022-04-11 14:02:04 +01:00
Ben Thorner
efea27d433 Don't show priority for inactive providers
This is consistent with not being able to set it either. I think
it's OK to not have a test for this as it's purely cosmetic.
2022-04-07 14:05:07 +01:00
Ben Thorner
0437e4a248 Standardise appearance of missing data
This makes the rendering the same as for "created_by_name" when the
data isn't present. It's a bit more complicated for "updated_at" so
I checked that it's implicitly covered by the tests, which fail if I
remove the "if" conditional for any of these fields.
2022-04-07 14:05:06 +01:00
Ben Thorner
264bf8302f Remove redundant sorting when editing SMS ratios
This is irrelevant since we no longer pick a "first" provider.
2022-04-07 14:05:04 +01:00
Ben Thorner
dd0022968c Remove redundant constraint on multiple providers
We can now handle a single provider (with a priority of 100%).  I
don't think we need to handle the case of no providers.
2022-04-07 14:05:03 +01:00
Ben Thorner
55e89b3f12 Add validation for provider SMS percentages
We could alternatively put the "add up to 100%" error on the page
using form-level errors [^1] and a custom flash message. Putting
the error on each field is slightly simpler and does make it clear
the issue is with all of the fields together.

[^1]: 22636b55ed
2022-04-07 14:05:01 +01:00
Ben Thorner
7f333ba5fe Rewrite SMS ratio form to cope with 3 providers
This replaces the slider with an integer input for each provider.
Unfortunately showing a variable number of inputs isn't easy to
achieve in WTForms [^1], but we think this is the least worst way
to do it vs e.g. not using WTForms at all.

[^1]: https://github.com/wtforms/wtforms/issues/736
2022-04-07 14:05:00 +01:00
Ben Thorner
8655ab7dea Stop showing priorities for other provider types
This isn't used and showing priorities when we only have a single
provider or where they have no effect is unnecessarily confusing.
Removing the form makes it clearer that there's only one way to
adjust priorities for domestic SMS providers.

If we add another email or international SMS provider in future,
we would need to rewrite the form here anyway as the priorities
need to be adjusted in tandem, not individually.
2022-04-07 14:04:57 +01:00
Ben Thorner
25a26c0b4d Add caveat about provider version history
To go with https://github.com/alphagov/notifications-api/pull/3500
2022-04-07 13:43:57 +01:00
Ben Thorner
66335d20c2 Return to main provider page after editing ratio
Staying on the edit page is atypical behaviour for an edit form,
especially now it no longer shows the version history.
2022-04-07 13:43:56 +01:00
Ben Thorner
a3231effb1 Remove version history from provider ratio page
This doesn't work with 3 providers. You can still see the version
history for each provider on their dedicated page.
2022-04-07 13:43:54 +01:00
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
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
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
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
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
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
Tom Byers
23ca2dcabc Merge pull request #4193 from alphagov/fix-nav-link-focus-hover-bug
Strip underline from focused + hovered nav links
2022-03-24 11:27:48 +00:00