Skip to content

Create dedicated edit page for ad codes #195

@GaryJones

Description

@GaryJones

Summary

The current inline edit functionality for ad codes has limitations that make it difficult to provide a good UX for features like autocomplete. A dedicated edit page would provide:

  1. Better form UX - Full-page form with proper spacing and layout
  2. Autocomplete support - Select2 and other dynamic form elements work reliably without z-index/timing issues
  3. More intuitive workflow - Users can focus on editing one ad code at a time
  4. Easier maintenance - Separate edit page is simpler to maintain than inline edit JavaScript

Background

During the implementation of conditional autocomplete (#42), we found that the inline edit form has several challenges:

  • Select2 dropdowns require special handling for z-index (dropdownParent option)
  • Dynamically initializing autocomplete on existing values requires complex timing logic
  • The inline edit form is generated dynamically, making it difficult to reliably initialize form enhancements

The autocomplete feature was scoped to the Add form only (PR #194), with a plan to revisit the edit experience via a dedicated page.

Proposed Solution

Create a new admin page at Tools > Ad Code Manager > Edit Ad Code (or similar URL structure) that:

  1. Loads when clicking "Edit" on an existing ad code
  2. Displays a full-page form similar to the Add form
  3. Pre-populates all fields with the existing ad code data
  4. Includes autocomplete for conditional arguments
  5. Redirects back to the main Ad Code Manager page after save

Implementation Notes

  • Could reuse much of the Add form template
  • Would need a new route/page registration
  • The inline edit could be deprecated or removed once the dedicated page is implemented
  • Consider whether to keep inline edit as a quick edit option for simple changes

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions