AshBackpex.LiveResource.Info (Ash Backpex v0.1.2)
View SourceAuto-generated introspection functions for AshBackpex LiveResources.
This module uses Spark.InfoGenerator to create helper functions for
inspecting the DSL configuration of AshBackpex LiveResources at runtime.
Available Functions
The generated functions allow you to introspect a LiveResource's configuration:
backpex_resource/1- Get the configured Ash resource modulebackpex_layout/1- Get the layout configurationbackpex_load/1- Get the load configurationbackpex_create_action/1- Get the create action namebackpex_read_action/1- Get the read action namebackpex_update_action/1- Get the update action namebackpex_destroy_action/1- Get the destroy action namebackpex_singular_name/1- Get the singular display namebackpex_plural_name/1- Get the plural display namebackpex_fields/1- Get all configured fieldsbackpex_filters/1- Get all configured filtersbackpex_item_actions/1- Get all configured item actions- And more for each DSL option...
Usage
# Get the Ash resource for a LiveResource
AshBackpex.LiveResource.Info.backpex_resource(MyAppWeb.Admin.PostLive)
# => MyApp.Blog.Post
# Get configured fields
AshBackpex.LiveResource.Info.backpex_fields(MyAppWeb.Admin.PostLive)
# => [%AshBackpex.LiveResource.Dsl.Field{attribute: :title, ...}, ...]These functions are primarily useful for debugging, testing, or building tools that need to inspect LiveResource configurations.
Summary
Functions
The create action to be used when creating resources. Will default to the primary create action.
The create action to be used when creating resources. Will default to the primary create action.
Changeset to use when creating items. Additional metadata is passed as a keyword list via the third parameter
Changeset to use when creating items. Additional metadata is passed as a keyword list via the third parameter
The destroy action to be used when destroying resources. Will default to the primary destroy action.
The destroy action to be used when destroying resources. Will default to the primary destroy action.
backpex.fields DSL entities
backpex.filters DSL entities
If the layout fills out the entire width.
The name of the generated column used for full text search.
The name of the generated column used for full text search.
Order that will be used when no other order options are given. Defaults to the primary key, ascending.
Order that will be used when no other order options are given. Defaults to the primary key, ascending.
backpex.item_actions DSL entities
backpex.item_actions DSL options
Default Backpex actions to remove from the live resource
Default Backpex actions to remove from the live resource
The liveview layout, e.g.: {MyAppWeb.Layouts, :admin}
The liveview layout, e.g.: {MyAppWeb.Layouts, :admin}
An optional list of hooks to attach to the mount lifecycle. Passing a single value is also accepted. See https://hexdocs.pm/phoenix_live_view/Phoenix.LiveView.html#on_mount/1
An optional list of hooks to attach to the mount lifecycle. Passing a single value is also accepted. See https://hexdocs.pm/phoenix_live_view/Phoenix.LiveView.html#on_mount/1
backpex DSL options
Panels to be displayed in the admin create/edit forms. Format: [panel_key: "Panel Title"]
Panels to be displayed in the admin create/edit forms. Format: [panel_key: "Panel Title"]
The default page size number.
The default page size number.
The page size numbers you can choose from.
The page size numbers you can choose from.
The plural name for the resource taht will appear i nthe admin. E.g., "Posts"
The plural name for the resource taht will appear i nthe admin. E.g., "Posts"
PubSub configuration.
PubSub configuration.
The read action to be used when reading resources. Will default to the primary read action.
The read action to be used when reading resources. Will default to the primary read action.
The Ash resource that the Backpex Live resource should be connect to.
The Ash resource that the Backpex Live resource should be connect to.
If the "Save & Continue editing" button is shown on form views.
The singular name for the resource that will appear in the admin. E.g., "Post"
The singular name for the resource that will appear in the admin. E.g., "Post"
The update action to be used when updating resources. Will default to the primary update action.
The update action to be used when updating resources. Will default to the primary update action.
Changeset to use when updating items. Additional metadata is passed as a keyword list via the third parameter
Changeset to use when updating items. Additional metadata is passed as a keyword list via the third parameter
Functions
The create action to be used when creating resources. Will default to the primary create action.
The create action to be used when creating resources. Will default to the primary create action.
@spec backpex_create_changeset(dsl_or_extended :: module() | map()) :: {:ok, (any(), any(), any() -> any())} | :error
Changeset to use when creating items. Additional metadata is passed as a keyword list via the third parameter:
:assigns- the assigns:target- the name of theformtarget that triggered the changeset call. Default tonilif the call was not triggered by a form field.
@spec backpex_create_changeset!(dsl_or_extended :: module() | map()) :: (any(), any(), any() -> any()) | no_return()
Changeset to use when creating items. Additional metadata is passed as a keyword list via the third parameter:
:assigns- the assigns:target- the name of theformtarget that triggered the changeset call. Default tonilif the call was not triggered by a form field.
The destroy action to be used when destroying resources. Will default to the primary destroy action.
The destroy action to be used when destroying resources. Will default to the primary destroy action.
backpex.fields DSL entities
backpex.filters DSL entities
If the layout fills out the entire width.
The name of the generated column used for full text search.
The name of the generated column used for full text search.
@spec backpex_init_order(dsl_or_extended :: module() | map()) :: {:ok, (any() -> any()) | {module(), list()}} | :error
Order that will be used when no other order options are given. Defaults to the primary key, ascending.
@spec backpex_init_order!(dsl_or_extended :: module() | map()) :: ((any() -> any()) | {module(), list()}) | no_return()
Order that will be used when no other order options are given. Defaults to the primary key, ascending.
backpex.item_actions DSL entities
@spec backpex_item_actions_options(dsl_or_extended :: module() | map()) :: %{ required(atom()) => any() }
backpex.item_actions DSL options
Returns a map containing the and any configured or default values.
@spec backpex_item_actions_strip_default(dsl_or_extended :: module() | map()) :: {:ok, [atom()]} | :error
Default Backpex actions to remove from the live resource
@spec backpex_item_actions_strip_default!(dsl_or_extended :: module() | map()) :: [atom()] | no_return()
Default Backpex actions to remove from the live resource
@spec backpex_layout(dsl_or_extended :: module() | map()) :: {:ok, (any() -> any()) | {:module, atom()}} | :error
The liveview layout, e.g.: {MyAppWeb.Layouts, :admin}
@spec backpex_layout!(dsl_or_extended :: module() | map()) :: ((any() -> any()) | {:module, atom()}) | no_return()
The liveview layout, e.g.: {MyAppWeb.Layouts, :admin}
@spec backpex_on_mount(dsl_or_extended :: module() | map()) :: {:ok, :mod_arg | atom() | [:mod_arg | atom()]} | :error
An optional list of hooks to attach to the mount lifecycle. Passing a single value is also accepted. See https://hexdocs.pm/phoenix_live_view/Phoenix.LiveView.html#on_mount/1
@spec backpex_on_mount!(dsl_or_extended :: module() | map()) :: (:mod_arg | atom() | [:mod_arg | atom()]) | no_return()
An optional list of hooks to attach to the mount lifecycle. Passing a single value is also accepted. See https://hexdocs.pm/phoenix_live_view/Phoenix.LiveView.html#on_mount/1
backpex DSL options
Returns a map containing the and any configured or default values.
Panels to be displayed in the admin create/edit forms. Format: [panel_key: "Panel Title"]
Panels to be displayed in the admin create/edit forms. Format: [panel_key: "Panel Title"]
The default page size number.
The default page size number.
The page size numbers you can choose from.
The page size numbers you can choose from.
The plural name for the resource taht will appear i nthe admin. E.g., "Posts"
The plural name for the resource taht will appear i nthe admin. E.g., "Posts"
@spec backpex_pubsub(dsl_or_extended :: module() | map()) :: {:ok, topic: String.t(), server: atom()} | :error
PubSub configuration.
@spec backpex_pubsub!(dsl_or_extended :: module() | map()) :: [topic: String.t(), server: atom()] | no_return()
PubSub configuration.
The read action to be used when reading resources. Will default to the primary read action.
The read action to be used when reading resources. Will default to the primary read action.
The Ash resource that the Backpex Live resource should be connect to.
The Ash resource that the Backpex Live resource should be connect to.
If the "Save & Continue editing" button is shown on form views.
The singular name for the resource that will appear in the admin. E.g., "Post"
The singular name for the resource that will appear in the admin. E.g., "Post"
The update action to be used when updating resources. Will default to the primary update action.
The update action to be used when updating resources. Will default to the primary update action.
@spec backpex_update_changeset(dsl_or_extended :: module() | map()) :: {:ok, (any(), any(), any() -> any())} | :error
Changeset to use when updating items. Additional metadata is passed as a keyword list via the third parameter:
:assigns- the assigns:target- the name of theformtarget that triggered the changeset call. Default tonilif the call was not triggered by a form field.
@spec backpex_update_changeset!(dsl_or_extended :: module() | map()) :: (any(), any(), any() -> any()) | no_return()
Changeset to use when updating items. Additional metadata is passed as a keyword list via the third parameter:
:assigns- the assigns:target- the name of theformtarget that triggered the changeset call. Default tonilif the call was not triggered by a form field.