Skip to content

fix(actions): nullable arrays, required fields and form layout - #35

Merged
MathiasReichardt merged 2 commits into
mainfrom
fix/required-error
Oct 6, 2026
Merged

MathiasReichardt merged 2 commits into
mainfrom
fix/required-error

Conversation

@MathiasReichardt

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #34. Optional arrays blocked Submit, and there was no way to send null for an array.

Arrays

  • A nullable array without a default value is sent as null. Before, it was always sent as [].
  • A non-nullable array without a default value is required: it gets an asterisk, and Submit stays blocked until it is set.
  • The array card shows its state next to the name: null, not set or empty.
    • Removing the last item leaves an empty array.
    • Nullable arrays have a "Set to null" button.
  • formly no longer marks arrays as required, because that rejected []. formly's [] default for arrays in required no longer hides a missing value.

Submit

  • The Submit tooltip names the invalid fields and the checks that fail, for example Please fix: labels (required).

Layout

  • Checkbox fields are as high as text inputs, and the box lines up with input text.
  • Array fields keep the same gap to the next field as inputs do.
  • The property tree no longer shrinks checkboxes elsewhere in the app. Its ::ng-deep style was not scoped.

Breaking change

A non-nullable array without a default value now blocks Submit until it is set. APIs should send [] as the default value for arrays that may start empty.

Tests

  • e2e: nullable and non-nullable arrays (states, request body, "Set to null") and default values from the server.
  • Unit: nullability rules for each schema shape, and the list of invalid fields.

Mathias Reichardt added 2 commits October 6, 2026 12:21
…lable ones

- nullable arrays without default are sent as null, not as an empty array
- non-nullable arrays without default value are required, shown with asterisk
- array card shows null, not set or empty, nullable arrays can be set back to null
- removing the last item keeps an empty array
- formly's [] default for required arrays no longer hides a missing value
- no asterisk on arrays from formly: required rejected an empty array, which is a valid value
- remove formly's required on arrays before the form is built, not after a rebuild
- list invalid fields and failed checks in the Submit tooltip

BREAKING CHANGE: non-nullable arrays without a default value now block Submit
until they are set; send a default value of [] for arrays that may start empty.
…ields

- checkbox fields are as high as text inputs and the box lines up with input text
- array fields keep the same gap to the next field as inputs
- property tree no longer shrinks checkboxes outside the tree
@MathiasReichardt
MathiasReichardt merged commit d3ddf14 into main Oct 6, 2026
2 checks passed
@MathiasReichardt
MathiasReichardt deleted the fix/required-error branch October 6, 2026 10:47
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