Skip to content

v6.0.0

Choose a tag to compare

@github-actions github-actions released this 23 Oct 14:44
· 168 commits to main since this release

See Upgrading to 6.x for what apps need to change.

Behaviour changes

  • server: Patches check the values of required properties that they send, rejecting empty strings with 'is required'.
  • server: UserMixin rejects empty passwords with a validation error, instead of setting the hash of ''.
  • server: Values outside range are reported as range errors, "must be between 1 and 5", instead of minimum or maximum errors.
  • server: Removed, see Server:
    • app.compileValidator(): use app.compileJsonSchema().
    • Hook keys that name actions by their keys, e.g. 'before:member:get tech-doc-:format', no longer match: use their identifiers, e.g. 'before:member:get-tech-doc-format'.
    • The types HTTPMethod, SelectModelProperties, SelectModelKeys, ExtractModelProperties and SelectModelPropertyKeys: use HttpMethod, SerializedModel and keyof SerializedModel.
  • admin: Removed schema options, see Schemas:
    • components of schemas, filters and showDialog(): use fields, and field instead of component in views.
    • min and max: use minimum and maximum.
    • rules: use the limits of fields, their types and validate().
    • events: {}: use the on… handlers, e.g. onChange().
    • type: 'computed', 'data' and 'hidden': use type: 'value'.
  • admin: format of color fields is renamed to colorFormat, and of date, datetime and time fields to formats. The old keys are ignored. format, parse, compute and process only throw as 3.x value hooks when they're callbacks.
  • admin: HTML, see HTML:
    • Strings returned by render() of columns, lists, objects and uploads, and the messages of confirm(), prompt() and alert(), show as escaped text: create HTML with html of @ditojs/utils.
    • { html } objects, type: 'html' affixes and the html option of notify() are removed: use the html template.
  • admin: DitoField is removed: use DitoSchemaField. login.additionalComponents is removed: use login.additionalFields.
  • admin: The deprecated TypeScript type aliases are removed, see TypeScript types.
  • admin: Hidden fields, see Behaviour changes:
    • Values of hidden fields (if false, or in hidden sections, tabs or panels) aren't saved or copied.
    • Of several fields of the same value, only shown ones run serializeValue() and display the value in item labels and table cells. Hidden fields still set their defaults.
    • A nested section whose fields are all hidden counts as hidden, together with its own value.
    • An if that throws is logged and its field treated as shown, instead of stopping validation.
  • admin: Item labels and table cells only display the values of the item itself, not of its nested sections.
  • admin: Validation and errors:
    • Fields validate on blur with the checks of all fields of the same value, as submits do.
    • Collapsed schemas render their content hidden while it holds errors, and reveal the errors.
    • The Validation Errors notification lists all errors that no mounted component displays, e.g. of nested forms that aren't open.
    • Options given as an array no longer reject values that aren't among them: the server's enum decides.
    • The labels of required fields are marked with *.
  • admin: Data and defaults:
    • object fields with nullable: false start as an object with the defaults of their form instead of null.
    • Copies hold only values that have a field, and drop the ids in nested sections, so pasting creates new records.
    • Emptied text fields save their empty value, null, or '' with nullable: false, instead of their default.
    • Uploads with multiple call downloadUrl() and thumbnailUrl() with the context of each file, as value and valueIndex.
  • admin: Routes, see Routes of forms and Tabs:
    • The URLs of routed forms contain the names of their tabs, sections and panels, e.g. /admin/books/1/pricing/editions/0.
    • The selected tab is a segment of the URL path instead of the hash, e.g. /admin/books/1/pricing.
    • Forms open through the sources that render them, also in collapsed sections, tabs and panels. Paths that no source claims lead back to the form or page.
    • The forms of items of items open once their parent item exists.
    • Views keep their components mounted, hidden, while an item's form is open, and route the forms of inlined lists and trees.
    • Hidden sources load their data once shown, lists take their query back into the URL when forms close, and reload only if a form saved an item.
  • ui: Calendar states are modifiers: dito-calendar-item-today, -active, -current and -gray become dito-calendar__item--today, --active, --current and --gray.
  • ui: Fields show errors and disabled state by --has-errors and --disabled modifiers of their own block instead of .dito-container--… classes. Custom blocks that extend %field or %input need to set them, see UI.
  • schema: keywords._enum and keywords.multipleOf lose validate(), and the empty format loses validatesEmptyValues.

New

  • server: The decimals keyword limits the decimal places of numbers, as in the admin, e.g. decimals: 2.
  • admin: Labels, item labels, info, affixes, render() results, dialog messages and notify() paragraphs take html values, see Text and HTML.
  • admin: Forms with properties and widgets, see the guide and Widgets:
    • Forms of useDitoForm() can describe their data with properties in the format of the server's model properties, plus the admin's keywords such as if, computed or validate().
    • Widgets lay them out in DitoSchemaForm, one per field type, e.g. DitoTextField or DitoSelectField, with the display options of the type as props.
    • DitoSection, DitoListField, DitoObjectField and DitoTreeListField with DitoTreeLevel lay out sections, lists, objects and trees.
    • DitoCustomField edits a property with the content of its slot, e.g. v-model="field.value".
    • Nested forms in schema views can use properties instead of fields, see Nested forms in schema views.
    • Written properties support times with { type: 'string', format: 'iso-time' }.
  • utils: The html tagged template creates HTML that the admin renders, escaping the values it includes. isHtml() recognizes it and asHtml() converts values, see HTML.

Fixes

  • admin, fields:
    • Options fields with nullable: false no longer fail on their empty value.
    • context.getErrors() lists the errors of a value once, also when several fields edit it.
    • Nested forms take their component paths and field ids from their route, also on reload.
  • admin, forms:
    • Forms of useDitoForm() that create an item no longer fail with "Maximum call stack size exceeded" when items are added to their lists.
    • The form of useDitoForm() in a page fills the view and keeps its buttons at its bottom.
    • DitoSchemaForm outside of pages, e.g. in dialogs, pads its content like forms in views.
    • Buttons that are all hidden take no space.

Internal

  • admin: RouteTree only holds menus and views, and setup names components, tabs and panels by their keys.