mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-24 01:49:15 -04:00
Allow users of the API to search templates by ID
For someone who has retrieved a template ID from their system the only way to find it in Notify is: - hack the URL - click through every template, visually inspecting the ID shown on the page until you find the right one Neither of these is ideal. This commit adds searching by ID, for those services who have an API integration. This means we don’t need to confuse teams who aren’t using the API by talking about IDs. This is similar to how we let these teams search for notifications by reference[1] 1. https://github.com/alphagov/notifications-admin/pull/3223/files
This commit is contained in:
@@ -1924,6 +1924,17 @@ class SearchNotificationsForm(StripWhitespaceForm):
|
||||
)
|
||||
|
||||
|
||||
class SearchTemplatesForm(StripWhitespaceForm):
|
||||
|
||||
search = GovukSearchField()
|
||||
|
||||
def __init__(self, api_keys, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.search.label.text = (
|
||||
'Search by name or ID' if api_keys else 'Search by name'
|
||||
)
|
||||
|
||||
|
||||
class PlaceholderForm(StripWhitespaceForm):
|
||||
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user