Skip to content

Releases

v1.77.0

Choose a tag to compare

@dskripchenko dskripchenko released this 14 Nov 11:12
ee4e8f7

Added

  • Action::keepsRecord(): an action that leaves its record open. With
    Layout::resourceIndex()->nextAfterAction() every action run in the record
    drawer moved on to the next record — a comment or a reminder too. An action
    marked ->keepsRecord() leaves the record open (the list still reloads).
    The action's method may decide per run: ['keep_record' => true|false] in
    its array answer is passed in the {slug}/action response
    (AffectedPayload.keep_record) and wins over the flag. Unmarked actions
    move on as before.
  • Wysiwyg::sanitizerAllow(): a field's own sanitizer whitelist. The
    whitelist was fixed inside the package (the default one plus the engine's
    markup) and the field class is final. ->sanitizerAllow(['a' => ['style']])
    merges tag => attributes over it per field; a tag not on the list yet
    becomes allowed. on* handlers, srcdoc, malformed names and the tags the
    sanitizer removes with their content (script, style, iframe,
    object, form…) are refused with an InvalidArgumentException.
  • PermissionRegistry::label($key) and the static
    PermissionRegistry::labelOf($key): a permission's label in the current
    locale, the key when no group declares it.

Changed

  • Refusals name the missing permission by its label. «Нет права
    :permission» and «Доступ запрещён: :permission» (AdminAccess, impersonation,
    role preview, actions, the form listener, import, delayed processes) put the
    raw key into the message; they now use the label from the permission
    registry, falling back to the key. The permission field of the 403
    answers keeps the key.
  • The bundle size budget is raised to 265 KB per bundle (from 260): the
    ESM bundle stood at 259.9 KB after 1.76.0, and the record drawer's
    keepsRecord handling took it a few hundred bytes over.

Security

  • HtmlSanitizer hardening. An on* handler is dropped even when a
    whitelist names it; every address attribute (srcset, ping, poster,
    formaction, action, background, cite, data, longdesc,
    usemap, xlink:href, besides href and src) is checked for
    javascript:, vbscript: and data:text/html; whitespace and control
    characters inside a scheme (java	script:), which browsers skip, no
    longer hide it.

v1.76.0

Choose a tag to compare

@dskripchenko dskripchenko released this 14 Nov 09:44
6d269e4

A minor release rather than a patch: the audit log's morph ids become strings
(see the migration guide) — a raw query comparing subject_id/actor_id with
an integer on PostgreSQL has to compare with a string or use
forSubject()/forActor().

Fixed

  • Auditing a record with a uuid or string key failed with a 500. The
    audit log's morph ids were bigint (nullableMorphs), so on PostgreSQL any
    entry about such a record — {slug}/reveal of a masked column, a
    Loggable change, an impersonation of a uuid-keyed user — failed with
    invalid input syntax for type bigint, and the request with it (MySQL refused
    or truncated it, depending on its SQL mode). A new migration,
    make_admin_audit_logs_morph_ids_strings, makes actor_id, subject_id
    and impersonator_id varchar(64), keeping the data and the indexes; it
    rolls back while every stored id is numeric. The ids are written as strings
    (the MorphKey cast) and an integer key reads back as an int, as before.
    AuditLog::forSubject() / forActor() and Loggable::auditLogs() compare
    the key as a string, eager loading included (PostgreSQL has no
    varchar = integer). audit/list and audit/timeline document
    subject_id / actor_id as strings.
  • The SPA's import did nothing but fail. The list's Import button sent
    upload_id, read mapping and process_id and waited for status done,
    while import/* takes and returns path, auto_mapping, process.id and
    completed: every import ended with the error toast. The flow now follows
    the documented contract (composables/importFlow.ts), counts created and
    updated rows, reports a failed import's own error and stops polling when
    start already returns a finished process.
  • The import's OpenAPI schemas described a different API.
    ImportUploadPayload and ImportPreviewPayload now describe what
    import/upload and import/preview return; ImportProcessPayload.process
    references a new ImportProcess schema. The unused ImportTargetField,
    ImportPreviewRow and ImportPreviewSummary were removed.

Added

  • The package's tests run on PostgreSQL or MySQL/MariaDB as well:
    ADMIN_TEST_DB_DRIVER=pgsql|mysql|mariadb with ADMIN_TEST_DB_HOST,
    _PORT, _DATABASE, _USERNAME, _PASSWORD.

v1.75.1 (security)

Choose a tag to compare

@dskripchenko dskripchenko released this 14 Nov 09:21
963d0d0

Security

  • Import wrote into any resource, without permission checks (critical).
    import/upload, import/preview and import/start checked only that the
    resource was registered: any user signed in to the panel could create
    records in any resource — read-only and create-denied ones included — and
    the mapping could target any column of the model, written with forceFill
    past the resource's fillModel(). preview and start also took the disk
    from the request, so the first rows of any CSV/XLSX file on any disk could
    be read by its path. Now every step requires Resource::importable() (still
    false by default) and the resource's {permission}.create, checked
    through the user model's hasAccess() like the create action; columns map
    onto the create form's fields only (422 invalid_mapping); a row is
    validated and written through the same path as {slug}/create
    (RecordWriter::create(): WYSIWYG sanitizing, translatable fields,
    fillModel()), and the runner drops any stored mapping outside the form.
    The disk is admin.imports.disk only (a different one — 422 forbidden_disk); files go to a per-user folder under
    admin.imports.directory and preview/start read only from the caller's
    own folder (ImportUploads). import/status answers the owner of the
    process or a holder of {permission}.create, anyone else a 404.
  • uploads/serve streamed any file of a servable disk (high). With the
    default servable_disks — the uploads disk — every panel user could read
    every file on that disk by its path: private attachments, other users'
    import files. A disk listed by name now serves admin.uploads.directory
    only; a disk given as a key serves the folders it lists, or all of it for
    '*'. Paths with .. or . segments, backslashes, a leading slash, a NUL
    byte or a scheme are refused.
  • Impersonation left no trace and could lock the administrator in (high).
    The start and the end were logged as two login entries — of the target,
    then of the administrator — and changes made meanwhile named only the
    target. Now impersonation.started / impersonation.stopped are written
    (actor — the administrator, subject — the target), the switch is no longer
    logged as a login, and every audit entry written during an impersonation —
    by any code — carries impersonator_type / impersonator_id (new
    migration). block_higher_powered let any target through whose model had
    no getAllPermissions() — which switched the check off for such hosts —
    and compared wildcard keys literally; it now refuses a target it cannot
    compare and asks the impersonator's hasAccess() for each of the target's
    keys. A target who cannot use the panel or is switched off is refused
    (422 target_cannot_sign_in); if the target loses access meanwhile, the
    session is kept and auth/stopImpersonation still works. Coming back does
    not restore an administrator switched off or with a password changed since
    the start.
  • delayed/status showed any process's result to any panel user
    (medium).
    It now answers the user who started the process through
    delayed/run (remembered by uuid, admin.delayed.owner_ttl), holders of
    the permissions the handler was allowlisted with, and holders of
    admin.delayed.status_permission; anyone else gets a 404.
    ProcessOwnership::remember() marks a process started by the host's code.
  • The panels' API documentation was public (medium). /api/admin/doc
    and laravel-api's /api/doc/{panel} served the full map of the back office
    to anyone. Both now need a user signed in to the panel with
    admin.api_docs.permission (admin.systems.api-docs by default) and are
    off by default in production (admin.api_docs.enabled); laravel-api's
    /api/doc index hides the panel versions from other readers
    (AdminApiModule::getDocMiddleware() adds ApiDocsAccess). The page reads
    its specs from the guarded /api/admin/doc/specs/{version}.json instead of
    files written into public/openapi.
  • A password reset skipped 2FA (medium). auth/resetPassword signed the
    user in right away, so access to the mailbox was enough for an account with
    2FA. Such a user is no longer signed in (payload.user is null) and goes
    through the login form and its code.

Changed

  • Impersonation messages are in Russian, with English translations.
  • See the migration guide for what a host has to check.

v1.75.0

Choose a tag to compare

@dskripchenko dskripchenko released this 14 Nov 08:27
fbbbecc
  • A fall that is good. StatsOverviewWidget::lowerIsBetter() swaps the
    trend's colours of the card added last — for failures or waiting time a fall
    is green and a rise red; the arrow keeps its direction.

Added

  • A share in percentage points. StatsOverviewWidget::share() marks the
    card added last as a share in per cent: its change against the previous
    period is shown as «▼ 0,2 п.п.» rather than per cent of the value;
    trend($delta, $direction, 'pp') sets such a trend explicitly.
  • ListWidget (list) — rows without a table header: a caption, a
    secondary text, a badge with its tone, a link per row, and an empty state
    (item(), items(), emptyText()).
  • A progress column. TableColumn::asProgress($max = 100, $decimals = 0, $tone = null)
    draws a 0..max value as a bar captioned «42 %» — in a table widget, a recent
    list, a resource list and an embedded table.
  • A cell's tone. TableColumn::tone() — a tone for the whole column or a
    function of the value and the row; it colours the cell's text, badge or
    bar. The tones travel beside the row under __tones, the value is
    untouched. A formatter may also return ['value' => …, 'tone' => …].
  • Links in a widget's header. Widget::headerLink($label, $url, $key, $permission)
    and headerLinks([...]) — «Full report», «Journal» right of the title, by
    permission; a widget without a header shows them in its corner.
  • Compact numbers and a list in one card. StatsOverviewWidget::compact()
    puts the numbers in one row inside one card, without the 180 px minimum
    width of a stat card; rows added with item() follow under them in the same
    card.
  • Tiles. StatsOverviewWidget::tiles() — small bordered tiles: a caption,
    the number large and its hint; hintTone() draws the hint as a toned badge
    (in the default cards too).
  • ActionsWidget (actions) — a row of buttons, the first one primary,
    from QuickCreate items shown by the same permission rules as the top bar's
    «+ Create»; fromQuickCreate() takes the panel's own items.

v1.74.2

Choose a tag to compare

@dskripchenko dskripchenko released this 14 Nov 08:01
788ac48

Fixed

  • Vertical tabs: the active marker scrolled away with a long name. The
    kit leaves a tab list scrollable sideways; in a vertical column a name longer
    than the column scrolled, and the marker on the tab's right edge moved with
    the text. The column no longer scrolls sideways and long names wrap onto a
    second line; a tab's counter never breaks and the counters stand at the
    column's right edge.

v1.74.1

Choose a tag to compare

@dskripchenko dskripchenko released this 14 Nov 06:44
811d11c

Added

  • A recommended length. ->counter(60, soft: true) counts against 60
    without capping the input; past it the hint says «— длиннее рекомендуемого».
    For SEO titles and descriptions whose existing values are often longer.

Fixed

  • The confirmation opened behind a record drawer. «Unsaved changes —
    leave?» and the other questions of useConfirm() showed under the drawer
    they were asked from, so nothing could be answered. The kit gives modals and
    drawers one layer and teleports each where it was mounted; the panel-wide
    dialog, mounted first, came out behind. It is now raised above drawers and
    other modals.

v1.74.0

Choose a tag to compare

@dskripchenko dskripchenko released this 13 Nov 18:14
dad9ff0

Added

  • One look for empty, nothing found, failed and no access.
    Resource::emptyState() and Layout::resourceIndex()->emptyState($title, $description, $action)
    (Support\EmptyState; the action: null — "Create", a string — its caption,
    an Action, false — none; ->noResults()). "Nothing found" lists the
    applied filters and offers "Reset the filters". A failed load shows the
    reason, "Retry" and the request code with "Copy the code": the client puts
    X-Request-Id on every request, the server echoes it and logs it as
    admin_request_id. "No access" names the section and the missing key with
    "Copy the key": the router passes them to the 403 page, AdminAccess sends
    payload.permission. A screen that fails to load and the embedded table of
    related records show the same states. AdminState is exported.
  • Field\PermissionMatrix — a role's permissions as a matrix: folding
    groups with a three-state checkbox and "N of M", a search over labels,
    hints and keys, "Only selected", "Select all", "Selected N of M", an
    optional second column (extraColumn()). The value is a list of keys;
    groups from an array, a closure or fromRegistry().
  • A list or a screen in a side panel by a link. Link::inDrawer() /
    target('drawer'), TableColumn::asLink($template, 'drawer'),
    openInDrawer($url): a resource's list filtered, sorted and scoped by the
    link's query (kept out of the page's address), or a screen with its query,
    over the current page; "Open as a page".
  • Layout::timeline() — events of different kinds with icon, tone,
    time, title, folded details and a link; chips by kind with counts and
    "Only errors"; from a state key, a list or a closure; limit().
  • Before / after in the audit history: long texts line by line (one long
    line word by word), JSON as path: value lines, changes marked, unchanged
    runs folded. AuditValueDiff is exported.
  • Tabs::searchable() — a search over the fields of every tab: finds per
    tab, dimmed tabs without any, the fields and blocks it does not find
    hidden, the ones it does marked.
  • Unsaved changes. Screen::saveMethod() — a sticky bar naming the
    changed fields by tab and block, Discard and Save, a mark on each changed
    field, a question before leaving. A resource form asks before leaving with
    changes too.
  • Field::counter(?max) — "27 of 120 characters" under a text field;
    StatsOverviewWidget::stat(..., hint:) — a line under the number.

Changed

  • An empty list reads "No records" (was "Nothing here yet"). See the
    migration guide for the other visible changes.

Not in this release

  • Rolling a value back from the audit log: the package has no restore from
    the log; a project action does it.
  • A cross-resource trash, the top bar and widget odds and ends (a search
    field in the top bar, the role under the user's name, title badges,
    "1 of N" in the record drawer) and the page builder's additions.

v1.73.0

Choose a tag to compare

@dskripchenko dskripchenko released this 13 Nov 18:10
0e7b4d3

Added

  • Menu counters computed per request. MenuNode::badge(fn (?Model $user) => …, 'danger')
    — the closure runs on every menu request for the signed-in user, only
    when the node is visible to them, and may return a number, a text, null or
    ['value' => …, 'tone' => …]; one that throws shows nothing. A red tone
    (danger), 99+ above 99. GET system/menuCounters returns the computed
    badges alone, and the panel polls it every
    admin.navigation.poll_interval seconds (60; 0 — off) and when the browser
    tab becomes visible. MenuNode::sumBadges() (or
    admin.navigation.sum_badges) — a folded group or area shows the sum of
    its descendants' counters, red when one of them is.
  • Folded groups, remembered; titled sections. MenuNode::collapsed() /
    ->expanded() set a group's initial state, admin.navigation.groups_expanded
    the panel's default (folded, as before); the user's own folding is saved on
    the server per user and comes with the menu (groups).
    MenuNode::section('Pinned', [...]) — a titled block of the root whose
    items are listed flat; the breadcrumbs leave it out.
  • Favourites and recent pages. A star in the top bar keeps any page with
    its query (a tab, a list's filters) in the user's favourites — a block above
    the menu, reordered by dragging or Alt+↑/↓, at most
    admin.navigation.favorites_limit (7). The last recent_limit (10) screens
    and records opened are kept as well. Both live on the server — the new
    package migration admin_navigation_states — behind navigation/state,
    favorite, unfavorite, reorderFavorites, visit and group, and are
    shown only where the user's permissions let them in right now
    (Navigation\UrlAccess).
  • The Ctrl+K palette. An empty query shows the favourites and the recent
    pages; the sections include the tabs of the menu's screens kept in the
    address (GET system/menuTabs), found by the label, the menu path and the
    tab's key; the "+ Create" items are its actions.
    $admin->searchProviders([SearchProvider::make($key, $label)->recognizes($regexOrClosure)->priority(…)->using(fn ($q, $user) => [...])])
    — the host's own searches, with recognizesPhone(), recognizesEmail(),
    onlyWhenRecognized(), permission() and limit(): a group whose
    recognizer recognized the input goes on top. Support\Mask masks the
    items.
  • A list's condition and default filters, tab badges.
    Resource::scopes() — named conditions — and
    Layout::resourceIndex(X::class)->scope('pending'): every request of the
    list carries scope, which the user cannot lift (an unknown one is a 422);
    ->defaultFilters([...]) — the filters a list opens with, which the user
    may clear (filter=none keeps it cleared). Resource::countIn($scope).
    Layout::tabs()->badges([key => number|closure|['value', 'tone']]) /
    ->badge($key, $value, $tone).
  • "+ Create". $admin->menu()->quickCreate([QuickCreate::resource(NewsResource::class), QuickCreate::make($key, $label, $url)->permission(…)])
    — a menu in the top bar filtered by permission (.create for a resource).
  • Layout::screen(ScreenClass::class, $params) — another screen in
    place, a tab say, with its own state, command bar, methods and
    permissions (a store of its own in the SPA).
  • Dashboard periods. DashboardContext takes today, month,
    quarter and ranges Y-m-d..Y-m-d besides Nd and all, with
    label()/labelFor(), previous(), compare()/comparing(),
    filterQuery($field) and listUrl($path, $field).
    DashboardScreen::customRange() (a range picker) and comparable()
    ("Compare with the previous period", dashboard/widgets?compare=1); the
    manifest carries periodLabels. Widget::link($url) — a link on a widget;
    StatsOverviewWidget::url() / stat(..., url: …) and previous() — a link
    and the previous value of each number.
  • Masked personal data. TableColumn::masked('phone'|'email'|'name'|'passport'|'full'|Closure, ?$permission)
    — the value leaves the server masked, in the export too; the cell's "Show"
    calls POST /{slug}/reveal with the permission ({base}.reveal by
    default), and the reveal is written to the audit log as pii.revealed
    (actor, record, field). The list's meta.revealable names what the user may
    reveal.
  • Breadcrumbs. admin.navigation.breadcrumbs = 'compact' —
    Area › Screen › Tab › Record without the menu's groups; the open tabs kept
    in the address are named after the screen; a crumb of a list or a screen
    leads back with the query it was left with.

Changed

  • A list's address keeps a date range as filter[x][from] /
    filter[x][to] (it used to be written as [object Object]) and reads it
    back, so a widget can link "to the journal for the period".
  • Layout::dashboard() on an ordinary screen leaves out the widgets whose
    permission() the user lacks, as a DashboardScreen does.
  • dashboard/savePeriod and dashboard/widgets take periods up to 32
    characters.

Fixed

  • Columns of a resource were read while the routes were being built.
    Deciding whether a resource needs the reveal endpoint called its
    columns() from the route compiler — before the host's own routes exist, so
    a column that builds a URL with route() broke the whole panel API. The
    endpoint is now registered for every resource; the controller already
    refuses a column that is not masked (422 not_masked).

v1.72.0

Choose a tag to compare

@dskripchenko dskripchenko released this 13 Nov 14:18
829233a

Added

  • Layout::blockTree(): palette presets. ->presets([BlockPreset::make($key, $label, $type)->data([...])->meta([...])])
    (or ->preset($key, $label, $type, $data, $meta, $group, $icon), or arrays
    through BlockPreset::fromArray) — a palette item that inserts a ready
    node: of an ordinary type, with its own data, meta and, maybe, children
    (->children([...])), in a group of the palette, with an icon, a
    description and a thumbnail. A shared block of a library, say, no longer
    needs a type of its own. The pick inserts a node of that type with a copy
    of the data and meta under a new temporary ref (each child its own); the
    preset is offered only where its type — and its children — may stand by
    the type's rules and meta.accepts, and TreeValidator checks the node as
    any other. A preset of a type the editor does not have is not sent.
  • BlockTree::draftSaved(..., nodes: [ref => ['data' => [...], 'meta' => [...]]])
    — the draft's answer may give the data and meta of the nodes the server
    normalized (a file's temporary path made permanent, a preset turned into a
    full block), by the renamed ref (or the temporary one). The editor applies
    them, except the fields typed in while the request was out: those keep the
    input (and their meta.fields entry) and go with the next draft. The open
    properties form is updated in place — the input keeps its focus.
  • data-testid for end-to-end tests. The shell and the pages are marked
    by names and keys, never by captions: the login and two-factor forms, the
    menu (menu-{key} on groups too), the user menu, the toasts
    (toast-{level}), a resource's list (resource-index-{slug}, the search,
    filter-{name} with its popover and buttons, resource-row-{key},
    cell-{column}, the row and bulk actions, the pagination), the form
    (field-{name}, form-cancel), the card (entry-{name}, view-*), the
    screen (screen-{slug}, screen-commands), Layout::modal() /
    Layout::drawer(), the tabs (tab-{key}) and the block tree
    (block-tree-node-{ref}, the palette's types and presets, the bar). The
    names that were there stay. testIdOf(...parts) is exported for the
    host's own components. The list is in docs/*/testing.md.

v1.71.0

Choose a tag to compare

@dskripchenko dskripchenko released this 13 Nov 12:05
3d8da7d

Added

  • Layout::blockTree(): inherited fields. A node may carry
    meta.fields — {name: {inherited, base}} — for a tree whose blocks
    inherit from shared base blocks. The properties form marks such a field
    Inherited (the value is the base's) or Overridden, with Return the
    base value
    : it puts base into the node's data (the node is changed, as
    after an edit, and the step can be undone) and sets inherited back to
    true for the server. An edit of an inherited field turns the mark to
    Overridden at once — the value is compared with base; what is saved is
    still the server's decision.
  • Layout::blockTree(): node rules. meta.accepts — the types allowed
    inside this node instead of its type's ([] — none); meta.locked — the
    node is read-only: its form, its children (none added, removed or
    reordered), its place and its removal; it can still be selected and
    viewed, and is marked with a lock. The palette, the drag's drop zones, the
    insert, duplicate and delete all follow them. TreeValidator checks
    meta.accepts, and with the stored tree given —
    errors($nodes, original: $stored), also on passes() and validate() —
    reads the meta from there (the request cannot widen the rules) and keeps a
    locked node's type, data, parent and children; it may go away only with an
    unlocked ancestor removed as a whole.
  • BlockTree::draftSaved($refs, $fingerprint, ?$savedAt) — the draft's
    answer that does not replace the tree: the new blocks' temporary refs are
    renamed to their ids (['new-1a2b' => 51]) — with the selection, the
    folded nodes, the open form and the undo steps — and the value takes the
    new fingerprint. Whatever was typed while the request was out stays and
    goes with the next draft. BlockTree::saved($value) works as before.

Fixed

  • Layout::blockTree(): a conflict and errors in the draft's answer.
    BlockTree::conflict() and BlockTree::invalid() from the draft method —
    and a ValidationException keyed by the tree's path — were ignored or only
    toasted. They are now shown as for the publish: the differences in a
    message (Draft not saved), the nodes' errors on the nodes. The autosave
    pauses meanwhile: after errors until the next change, after a conflict
    until Save over in the bar (it takes the conflict's fingerprint and saves
    again) or a publish, discard or reload.