diff --git a/CHANGELOG.md b/CHANGELOG.md index d6864f5be5..99663cbd71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,11 +17,19 @@ and this project adheres to ### Added +- New `usage_caps_input` view-extension slot on the project settings page + (`/projects/:project_id/settings`). Same pattern as the existing + `concurrency_input` slot: downstream apps register a component via + `metadata: %{usage_caps_input: SomeComponent}` on the settings route and + Lightning renders it in the settings view. No-op for OSS Lightning by default. + [#4725](https://github.com/OpenFn/lightning/issues/4725) + ### Changed ### Fixed ## [2.16.3] - 2026-05-07 + ## [2.16.3-pre3] - 2026-05-07 ### Fixed diff --git a/lib/lightning_web/live/project_live/settings.ex b/lib/lightning_web/live/project_live/settings.ex index 33c51e3fa8..4473e73a77 100644 --- a/lib/lightning_web/live/project_live/settings.ex +++ b/lib/lightning_web/live/project_live/settings.ex @@ -165,14 +165,16 @@ defmodule LightningWeb.ProjectLive.Settings do project_users = Projects.get_project_users!(socket.assigns.project.id) auth_methods = WebhookAuthMethods.list_for_project(socket.assigns.project) - concurrency_input_component = + route_metadata = socket.router |> Phoenix.Router.route_info( "GET", ~p"/projects/:project_id/settings", nil ) - |> Map.get(:concurrency_input) + + concurrency_input_component = Map.get(route_metadata, :concurrency_input) + usage_caps_input_component = Map.get(route_metadata, :usage_caps_input) socket |> assign( @@ -180,6 +182,7 @@ defmodule LightningWeb.ProjectLive.Settings do project_users: project_users, webhook_auth_methods: auth_methods, concurrency_input_component: concurrency_input_component, + usage_caps_input_component: usage_caps_input_component, show_collaborators_modal: false, show_invite_collaborators_modal: false, active_modal: nil, diff --git a/lib/lightning_web/live/project_live/settings.html.heex b/lib/lightning_web/live/project_live/settings.html.heex index 296e9e9a69..bdd4ba968a 100644 --- a/lib/lightning_web/live/project_live/settings.html.heex +++ b/lib/lightning_web/live/project_live/settings.html.heex @@ -240,6 +240,14 @@ + <.live_component + :if={assigns[:usage_caps_input_component]} + module={assigns[:usage_caps_input_component]} + id="usage-caps-input-component" + project={@project} + current_user={@current_user} + /> +