Msform.McpBootstrap (msapp_mcp v0.1.0)

Form data used during the MCP Bootstrapping process.

Note that currently the data assumes that only an email/password Authenticator will be provided for the administrative Access Account.

Summary

Functions

See Msform.McpBootstrap.Actions.enter_disallowed_state/1.

See Msform.McpBootstrap.Actions.enter_finished_state/1.

See Msform.McpBootstrap.Actions.enter_records_state/1.

See Msform.McpBootstrap.Actions.enter_welcome_state/1.

Removes a processing override from the active overrides list.

Retrieves the textual information (label, label_link, and info) field values from the Form Configuration for the identified component.

See Msform.McpBootstrap.Actions.process_disallowed_finished/1.

See Msform.McpBootstrap.Actions.process_disallowed_load/1.

See Msform.McpBootstrap.Actions.process_records_save/1.

See Msform.McpBootstrap.Actions.process_records_save_finished/1.

Adds a processing override to the active overrides list.

Updates the display form data with new values.

See Msform.McpBootstrap.Actions.validate_form_data/2.

Validates a map of form data for validation of form entry prior to final submission.

Types

@type t() :: %Msform.McpBootstrap{
  admin_credential: String.t() | nil,
  admin_credential_verify: String.t() | nil,
  admin_display_name: String.t() | nil,
  admin_identifier: String.t() | nil,
  id: term(),
  owner_display_name: String.t() | nil,
  owner_name: String.t() | nil
}

Functions

Link to this function

enter_disallowed_state(socket)

See Msform.McpBootstrap.Actions.enter_disallowed_state/1.

Link to this function

enter_finished_state(socket)

See Msform.McpBootstrap.Actions.enter_finished_state/1.

Link to this function

enter_records_state(socket)

See Msform.McpBootstrap.Actions.enter_records_state/1.

Link to this function

enter_welcome_state(socket)

See Msform.McpBootstrap.Actions.enter_welcome_state/1.

Link to this function

finish_processing_override(socket_or_assigns, override)

Removes a processing override from the active overrides list.

Once an active operation previously added to the process overrides list has completed its processing, this function is used to remove it from the list so that any user interface components that are watching for the operation to be active can resume their normal behavior.

Parameters

  • socket_or_assigns - the socket or assigns for the current view.

  • override - the name of the processing override to remove from the active process overrides list.

Link to this function

get_component_info(component_id)

@spec get_component_info(
  %{form_id: MscmpSystForms.Types.form_id()}
  | %{binding_id: MscmpSystForms.Types.binding_id()}
) :: MscmpSystForms.Types.ComponentInfo.t() | nil

Retrieves the textual information (label, label_link, and info) field values from the Form Configuration for the identified component.

This is a convenience function which accepts either a form_id value or a binding_id value and returns the textual information for the component if found by the passed identifier.

Parameters

  • component_id - this value is either the form_id or binding_id that is associated with the component for which textual information is being retrieved.
Link to this function

process_disallowed_finished(socket)

See Msform.McpBootstrap.Actions.process_disallowed_finished/1.

Link to this function

process_disallowed_load(socket)

See Msform.McpBootstrap.Actions.process_disallowed_load/1.

Link to this function

process_records_save(socket)

See Msform.McpBootstrap.Actions.process_records_save/1.

Link to this function

process_records_save_finished(socket)

See Msform.McpBootstrap.Actions.process_records_save_finished/1.

Link to this function

start_processing_override(socket_or_assigns, override)

Adds a processing override to the active overrides list.

Some user interface components are configured to change their presentation and interactivity when certain, possibly long running, processes are underway. This function adds the value of the override parameter to the active processes list allowing components interest in that processing state to respond accordingly.

Parameters

  • socket_or_assigns - the socket or assigns for the current view.

  • override - the name of the processing override to activate. This value will be an atom and will be form implementation specific.

Link to this function

update_button_state(socket_or_assigns, form_id, button_state)

Sets the state of MscmpSystForms.WebComponents.msvalidated_button/1 components.

Validated buttons exist in one of three states defined by MscmpSystForms.Types.msvalidated_button_states/0. This function will set the state of the validated button identified by the form_id parameters to the state identified by the button_state parameters.

Parameters

Link to this function

update_display_data(socket_or_assigns, display_data, opts \\ [])

Updates the display form data with new values.

The display data of the form, which represents the form's backing data after the application of effective user permissions to purge values that the user is not entitled to see, is set using this function. The data is stored in the view's assigns as a t:Phoenix.HTML.Form.t/0' value which is then passed to the view for rendering. ## Parameters *socket_or_assigns- the socket or assigns for the current view. *display_data- this option contains either the new display data to set and with which to update the form or indicates the kind of data validation to perform on the assigns stored data (msrd_original_data&msrd_current_data; seeMscmpSystForms.init_assigns/8for more). One method for setting the display data is to pass this option to the function using actual data. This data can take the form of either at:Ecto.Changeset.t/0value or at:Phoenix.HTML.Form.t/0value. If a Changeset is passed, the function will automatically process it into at:Phoenix.HTML.Form.t/0struct, applying the permissions currently set in themsrd_user_permsStandard Assigns Attribute to filter the data. If the value to be passed in this option is at:Phoenix.HTML.Form.t/0value, the struct should have been generated usingMscmpSystForms.to_form/3so that the user data visibility permissions will have been allied. The second method is to passdisplay_dataas a value referencing a display data validation type (t:MscmpSystForms.Types.data_validation_types/0). When this method is used, the values of themsrd_current_dataandmsrd_original_dataare validated using the standard validation functions (c:MscmpSystForms.validate_save/2andc:MscmpSystForms.validate_post/2) and then processed into at:Phoenix.HTML.Form.t/0value to save as the newmsrd_display_datavalue. Either of the validation types will result in the application of user data visibility permissions per themsrd_user_permsStandard Assigns Attribute. *opts- this function defines some optionally required parameters which are dependent on thedisplay_dataparameter. When thedisplay_datavalue is passed as at:MscmpSystForms.Types.data_validation_types/0allowed value the following are required: *original_data- a struct of values representing the starting data initialized on initial form loading and absent any changes the user may have made and not yet committed to the database. This value should be available in the standard assigns forMscmpSystFormsbased forms. *current_data- a map of values representing the current data backing the form. This data is complete (unfiltered by user data related permissions) and includes any edits made by the user and not yet committed to the database. This value is available in the standard assigns forMscmpSystForms` based forms

Link to this function

validate_form_data(socket, form_data)

See Msform.McpBootstrap.Actions.validate_form_data/2.

Link to this function

validate_save(original_data, current_data \\ %{})

@spec validate_save(t(), Msform.McpBootstrap.Types.parameters()) :: Ecto.Changeset.t()

Validates a map of form data for validation of form entry prior to final submission.