AdminElf.Resource behaviour (admin_elf v0.4.3) View Source

Link to this section Summary

Link to this section Functions

Link to this function

create_resource(conn, admin, id, params)

View Source
Link to this function

delete_resource(conn, admin, id, item)

View Source
Link to this function

get_actions(conn, admin, id)

View Source
Link to this function

get_allow_creation(conn, admin, id)

View Source
Link to this function

get_details_layout(conn, admin, id)

View Source
Link to this function

get_filters(conn, admin, id)

View Source
Link to this function

get_form_layout(conn, admin, id)

View Source
Link to this function

get_index_table(conn, admin, id)

View Source
Link to this function

get_item_display_name(conn, admin, id, item)

View Source
Link to this function

get_item_id(conn, admin, id, item)

View Source
Link to this function

get_name(conn, admin, id)

View Source
Link to this function

get_plural_name(conn, admin, id)

View Source
Link to this function

get_quick_actions(conn, admin, id)

View Source
Link to this function

get_resource(conn, admin, id, item_id)

View Source
Link to this function

list_resource(conn, admin, id, page, limit, order, filter)

View Source
Link to this function

update_resource(conn, admin, id, item, attrs)

View Source

Link to this section Callbacks

Specs

actions(conn :: Plug.Conn.t()) :: [AdminElf.ActionHelpers.action()]

Specs

allow_creation(conn :: Plug.Conn.t()) :: boolean()
Link to this callback

create_resource(conn, attrs)

View Source (optional)

Specs

create_resource(conn :: Plug.Conn.t(), attrs :: any()) ::
  {:ok, created_item :: any()} | {:error, reason :: term()}
Link to this callback

delete_resource(conn, item)

View Source (optional)

Specs

delete_resource(conn :: Plug.Conn.t(), item :: term()) ::
  {:ok, deleted_item :: any()} | {:error, reason :: term()}

Specs

details_layout(conn :: Plug.Conn.t()) :: [AdminElf.LayoutHelpers.component()]
Link to this callback

filters(conn)

View Source (optional)

Specs

filters(conn :: Plug.Conn.t()) :: [AdminElf.InputHelpers.input()]
Link to this callback

form_layout(conn)

View Source (optional)

Specs

form_layout(conn :: Plug.Conn.t()) :: [AdminElf.LayoutHelpers.component()]
Link to this callback

get_resource(conn, item_id)

View Source

Specs

get_resource(conn :: Plug.Conn.t(), item_id :: String.t()) ::
  {:ok, resource :: term()} | {:error, reason :: term()}
Link to this callback

index_table(conn)

View Source (optional)

Specs

index_table(conn :: Plug.Conn.t()) :: [AdminElf.TableHelpers.column()]

Specs

item_display_name(term()) :: String.t()

Specs

item_id(term()) :: String.t()
Link to this callback

list_resource(conn, page, limit, order, filter)

View Source (optional)

Specs

list_resource(
  conn :: Plug.Conn.t(),
  page :: pos_integer(),
  limit :: pos_integer(),
  order :: keyword(atom()),
  filter :: map()
) :: {items :: list(), count :: pos_integer()}

Specs

name() :: String.t()

Specs

plural_name() :: String.t()

Specs

quick_actions(conn :: Plug.Conn.t()) :: [atom()]
Link to this callback

update_resource(conn, item, attrs)

View Source (optional)

Specs

update_resource(conn :: Plug.Conn.t(), item :: any(), attrs :: any()) ::
  {:ok, updated_item :: any()} | {:error, reason :: term()}