LightningWeb.ProjectLive.Settings (Lightning v2.19.0-pre)

View Source

Index LiveView for project settings.

View-extension slots

Two slots let downstream apps inject LiveComponents into the settings page by registering them in route metadata:

{"/projects/:project_id/settings", LightningWeb.ProjectLive.Settings, :index,
 metadata: %{
   concurrency_input: MyApp.ConcurrencyInputComponent,
   usage_caps_input: MyApp.UsageCapsInputComponent
 }}

Each slot has its own assigns contract, which the component must accept:

  • :concurrency_input receives field (the Ecto.Changeset field for project.concurrency), project, and disabled (a pre-computed boolean — Lightning resolves whether the current user is allowed to edit the value and passes the result through).

  • :usage_caps_input receives project and current_user. The component computes its own permission gate (typically via Lightning.Projects.Sandboxes.parent_admin?/2) because cap-editing authority is owned by the downstream billing layer, not by Lightning.

Slots are optional. Routes that omit a metadata key get a hidden slot — the page renders identically to OSS defaults.

Summary

Functions

View-extension slot wrapper for the project-level concurrency override input. Forwards field, project, and a pre-computed disabled boolean to the registered LiveComponent.

Callback implementation for Phoenix.LiveView.render/1.

View-extension slot wrapper for the per-project usage-caps input. Forwards project and current_user to the registered LiveComponent so the component can run its own permission gate (cap-editing authority lives in the downstream billing layer, not in Lightning).

Functions

concurrency_input_slot(assigns)

View-extension slot wrapper for the project-level concurrency override input. Forwards field, project, and a pre-computed disabled boolean to the registered LiveComponent.

Attributes

render(assigns)

Callback implementation for Phoenix.LiveView.render/1.

support_access_toggle(assigns)

Attributes

  • can_edit_project (:boolean) (required)
  • project (:any) (required)

usage_caps_input_slot(assigns)

View-extension slot wrapper for the per-project usage-caps input. Forwards project and current_user to the registered LiveComponent so the component can run its own permission gate (cap-editing authority lives in the downstream billing layer, not in Lightning).

Attributes