Skip to content

Certificates: separate the tags a layout must carry from the fields a form must have #1741

Closed

Description

@rpgmem

Problem

Settings → Certificates holds one list, "Required Certificate Tags", and it decides two different things: which {{tags}} the certificate layout must contain, and which fields the form must have. So {{name}} cannot be required on the form without also being required in the HTML, the field type a required field must have is not configured anywhere (a required field can be switched to any type), and the three fields a new form starts with are hard-coded in the builder.

Design

Two settings, both editable on Settings → Certificates:

  • Required tags in the certificate HTML — one per line. Default {{auth_code}}, {{name}}, {{cpf_rf}}, {{schedule}}. {{auth_code}} stays forced (verification depends on it). {{schedule}} is enforced only when the form has an Event Schedule. Any other tag can be removed.
  • Required form fields — a table of variable name, default label and type. Default name (Text), cpf_rf (Text) and email (Email). email stays forced (the submission requires it and the certificate is sent to it). Rows can be added or removed.

In the form editor:

  • a field the table calls for keeps its name, type and required flag. Its type is locked in the editor and forced on save; its label stays editable;
  • a new form starts with the table's fields;
  • when the form lacks one, the builder offers "Add the required fields".

Compatibility: an install that never saved the new table keeps the fields its old tag list required, and a saved tag list without {{schedule}} keeps the schedule check until the tab is saved again.

Acceptance criteria

  • Two settings, the layout check reads only the first and the field check only the second.
  • Locked type in the editor and on save; label editable.
  • New forms seeded from the table; "Add the required fields" in the builder.
  • Compatibility rules above.
  • Documentation, three catalogues, CHANGELOG, tests.

Delivered in #1742.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions