Commit Graph

480 Commits

Author SHA1 Message Date
Carlo Costino
9a83ba7475 Localize notification_utils to the admin
This changeset pulls in all of the notification_utils code directly into the admin and removes it as an external dependency. We are doing this to cut down on operational maintenance of the project and will begin removing parts of it no longer needed for the admin.

Signed-off-by: Carlo Costino <carlo.costino@gsa.gov>
2024-05-16 10:37:37 -04:00
Kenneth Kehl
26988d255f remove logged_in_elsewhere as per code review feedback 2024-05-08 12:45:01 -07:00
Kenneth Kehl
125ad7a2f7 remove logged in elsewhere check 2024-05-07 11:11:12 -07:00
Carlo Costino
6b12f740b2 Merge pull request #977 from GSA/ADMIN-97_Resend_Expired_Invites
Admin 97 resend expired invites
2023-12-21 16:23:31 -05:00
Cliff Hill
6f43be69ba Wired up admin to send resend invite request to api.
Signed-off-by: Cliff Hill <clifford.hill@gsa.gov>
2023-12-20 14:53:02 -05:00
stvnrlly
06e3a8b991 put back a go_live_at 2023-12-20 11:27:12 -05:00
stvnrlly
378717571b remove unused support forms/pages & unused go-live form 2023-12-20 10:44:38 -05:00
stvnrlly
f600dd95d6 remove email branding 2023-12-18 16:10:12 -05:00
Kenneth Kehl
cee2552706 notify-admin-931 2023-12-04 14:52:48 -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
Kenneth Kehl
476644369d notify-admin-211 remove nhs-specific code 2023-08-24 07:49:42 -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
Steven Reilly
13d0e46b52 blunt rename of org (#620) 2023-07-12 12:09:44 -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
Kenneth Kehl
54abfb3a4d remove components related to MOU and agreement (#476)
Co-authored-by: Kenneth Kehl <@kkehl@flexion.us>
2023-04-28 14:08:12 -04:00
Ryan Ahearn
a42617f776 Add logging around auth{entication,orization} calls 2023-04-26 11:25:24 -04:00
Kenneth Kehl
1a2bd34ccb merge from main 2023-04-20 11:19:55 -07:00
Kenneth Kehl
65ea248429 #446 remove crown 2023-04-13 07:13:04 -07:00
Ryan Ahearn
de668d7aba Remove contact-list references from code 2023-04-12 15:35:14 -04:00
stvnrlly
944715ac46 big commit with letters removal 2022-12-05 15:33:44 -05:00
stvnrlly
c2ebcd5bfd remove old commented-out org types 2022-12-02 14:33:14 -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
e12e780a05 code cleanup 2022-11-28 15:53:56 -05:00
stvnrlly
8bd1285bfa more test fixes 2022-11-28 10:48:51 -05:00
stvnrlly
a2b58c926e more test fixes & letter trimming 2022-11-22 22:50:47 -05:00
stvnrlly
ca1897973a test time fixes and bonus letter removal 2022-11-22 17:03:42 -05:00
stvnrlly
46723b6c11 initial timezone pass, which breaks many tests 2022-11-22 12:00:29 -05:00
Ryan Ahearn
4fce69f0ac Merge branch 'main' into cleanup-config
* main:
  lingering merge repair
  remove alerts from env
  remove broadcast-related code
2022-10-26 13:23:01 +00:00
stvnrlly
218eb3559f Merge branch 'main' into stvnrlly-remove-broadcasts 2022-10-26 01:27:44 +00:00
Ryan Ahearn
921c872bd1 Refactor method of retrieving credentials out of VCAP_SERVICES 2022-10-20 08:36:30 -04:00
Steven Reilly
345516606f Merge pull request #59 from GSA/stvnrlly-update-form-flow
Update services for post-sign-up tour
2022-10-17 09:43:32 -04:00
stvnrlly
f16b5dd1c4 remove broadcast-related code 2022-10-04 03:04:13 +00:00
Ryan Ahearn
5f1a1f083a Proactively specify aws region for s3 operations 2022-09-26 10:25:03 -04:00
Ryan Ahearn
a90dcc918b Provide s3 credentials for each individual bucket 2022-09-23 12:59:55 -04:00
stvnrlly
3e7b5b4370 update tests based on updated orgs 2022-09-15 18:47:04 +00:00
stvnrlly
7b51d1e7a6 remove nhs and gpo forms 2022-09-13 13:20:54 +00:00
Ben Thorner
5db2581669 Simplify tests for TemplateList class
In response to: [^1][^2][^3].

Originally there were three tests:

- One was testing the "get_user_template_folders" method directly.

- The other two were testing "get_template_folders", which calls
the "_user_" method if a user is passed - this is what the tests
were primarily checking, by passing or not passing a User object.

The two tests of "get_template_folders" also implicitly checked
that it filtered folders based on a "parent_folder_id". I wanted
to emulate the tests but it makes more sense to simplify them, as
the methods are now only used by TemplateList internally.

To simplify, we just keep just two tests to check that the overall
set of folders is filtered based on the presence of a User. We do
lose the implicit check of filtering by "parent_folder_id", but:

- We are still checking this implicitly in the sense that the loop
to generate the overall set of folders terminates. If the method
didn't do any filtering, the loop would be infinite.

- We need to acknowledge that these tests were incomplete to begin
with. There is also lots of coverage in higher level tests [^4],
although it's harder to reason exactly what is covered.

[^1]: https://github.com/alphagov/notifications-admin/pull/4258#discussion_r890144076
[^2]: https://github.com/alphagov/notifications-admin/pull/4258#discussion_r890151220
[^3]: https://github.com/alphagov/notifications-admin/pull/4258#discussion_r890147506
[^4]: 1787f9f42f/tests/app/main/views/test_template_folders.py
2022-06-07 11:31:09 +01:00
Ben Thorner
1c4a2b4790 Cache templates and folders in TemplateList
This gives us the performance gains identified in [^1] for the test
service described in the spike:

- user_template_folders - from 10s to a little above 3s on its own

- get_templates_and_folders - from 10s to below 6s on its own

In combination, these two uses of caching reduce the test page load
time from 10s to a little above 3s. This is slightly higher than in
the spike PR due to all the extra work we're doing to generate the
"move to" list of folders, as described in a previous commit.

The render time is unchanged for services with few folders. We start
to see the benefit of this change at around 200 templates + folders,
with no evidence that any service will experience worse render times,
despite the extra work we're doing from previous commits.

[^1]: https://github.com/alphagov/notifications-admin/pull/4251
2022-06-07 11:05:36 +01:00
Ben Thorner
2771ae1274 Remove redundant user param from template methods
This will finally make it possible to cache some of the methods.
2022-06-07 11:05:35 +01:00
Ben Thorner
9126c8ca5e Move _template_ methods to TemplateList class
This is a straight move with a few minor tweaks:

- Some references to self.X in the code from Service now need to
become self.service.X.

- Some reference to self.service.Y in TemplateList can now become
self.Y for the methods that were migrated.

The remaining _template_ methods in Service are still called from
multiple places and there's no performance gain to motivate moving
them out of the Service class, which is now a more manageable size.
2022-06-07 11:05:34 +01:00
Ben Thorner
487dc1b488 Test _template_folders functions via TemplateList
This is part of the overall migration of the "_template_folders"
methods to the TemplateList class. Moving the existing tests now
will make the actual migration easier to follow.

To emulate the second and third tests, we need to grab a specific
folder from the TemplateList and then look at its folders - these
are set based on "get_template_folders" as before.
2022-06-07 11:05:30 +01:00
Ben Thorner
b97bf19b45 Make creating TemplateListServices consistent
TemplateListServices are used when we want to show the service
as an additional layer of hierarchy when a user copies a template,
potentially across services [^1].

Normally a TemplateFolder is given "folders" and "templates" by
TemplateList [^2]; TemplateListService was doing it the other
way round and getting its own instead.

Using a subclass of TemplateList means we can make the approach
consistent, which will support the caching approach later on, as
well as simplifying how we work with templates and folders.

[^1]: 2e637f801f/app/main/views/templates.py (L356)
[^2]: bef0382cca/app/models/template_list.py (L31-L36)
2022-06-07 10:43:30 +01:00
Ben Thorner
a87138b9f9 Refactor loop over TemplateList items
This is a technique we'll use in later commits.
2022-06-06 10:36:49 +01:00
Ben Thorner
ad4ef12251 Reuse TemplateList to display move-to options
This is slightly less efficient than getting the folder dicts from
"get_user_template_folders" directly, since:

- TemplateList returns both templates and folders.
- TemplateList encapsulates the dicts in model classes.

We'll compensate for this later on:

- We'll introduce a new caching approach to make the call fast.
- We'll expose a property to avoid the "if" in the comprehension.
2022-06-06 10:36:48 +01:00
Ben Thorner
f500db44f1 Reuse TemplateList class when deleting a folder
Part of moving "get_template_folders" et al. into TemplateList so we
can cache it more effectively. This is slightly less efficient as
iterating a TemplateList will instantiate an object for each item
in the folder; but the difference is minimal.

Note that:

- The default template_type for TemplateList is "all".
- We need to pass realistic template "JSON" in the test now.
2022-06-06 10:36:47 +01:00
Ben Thorner
32efb9a03d Fix go-live checks ignoring nested templates
This is a very low impact bug since a user can always create such
templates after their service is live and not be subject to checks
we do before that point. Still, we may as well fix it.

The main benefit of this change is actually to contribute towards
moving methods like "get_templates" out of the Service class so
we can simplify and cache their results more effectively.

Note: I wanted to simplify the Service class further as the two
"has_" properties are only used once in the app code. Unfortunately
they are tightly coupled in one of the tests as well [^1].

[^1]: bef0382cca/tests/app/main/views/service_settings/test_service_settings.py (L1961-L1962)
2022-05-27 12:46:37 +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