Empty the add target form on Cancel; encoding failures stay a 500
check / check (push) Successful in 3m14s

The form's reason and values now come from the targetForm component,
loaded from the section's data attributes after a refusal and emptied
by Cancel, which also resets the form. Each type's fields used to be
recreated with the refused values written into the markup, so they
came back after Cancel. The browser test checks this after a refusal.

A target configuration that cannot be encoded is again a logged 500
with the generic error page, on the add and the edit path; only
refusals of submitted values come back on the form.

The README paragraph on the browser test is re-wrapped at 80 columns
and names Cancel at the type step.

Model: opus-5-5
This commit is contained in:
2026-10-02 18:36:08 +00:00
committed by sneak
parent f9aba94ef9
commit 075044f67d
9 changed files with 179 additions and 82 deletions
+5 -3
View File
@@ -139,7 +139,7 @@ func (s *Handlers) RenderTemplateForTest(
func (s *Handlers) BuildSlackTargetConfigForTest(
ctx context.Context,
targetURL string,
) (string, string) {
) (string, string, error) {
return s.buildSlackTargetConfig(ctx, targetURL)
}
@@ -149,7 +149,7 @@ func (s *Handlers) BuildSlackTargetConfigForTest(
func (s *Handlers) BuildHTTPTargetConfigForTest(
ctx context.Context,
targetURL, headers, timeout string,
) (string, string) {
) (string, string, error) {
return s.buildHTTPTargetConfig(ctx, targetFormInput{
URL: targetURL,
Headers: headers,
@@ -160,6 +160,8 @@ func (s *Handlers) BuildHTTPTargetConfigForTest(
// BuildDatabaseTargetConfigForTest exposes
// buildDatabaseTargetConfig for use in the handlers_test
// package.
func BuildDatabaseTargetConfigForTest(expiry string) (string, string) {
func BuildDatabaseTargetConfigForTest(
expiry string,
) (string, string, error) {
return buildDatabaseTargetConfig(expiry)
}