Aurora. Uix. Templates. Basic. Actions. OneToMany
(Aurora UIX v0.1.4-rc.2)
Copy Markdown
Provides helpers for managing one-to-many association actions in Aurora UIX index layouts.
This module sets up and modifies actions for header, footer, and row elements in index layouts
that represent one-to-many associations. It ensures that default actions are present and
allows for further customization via the Actions.modify_actions/2 function.
Key Features
- Adds default actions for headers, footers, and rows in one-to-many association tables.
- Integrates with the Aurora UIX action modification pipeline.
- Provides helpers for rendering "new", "show", "edit", and "delete" child links in form layouts.
Key Constraints
- Expects the
assignsmap to include an:auixkey with required subkeys for actions. - Designed for use within Phoenix LiveView templates and Aurora UIX layouts.
Summary
Functions
Renders a link for adding a new child entity in a one-to-many association form.
Renders a link for deleting a child entity in a one-to-many association.
Renders a link for editing a child entity in a one-to-many association.
Sets up actions for the one-to-many field rendering layout by adding defaults and applying modifications.
Renders a link for showing a child entity in a one-to-many association.
Functions
@spec add_new_child(map()) :: Phoenix.LiveView.Rendered.t()
Renders a link for adding a new child entity in a one-to-many association form.
The link is only shown if the index new link is enabled, the layout type is :form, and the
parent entity has a non-nil ID.
Parameters
assigns(map()) - Assigns map containing association and entity context.- Must include
:auixkey with:association,:entity,:layout_type, and:field.
- Must include
Returns
Phoenix.LiveView.Rendered.t() - Rendered link component.
@spec delete_child_action(map()) :: Phoenix.LiveView.Rendered.t()
Renders a link for deleting a child entity in a one-to-many association.
Parameters
assigns(map()) - Assigns map containing association and row info.
Returns
Phoenix.LiveView.Rendered.t() - Rendered link component.
@spec edit_child_action(map()) :: Phoenix.LiveView.Rendered.t()
Renders a link for editing a child entity in a one-to-many association.
Parameters
assigns(map()) - Assigns map containing association and row info.
Returns
Phoenix.LiveView.Rendered.t() - Rendered link component.
Sets up actions for the one-to-many field rendering layout by adding defaults and applying modifications.
Parameters
assigns(map()) - Assigns map containing the layout tree and context.- Must include
:auixkey with required subkeys.
- Must include
Returns
map() - The updated assigns with actions set.
@spec show_child_action(map()) :: Phoenix.LiveView.Rendered.t()
Renders a link for showing a child entity in a one-to-many association.
Parameters
assigns(map()) - Assigns map containing association and row info.
Returns
Phoenix.LiveView.Rendered.t() - Rendered link component.