mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-15 07:18:58 -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:
@@ -29,7 +29,7 @@ from app.main.forms import (
|
||||
EmailTemplateForm,
|
||||
LetterTemplateForm,
|
||||
LetterTemplatePostageForm,
|
||||
SearchByNameForm,
|
||||
SearchTemplatesForm,
|
||||
SetTemplateSenderForm,
|
||||
SMSTemplateForm,
|
||||
TemplateAndFoldersSelectionForm,
|
||||
@@ -159,7 +159,7 @@ def choose_template(service_id, template_type='all', template_folder_id=None):
|
||||
),
|
||||
template_nav_items=get_template_nav_items(template_folder_id),
|
||||
template_type=template_type,
|
||||
search_form=SearchByNameForm(),
|
||||
search_form=SearchTemplatesForm(current_service.api_keys),
|
||||
templates_and_folders_form=templates_and_folders_form,
|
||||
move_to_children=templates_and_folders_form.move_to.children(),
|
||||
user_has_template_folder_permission=user_has_template_folder_permission,
|
||||
@@ -352,14 +352,14 @@ def choose_template_to_copy(
|
||||
),
|
||||
template_folder_path=service.get_template_folder_path(from_folder),
|
||||
from_service=service,
|
||||
search_form=SearchByNameForm(),
|
||||
search_form=SearchTemplatesForm(current_service.api_keys),
|
||||
)
|
||||
|
||||
else:
|
||||
return render_template(
|
||||
'views/templates/copy.html',
|
||||
services_templates_and_folders=TemplateLists(current_user),
|
||||
search_form=SearchByNameForm(),
|
||||
search_form=SearchTemplatesForm(current_service.api_keys),
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user