Commit Graph

43 Commits

Author SHA1 Message Date
Jonathan Bobel
c57e4b9355 Adding a template to create a User Story issue 2024-01-11 12:43:49 -05:00
Anastasia Gradova
d1b71838e1 style update 2024-01-03 22:13:04 -07:00
Anastasia Gradova
7a1d9cf705 built new beautifulsoup function to apply
html tags to markdown file once processed
with test cases.
2024-01-03 22:01:07 -07:00
Anastasia Gradova
7af656e9f9 registered convert_markdown formatter in __init__. 2023-12-27 12:59:45 -07:00
Anastasia Gradova
a5ec03302e Built py.test cases for convert_markdown_template 2023-12-26 22:04:06 -07:00
Anastasia Gradova
5d91fb6838 fixed isort issue 2023-12-22 10:21:42 -07:00
Anastasia Gradova
ed6471be61 corrected build errors 2023-12-22 10:13:18 -07:00
Anastasia Gradova
0989246334 Moved convert_markdown_template to formatters 2023-12-22 10:03:43 -07:00
Kenneth Kehl
2bd38182d2 code review feedback 2023-11-21 13:40:00 -08:00
Kenneth Kehl
36987e7202 notify-api-861 show eastern time 2023-11-16 12:24:27 -08:00
Kenneth Kehl
8c9721d8e2 notify-api-412 use black to enforce python coding style 2023-08-25 09:12:23 -07:00
Kenneth Kehl
c6eb007386 merge from main 2023-08-25 08:57:24 -07:00
Carlo Costino
9e609efa1c Remove webauthn hooks
This changeset removes webauthn from the Notify.gov admin app.  We are not using webauthn at all in our implementation and will be looking at an entirely different authentication system in the near future.

Signed-off-by: Carlo Costino <carlo.costino@gsa.gov>
2023-08-14 16:59:38 -04:00
Andrew Shumway
34fef6954c Added UTC to formatter return strings and appropriate tests (#617)
Co-authored-by: Andrew Shumway <ashumway@flexion.us>
2023-07-27 11:22:05 -04:00
Kenneth Kehl
7168309fbb fix all tests 2023-06-26 14:07:28 -07:00
Kenneth Kehl
ed274bd266 notify-542: move to 24 hour time for UTC 2023-06-26 08:42:04 -07:00
Carlo Costino
63a97b9780 Remove PY_TIMEZONE references (#547)
This changeset removes the PY_TIMEZONE configuration variable and updates all references to it to refer directly to pytz.utc instead.  It also cleans up a few of the import statements and removes those that are no longer needed (like the current_app reference from Flask).

Signed-off-by: Carlo Costino <carlo.costino@gsa.gov>
2023-06-12 17:00:20 -04:00
Carlo Costino
92d25f5a69 Convert frontend display to be just UTC (#540)
This changeset converts the display of dates and times to be just UTC to match the recent changes in the backend.  This unwinds a bit of work that was done previously and allows us to start with a clean slate in how we want to approach displaying dates and times going forward. It also adds a bit of explanatory text to help users.

Signed-off-by: Carlo Costino <carlo.costino@gsa.gov>
Co-authored-by: stvnrlly <steven.reilly@gsa.gov>
2023-06-12 15:49:48 -04:00
Jonathan Bobel
68e94dd650 Addressing most of the low-lift items from the Notify content audit (#491) 2023-05-08 10:49:30 -04:00
stvnrlly
89613c7d71 simplify formatter 2022-12-12 15:29:04 -05:00
stvnrlly
944715ac46 big commit with letters removal 2022-12-05 15:33:44 -05:00
Ryan Ahearn
dd90d82942 Use naive datetimes for format_delta math 2022-11-30 16:42:42 -05:00
stvnrlly
a0ade73846 getting human time math more correct 2022-11-29 22:07:32 -05:00
stvnrlly
293b3e2609 cleanup 2022-11-28 20:48:25 -05:00
stvnrlly
d45cbb2c86 util for naive dt parsing 2022-11-28 20:40:53 -05:00
stvnrlly
86b28e5e44 some test updates 2022-11-22 16:33:55 -05:00
stvnrlly
46723b6c11 initial timezone pass, which breaks many tests 2022-11-22 12:00:29 -05:00
stvnrlly
218eb3559f Merge branch 'main' into stvnrlly-remove-broadcasts 2022-10-26 01:27:44 +00:00
stvnrlly
067b4b3742 swap dollar symbols for pound symbols 2022-10-12 20:16:22 +00:00
stvnrlly
f16b5dd1c4 remove broadcast-related code 2022-10-04 03:04:13 +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
Chris Hill-Scott
862b95751b Fix links which point at text message status anchor 2022-01-20 15:08:02 +00:00
Chris Hill-Scott
6cb326f153 Update utils to do linear transformation of polygons
Brings in https://github.com/alphagov/notifications-utils/pull/889/files

At the moment, we are not doing any transformation of features before
applying geometric algorithms to them. This is, in effect, assuming that
the earth is flat.

This new version of utils implements the transformation of our polygons
to a Cartesian plane. In other words, it converts them from being
defined in spherical degrees to metres.

For the admin app this means we need to convert places where the code
expects things to be measured in degrees to work in metres instead.
2021-12-01 14:10:54 +00:00
Chris Hill-Scott
72742cf477 Move unknown organisation logic into Jinja
Human readable content like this doesn’t really belong in the model
layer, it’s more natural to have it in the presentation layer.
2021-10-15 09:23:31 +01:00
Chris Hill-Scott
fad3ff70f2 Add a formatter for yes/no
This is a bit neater than a bunch of repetetive ternary statements.
2021-10-15 09:23:30 +01:00
Rebecca Law
d7364eb21a Add permanent-failure to the format_notification_status formatter so the status appears on the activity page. 2021-06-15 13:08:07 +01:00
Chris Hill-Scott
e6bbe3f6a5 Remove Python 2 compatibility code
This will make it easier to upgrade to Flask 3.0 in the future.
2021-06-02 16:15:34 +01:00
Chris Hill-Scott
c3699e0e35 Format numbers as millions or billions
This matches the existing performance platform page, and I think is a
bit easier to read for high-level numbers where you don’t need to see
that they’re changing second-by-second.
2021-03-12 14:44:15 +00:00
David McDonald
f8f3d44511 Add form to set service broadcast account type
Note, no option at the moment to set the service broadcast account type
as None, or back to without the broadcast permission. This has been done
for speed of development given the chance of us needing this is very
low. We can add it later if we need to.
2021-02-23 16:03:14 +00:00
Chris Hill-Scott
48577b823e Add an endpoint to count the length of templates
Users sending text messages are sometimes unaware that long messages
will cost more.

Users sending broadcast messages need to be aware that there’s a
character limit, so they can take this into account when planning their
messages.

This commit adds an endpoint which counts the number of characters in
some template content, and returns a snippet of useful info about how
long the message is.

In subsequent commits we’ll be able to use AJAX to fetch this snippet as
the user types.

There’s a surprising amount of complexity in counting the length of
messages. So we’ll need to do this in Python because it would be too
convoluted to re-implement the length counting in client side code, let
alone ensuring it had parity with its Python equivalent.
2021-01-07 17:07:51 +00:00
Chris Hill-Scott
462294c9d1 Make message and recipient counters formatters
As formatters we can use them in Jinja or Python code.

It also means we don’t need to import them every time we want to use
them – they’re always available in the template context.

For now this doesn’t remove the macros, it just aliases them to the
formatters. This gives us confidence that the formatters are working the
same way the old macros did, and reduces the diff size of each commit.
2021-01-07 11:57:30 +00:00
Chris Hill-Scott
7a95e1618e Extract formatters into their own module
We have lots of functions for converting various types of data into
strings to be displayed to the user somewhere.

This commit collects all these functions into their own module, rather
than having them cluttering up `app/__init__.py` or buried amongst
various other things that have ended up in `app/utils.py`.
2021-01-07 11:57:30 +00:00