View Source LightningWeb.CredentialLive.Helpers (Lightning v2.10.4)

This module provides helper functions for managing project associations within credential live views, allowing dynamic assignment and update of projects associations to credentials and / or oauth clients.

Summary

Functions

Filters available projects to exclude any that are already selected.

Prepares a list of projects to be associated, updated, or removed based on the selected input.

Selects a project to be added to the list of selected projects.

Unselects a project from the list of selected projects.

Functions

Link to this function

filter_available_projects(all_projects, selected_projects)

View Source

Filters available projects to exclude any that are already selected.

Parameters

  • all_projects: A list of all projects.
  • selected_projects: A list of currently selected projects.

Returns

  • A list of projects that are not selected.
Link to this function

handle_save_response(socket, credential)

View Source
Link to this function

prepare_projects_associations(changeset, selected_projects, assoc_key)

View Source

Prepares a list of projects to be associated, updated, or removed based on the selected input.

Parameters

  • changeset: The changeset from which projects are fetched.
  • selected_projects: A list of currently selected projects.
  • assoc_key: The key in the changeset data containing project associations.

Returns

  • A list of maps representing the projects to be deleted, added, or kept.
Link to this function

select_project(project_id, projects, available_projects, selected_projects)

View Source

Selects a project to be added to the list of selected projects.

Parameters

  • project_id: The ID of the project to select.
  • projects: All available projects.
  • available_projects: Projects that are available for selection.
  • selected_projects: Currently selected projects.

Returns

  • A map with the updated lists of selected and available projects.
Link to this function

unselect_project(project_id, projects, selected_projects)

View Source

Unselects a project from the list of selected projects.

Parameters

  • project_id: The ID of the project to unselect.
  • projects: All projects available.
  • selected_projects: Currently selected projects.

Returns

  • A map with the updated lists of selected and available projects.