Commit Graph

12518 Commits

Author SHA1 Message Date
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
Ben Thorner
dd85cf076d Fix test for broadcast service with realistic user
Previously the user had permissions like "manage_users", which can't
currently be set in the UI.
2022-03-24 12:32:43 +00:00
Ben Thorner
411abb136a Make broadcast user fixtures realistic
A broadcast service user will have the permission on creation [^1].

[^1]: b145a29935/app/dao/broadcast_service_dao.py (L69)
2022-03-24 12:26:06 +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
Pea Tyczynska
99682db7bf Change conditional for consistency 2022-03-22 17:55:55 +00:00
Ben Thorner
d1d3a6a6c3 Merge pull request #4182 from alphagov/refactor-email-branding-181415991
First set of refactorings for branding
2022-03-22 13:43:10 +00:00
Ben Thorner
6e81d05504 Rename test values to clarify they're branding IDs
In response to: [^1]

[^1]: https://github.com/alphagov/notifications-admin/pull/4182#discussion_r832009706
2022-03-22 13:02:39 +00:00
karlchillmaid
2031d41df7 Update prices and date 2022-03-22 12:22:54 +00:00
Chris Hill-Scott
a6e4f3441f Merge pull request #4191 from alphagov/remove-sizewell
Remove Sizewell from the demo areas library
2022-03-21 14:12:50 +00:00
Pea Tyczynska
eb0851e1e3 Please the navigation thing 2022-03-18 13:08:09 +00:00
Tom Byers
848ee72e3f Strip underline from focused + hovered nav links
Our CSS for links in the navigation, which makes
the underline appear on hover is overriding the
GOVUK focus styles, making it look like there are
2 underlines. This adds some extra CSS to reset
it.

The new CSS is further down the stylesheet to the
hover styles. This gives them a higher specificity
meaning they override them when these links are
hovered over while in focus.
2022-03-17 16:11:56 +00:00
Ben Thorner
3033c29c93 Merge pull request #4192 from alphagov/bump-shapely-mac-m1-181498273
Bump -utils to get latest version of Shapely
2022-03-15 15:50:44 +00:00
Ben Thorner
99eebddfaf Bump -utils to get latest version of Shapely
This was pinned in [^1] but I'm not sure why - we ought to pin it
in -utils if it needs pinning. Version 1.7.1 doesn't work with Mac
M1 installs of Homebrew - unless you manually hack the library.

As per [^2], we don't think the calculation change matters much.

[^1]: 969e7a6dbd (diff-eee0e41c3756911002e040cf5a8f66b004bb66c8ff1a359bb8ba35d86081e80cR21)
[^2]: 8a10d74fc5
2022-03-15 15:34:11 +00:00
Chris Hill-Scott
0fa3e009c9 Remove Sizewell from the demo areas library
We added this for the 25 May demo. We’re unlikely to need it again.

We’re also unlikely to need this library again, so this commit removes
the source and the code that creates it.
2022-03-15 14:40:42 +00:00
Ben Thorner
6a2367bb72 Merge pull request #4184 from alphagov/simplify-session-clear
Simplify "activate_user" to clear session earlier
2022-03-15 13:07:53 +00:00
Ben Thorner
e7aeb72fd9 Finish extracting UI tests for set branding
In response to: [^1].

The behaviour of the letter branding page is unchanged with set
branding, so we don't need an extra (and previously, broken [^2])
test for it. The email branding page shows a preview of existing
branding if it's set, so it's worth keeping that part of the test.

[^1]: https://github.com/alphagov/notifications-admin/pull/4182#discussion_r825998534
[^2]: https://github.com/alphagov/notifications-admin/pull/4182#discussion_r825999860
2022-03-15 12:18:27 +00:00
Ben Thorner
acd69b8d7d Combine tests for central org email branding
Central orgs have more options than others, including the option
to revert back to GOV.UK once branding is set. Combining the tests
together should make that a bit clearer.
2022-03-15 12:10:13 +00:00
Ben Thorner
f02c2b0b1d Rename other "Admin" forms consistently
I've also tweaked some of the names to make them clearer e.g. that
the form is used to apply a change to a service.

I've constrained the scope of this change to avoid forms that may
be accessible by non-admins in the future.
2022-03-15 11:47:22 +00:00
Ben Thorner
fa3e6435a6 Fix small issues identified in PR review
In response to: [^1], [^2], [^3], [^4], [^5] and [^6].

[^1]: https://github.com/alphagov/notifications-admin/pull/4182#discussion_r825824485
[^2]: https://github.com/alphagov/notifications-admin/pull/4182#discussion_r825824805
[^3]: https://github.com/alphagov/notifications-admin/pull/4182#discussion_r825857745
[^4]: https://github.com/alphagov/notifications-admin/pull/4182#discussion_r825859850
[^5]: https://github.com/alphagov/notifications-admin/pull/4182#discussion_r825859982
[^6]: https://github.com/alphagov/notifications-admin/pull/4182#discussion_r826001823
2022-03-15 11:47:21 +00:00
Ben Thorner
857b8b04b0 Duplicate tests for options with branding set
This is a step towards further refactoring of the page tests, which
don't need to check in this level of detail anymore.
2022-03-15 11:47:20 +00:00
Ben Thorner
5a39e310aa Migrate two more tests to the branding utility
All of the mock / UI assertions in these tests are covered by the
tests above them - these tests were mostly targetting which options
were being shown, which we can check at a lower level.
2022-03-15 11:47:19 +00:00
Ben Thorner
1946d3c928 Migrate two branding tests to utils module
This is much simpler than trying to test the function via the page,
although there are still two scenarios to test there:

- The page with radio buttons (using NHS as an example).
- The page with a text form (using "other" as an example).

In future work we could split this test in two to make it clearer
what it's trying to test. For now, this keeps the diff simple.
2022-03-15 11:47:18 +00:00
Ben Thorner
a2d471eff4 Add missing assertion for letter button text
This is the same as the test below, which we will be removing soon.
2022-03-15 11:47:17 +00:00
Ben Thorner
2fc0a105f4 Move branding choices logic into utility module
This was a lot of code to be in a form and it's going to get even
more complicated with email branding pools. Moving it out means we
can also simplify the tests that target this code.
2022-03-15 11:47:16 +00:00
Ben Thorner
a04ed3eca5 Use separate classes for branding option forms
These are about to become a lot less similar to each other when we
add email branding pools. Note that the optional *args and *kwargs
weren't used anywhere.
2022-03-15 11:47:15 +00:00
Ben Thorner
26d1222f1c Rename branding forms to clarify who they're for
I've often struggled to find the form associated with a particular
page due to the overlapping names e.g. "SetEmailBranding" sounds
more like the radio button form a user sees than "BrandingOptions".

Almost every form in forms.py also ends with "Form", so this also
makes the branding forms consistent with that naming convention.
2022-03-15 11:47:14 +00:00
Ben Thorner
bdcdfa6d0f Standardise branding tests to start with endpoint
This makes it easier to find all the tests that are relevant and
is consistent with how we name tests elsewhere in the app.
2022-03-15 11:47:13 +00:00
Chris Hill-Scott
4903e9d60e Merge pull request #4190 from alphagov/format-auth-type
Format `auth_type` in a consistent way in the UI
2022-03-15 10:48:12 +00:00
Chris Hill-Scott
ff46f9beb8 Remove default from format_auth_type
I think it’s better to raise an exception and force us to fix it if we ever add a new auth_type, or use this formatter on something that isn’t a valid auth_type.

Co-authored-by: Ben Thorner <benthorner@users.noreply.github.com>
2022-03-15 10:40:10 +00:00
Chris Hill-Scott
9a1a328aca Format auth_type in a consistent way in the UI
On the ‘find user’ page it says ‘sms_auth’ instead of ‘Text message
code’.

This commit fixes that, and adds a handy formatter so it’s easier to do
the right thing in the future.
2022-03-14 14:55:31 +00:00
Ben Thorner
34c2c3b47c Merge pull request #4176 from alphagov/replay-falsey-values
Replay falsey values in input fields
2022-03-14 09:53:02 +00:00
Tom Byers
2a565e363a Merge pull request #4171 from alphagov/fix-alert-text-click
Remove grid from alerts file-list
2022-03-11 15:09:51 +00:00
Tom Byers
e28d7cbb05 Fix comments, remove flex-grow and unused margin
Based on comments on the associated pull request,
(and my realisation that I was using flexbox
wrong):

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

Removal of flex-grow

I added `flex-grow: 1` to make the description and
status flex items grow to fill the container, at
least until they hit their `max-width`. They
already have `width: 100%` which achieves the same
thing so this removes it.
2022-03-11 14:54:24 +00:00
Tom Byers
9d32316a67 Fix spacing for alert description and status
Using `width` doesn't work for flex-items with
flex-grow set above 0 because they will expand to
fill the space, whatever its value.

The intention for this line was always to
constrain how much these ones can grow to half the
space minus the gap between. `max-width`, which is
still honored by flex-items with `flex-grow` above
0, meaning they will expand up to that size.
2022-03-11 14:54:23 +00:00
Tom Byers
cbcac14e7c Remove grid from alerts file-list
Having a grid in the click target stops the hint
and status text being clickable. This removes it
in favour using flexbox to position the elements
in a similar way.

Includes fallback styles for browsers that don't
support flexbox that positions the child elements
inline, laid out justified, to mimic the flexbox
positioning of justify-content: space-between.

Note: display is overriden on child items under
flexbox so setting display: inline-block is
ignored.
2022-03-11 14:53:55 +00:00
Ben Thorner
6ba84140e5 Add test for rendering integer 0 in form input 2022-03-11 11:18:21 +00:00
Ben Thorner
e0b62bed70 Group form tests in a directory
This makes it clearer we have tests for the code in forms.py, which
I missed initially. In future we could also split up forms.py in a
similar way, as it's currently _very long_.

As part of grouping tests for code in forms.py, I've extracted some
from test_validators.py, so that what remains is focussed on testing
the code in validators.py.
2022-03-11 11:17:43 +00:00
karlchillmaid
a555ac8d07 Merge pull request #4187 from alphagov/sms-price-updates-announcement
Announce text message prices changes
2022-03-10 15:41:38 +00:00
Chris Hill-Scott
0847a26af7 Merge pull request #4175 from alphagov/branding-preview-macro
Prevent scrolling of branding previews
2022-03-10 14:03:37 +00:00
karlchillmaid
1fb2c9cdac remove (unchanged) 2022-03-10 13:59:04 +00:00
karlchillmaid
2d4d7f6b87 Update date 2022-03-10 12:28:21 +00:00
karlchillmaid
2cd09bd04b Add confirmed allowance changes 2022-03-10 11:17:05 +00:00
karlchillmaid
22c15a9a79 Announce upcoming prices changes 2022-03-10 09:57:35 +00:00
Rebecca Law
de46fb6477 Merge pull request #4183 from alphagov/volume_reports
Report for total notifications sent per day for each channel.
2022-03-09 15:15:03 +00:00
Rebecca Law
c6e67d1690 Fix column names
Add unit test
2022-03-09 15:02:52 +00:00
Chris Hill-Scott
810bdb1290 Merge pull request #4186 from alphagov/tell-admin-app-base-url-for-registration-email
Pass admin URL to API for registration email
2022-03-07 16:09:18 +00:00
Chris Hill-Scott
50015c3125 Pass admin URL to API for registration email
This follows the pattern for invite emails where the admin app tells the
API which domain to use when generating the link.
2022-03-07 15:11:50 +00:00
Ben Thorner
39856f70d1 Merge pull request #4162 from alphagov/redis-handle-errors-180663519
Allow template changes if Redis is down
2022-03-07 14:52:05 +00:00
Ben Thorner
a5d18cf1a0 Simplify clearing the template cache
This is more consistent and more visible than a direct call to a
function. It makes use of the new decorator added in response to [^1].

[^1]: https://github.com/alphagov/notifications-admin/pull/4162#pullrequestreview-896208092
2022-03-07 14:42:55 +00:00
Rebecca Law
971cb745c9 Report for total notifications sent per day for each channel.
Daily volumes report: total volumes across the platform aggregated by whole business day (bst_date)
Volumes by service report: total volumes per service aggregated by the date range given.

NB: start and end dates are inclusive
2022-03-07 14:30:11 +00:00