phoenixframework / phoenix_live_dashboard

Realtime dashboard with metrics, request logging, plus storage, OS and VM insights

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RowComponent and ColumnsComponent not working with TableComponent

jotaviobiondo opened this issue · comments

Environment

  • Elixir version (elixir -v): 1.13.4
  • Phoenix version (mix deps): 1.6.11
  • Phoenix LiveView version (mix deps): 0.17.1
  • Phoenix Dashboard version (mix deps): 0.6.0
  • Operating system: MacOS
  • Browsers you attempted to reproduce this bug on (the more the merrier): Firefox

Actual behavior

When trying to use a TableComponent with a RowComponent or ColumnsComponent, a MatchError happens because the TableComponent expects a page assign:

Request: GET /admin/live-dashboard/custom
** (exit) an exception was raised:
    ** (MatchError) no match of right hand side value: %{columns: [...omitted], default_sort_by: nil, hint: nil, id: "custom-page", limit: [50, 100, 500, 1000, 5000], row_attrs: [], row_fetcher: #Function<0.25192482/2 in MyApp.LiveDashboard.CustomPage.build_table/3>, rows_name: "records", search: true, title: "Records"}
        (phoenix_live_dashboard 0.6.0) lib/phoenix/live_dashboard/components/table_component.ex:117: Phoenix.LiveDashboard.TableComponent.normalize_table_params/1
        (phoenix_live_dashboard 0.6.0) lib/phoenix/live_dashboard/components/table_component.ex:90: Phoenix.LiveDashboard.TableComponent.update/2
...ommited

image

Expected behavior

Use a table inside a row and column components, like in the nav bar component.