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
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.
prepare_projects_associations(changeset, selected_projects, assoc_key)
View SourcePrepares 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.
select_project(project_id, projects, available_projects, selected_projects)
View SourceSelects 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.
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.