Skip to content

Add usage_caps_input slot to the project settings page #4725

@elias-ba

Description

@elias-ba

Add a usage_caps_input view-extension slot to the project settings page. Same pattern as the existing concurrency_input slot.

What's being added

In LightningWeb.ProjectLive.Settings.apply_action(:edit, ...), read the component from route metadata next to the existing concurrency_input_component lookup:

usage_caps_input_component =
  socket.router
  |> Phoenix.Router.route_info("GET", ~p"/projects/:project_id/settings", nil)
  |> Map.get(:usage_caps_input)

Assign it to usage_caps_input_component and render it from settings.html.heex:

<.live_component
  :if={assigns[:usage_caps_input_component]}
  module={assigns[:usage_caps_input_component]}
  id="usage-caps-input"
  project={@project}
  current_user={@current_user}
/>

Downstream apps populate the slot by attaching metadata: %{usage_caps_input: SomeComponent} to the settings route. The component receives project and current_user.

Acceptance criteria

  1. /projects/:project_id/settings reads :usage_caps_input from its route metadata and exposes it as @usage_caps_input_component.
  2. The template renders the component when set, nothing when not.
  3. The component receives project and current_user.
  4. No new UI in OSS Lightning by default.
  5. concurrency_input keeps working unchanged.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions