LightningWeb.ProjectLive.Settings (Lightning v2.19.0-pre)
View SourceIndex 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_inputreceivesfield(theEcto.Changesetfield forproject.concurrency),project, anddisabled(a pre-computed boolean — Lightning resolves whether the current user is allowed to edit the value and passes the result through).:usage_caps_inputreceivesprojectandcurrent_user. The component computes its own permission gate (typically viaLightning.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
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
component(:atom) (required)field(Phoenix.HTML.FormField) (required)project(Lightning.Projects.Project) (required)disabled(:boolean) (required)
Callback implementation for Phoenix.LiveView.render/1.
Attributes
can_edit_project(:boolean) (required)project(:any) (required)
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
component(:atom) (required)project(Lightning.Projects.Project) (required)current_user(Lightning.Accounts.User) (required)