[6.x] Inertia User addresses - #19324
Draft
brianjhanson wants to merge 13 commits into
Draft
Conversation
Moves the legacy jQuery NestedElementManager into resources/js/modules/nested-element-manager/ following the shared module pattern: a logic class on @craftcms/garnish Base (modern Select/DragSort for card selection and drag-sorting, documented jQuery seams for the Craft.ui buttons, disclosure/expandable menus, element index, editor slideouts, and Craft.cp), a <craft-nested-element-manager> ControllerElement that boots from an element-type attribute and a JSON settings attribute, a WeakMap instance registry, and an index shim that assigns window.Craft.NestedElementManager (the constructor still accepts the legacy three-argument signature for plugin boots). NestedElementManager::createView() now emits the custom element around its rendered markup instead of an HtmlStack JS boot, so the manager self-boots and re-boots across Inertia fragment swaps. destroy() now actually tears down listeners and the Select/DragSort instances. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Refines the empty-state styling (quiet fill, radius, grid-gap content layout), registers the CraftEmpty export from the package root, and adds Storybook stories covering the label/icon args and the graphic, content, and default (action) slots. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
AddressesController::index() now renders users/Addresses for both
myaccount/addresses and users/{id}/addresses. The address card grid (or
the >50-address element index) stays server-rendered, captured as an
HtmlFragment by the new UserAddressesViewModel and injected by the Vue
page, so the nested element manager keeps working unchanged inside the
Inertia shell.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
createButton/createSubmitButton/createPasteButton in @craftcms/ui build
craft-button elements from the legacy Craft.ui config surface (plus the
modern variant/appearance/size/loading options), with the label in a
slotted span.label to preserve the legacy .find('.label') contract. New
code imports these directly.
The new resources/js/modules/ui shim patches the legacy Craft.ui methods
to delegate to the creators — returning jQuery, and bridging the legacy
style classes (disabled/loading/submit/secondary/small/big) onto the
component properties via a class-attribute observer — whether Craft.ui
is assigned before or after the shim loads. Matrix's paste button is the
first direct-import migration.
Also gives the ui package's `utilities` vitest project the same
tsconfigPaths resolution as the other projects, so utility tests can
import components.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The move/duplicate/copy/delete items the nested element manager used to inject into each card's disclosure menu client-side now come down server-rendered: ElementHtml::nestedCardActionItems() appends behavior-less items marked data-move-forward-action / data-move-backward-action / data-duplicate-action / data-delete-action to the card action menu, each gated on the current user's permissions. The signal (`showNestedActions`) is decided server-side in both render paths: NestedElementManager::getCardsHtml() sets it for its own renders, and app/render-elements derives it from the criterion's ownerId matching the element's actual owner — client-supplied configs can request nothing. Client-side, the manager only wires behavior: the marked items map to the existing bulk-aware move/duplicate/delete flows, the element's own server-wired Copy item is intercepted in capture phase for bulk mode, and the clipboard-dependent Paste item is injected via Craft.addActionsToChip. Position/limit/clipboard gating re-syncs on every state change, replacing the legacy menu-open toggling, and the now-dead client-side menu construction (#initElementActionMenu and the .action-btn lookup) is removed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sugar over passwordConfirmation: pages can name the form fields that require an elevated session when dirty (or '*' for any change) instead of hand-writing the initial-value comparison predicate. The Permissions page is the first adopter. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Re-enables the legacy stylesheet in CpAsset — slideout chrome and other legacy surfaces still depend on it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
📚 Storybook previews@craftcms/ui — open Storybook Changed components: resources/js — open Storybook No changed components detected in this Storybook. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports the user/addresses page over to inertia