PhoenixKitProjects.DashboardWidgets (PhoenixKitProjects v0.17.0)

Copy Markdown View Source

The dashboard widgets phoenix_kit_projects contributes to phoenix_kit_dashboards.

Exposed through PhoenixKitProjects.phoenix_kit_widgets/0 — a plain-map, one-way contract: projects knows nothing about the dashboards package; the dashboards Registry discovers this list, normalizes each map into a %Widget{}, and gates visibility on the "projects" module being enabled + permitted.

Each :component is a Phoenix.LiveComponent under PhoenixKitProjects.Web.Widgets.* that receives settings / view / size / scope and re-queries on the host's refresh tick. Views declare their own min_size where the layouts genuinely differ (a detailed table needs more room than a KPI strip), so the dashboards builder floors resizing per view.

The single-project widgets pick their project from a select of current projects (project_options/0 — evaluated when the widget catalog is built, so a brand-new project appears after a registry refresh). The stored value is the project uuid; the blank option means "first running project", and stale stored values still resolve leniently (uuid / name / external id / substring) via Web.Widgets.Helpers.resolve_project/1.

Summary

Functions

The list of widget definitions (plain maps) for phoenix_kit_widgets/0.

Select options for the "project" setting: {name, uuid} for every current (non-template, non-archived) project, blank = first running. Degrades to just the blank option when the module/tables aren't available.

Functions

all()

@spec all() :: [map()]

The list of widget definitions (plain maps) for phoenix_kit_widgets/0.

project_options()

@spec project_options() :: [{String.t(), String.t()}]

Select options for the "project" setting: {name, uuid} for every current (non-template, non-archived) project, blank = first running. Degrades to just the blank option when the module/tables aren't available.