Skip to content

fix(platform): collect a connector's declared config fields - #2878

Merged
Israeltheminer merged 2 commits into
mainfrom
fix/credential-config-fields
Aug 3, 2026
Merged

Israeltheminer merged 2 commits into
mainfrom
fix/credential-config-fields

Conversation

@Israeltheminer

@Israeltheminer Israeltheminer commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Adding an IMAP / SMTP mailbox credential fails with

Connector "imap-smtp" needs "IMAP server"

— naming a field the form never offers. createCredential validates the submitted
config against the connector's declared configFields and refuses a missing
required one, but the add dialog installed noExtras(), so it renders none of
them. Any connector declaring a required config field is unreachable through the
UI; imap-smtp requires both imapHost and smtpHost.

The backend half already existed — normalizeConfig coerces types, honours enums,
applies defaults and rejects undeclared keys. This wires the form to it.

Changes

  • listConnectors returns configFields. The settings catalog dropped them,
    so the UI could not have known what to ask for.
  • A config extra module renders one control per declared field, typed from the
    declaration: boolean → switch, string + enum → select over exactly those
    values, otherwise an input. Numbers stay strings in form state and are coerced
    by the server. A declared default renders as a placeholder, not a prefilled value.
  • Blank entries are dropped rather than sent as ''.

Completeness and edit round-trip

CredentialExtraModule gains optional vendor-aware isComplete; both dialogs gate on it.
listCredentials returns config so edit cannot wipe hosts/ports.

Follow-ups

Note

Field labels come from the shipped connector YAML rather than the locale catalogs.

The add dialog never rendered a connector's configFields, so required
hosts (e.g. imap-smtp) could not be supplied and createCredential refused
with "needs <label>". Return configFields from the catalog, collect them
in a typed extra module, gate submit on completeness, and round-trip
config on edit so a save cannot wipe hosts.
@Israeltheminer
Israeltheminer force-pushed the fix/credential-config-fields branch from e1d8e2d to 0c0a4f4 Compare August 2, 2026 18:40
@Israeltheminer

Copy link
Copy Markdown
Contributor Author

Rebased onto current main after the credential catalog became a table (credential-add-dialog instead of credential-create-dialog). Scope unchanged: configFields collection only — split SMTP auth and credentials UI polish land in a follow-up stacked on this PR.

That toggle ships in the stacked imap-smtp PR; asserting it here fails UI
because the form does not render the switch yet.
@Israeltheminer
Israeltheminer merged commit fb15e59 into main Aug 3, 2026
48 of 50 checks passed
@Israeltheminer
Israeltheminer deleted the fix/credential-config-fields branch August 3, 2026 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant