This repository provides a number of Trail Tracker customizations examples to show developers and admins how they can extend Trailhead and myTrailhead. The code within is provided as an example of what can be done and is not actively supported.
If you want to install this repository as a package in an org use one of the following URLs:
Sandbox (Recommended):
https://test.salesforce.com/packaging/installPackage.apexp?p0=04t2E000003Mub3
Developer Edition or Production:
https://login.salesforce.com/packaging/installPackage.apexp?p0=04t2E000003Mub3
As a prerequisite be sure to have installed the latest version of the Trail Tracker app first.
If you installed previous versions of this package you have two options to upgrade:
- Unistall and reinstall - completely remove the old package from your org by uninstalling the package and deleting it from Setup > Installed Packages. Not this will require you to remove all references to the LWCs, processes and flows first.
- Use DX to push updates - If you have DX installed and configured you can dowloand the source code found in the DX folder and push the enite APEX and LWCs folder to your org to update just the APEX and LWCs. Note this may break any pages where you had the LWCs..
Caveat: So far only Badges and Trailmixes are supported, if you want to add trails please go for it and share the code!
- All components exposed to Communities
- New Add button: users can click the add button next to a badge/trailmix to add it to their list of assignments
- New Share button: users can share learning by posting to chatter and @ mentioning someone
- New Report Display LWC: it can consume any Report that has badges or trailmixes and display them. It gives Admins the ability to display Ad-hoq lists of Badges and Trailmixes. Admins can create reports that have badges or trailmixes and then use the LWC to display them anywhere.
- Lightning Web Components to show Assignments, Recommendations, and Adhoq lists (reports) of Badges and Trailmixes
- Processes for creating new assignments and recommendations
- Login Flow with the Assignments Lightning Web Component
- Custom Object to persist Recommendations
- Aura Wrapper for the Assignment Lightning Web Component so it can be used with Lightning Out, Visualforce Pages and Flow
- Apex Classes to retrieve Trailhead Assignments/Recommendations/Reports and test classes
- Custom Labels to customize and integrate Trailhead Assignments / Recommendations LWCs with your myTrailhead Instance
th_trailheadAssignments - the Lightning Web Component that shows the list of assignments.
- supports the following design attributes:
- Badges or Trailmixes (Badge,TrailMix,Both) - type of entries to show
- Page Size (Integer) - the number of records to show per page
- Warning # days until due date (Integer) - Items within this many days will have orange due dates
- Show Share Button? - Checkbox to show or not show share button
th_contextualRecommend - the Lightning Web Component that shows the list of recommendations stored in the TH_Recommendation__c object. On a lightning record page it will show recommendations specific to that record, on a home or app page it will show all recommendations. If there are no recommendations the component will not render.
- supports the following design attributes:
- Page Size (Integer) - the number of records to show per page
- Warning # days until due date (Integer) - Items within this many days will have orange due dates
- Show Add Button? - Checkbox to show or not show add button
- Show Share Button? - Checkbox to show or not show share button
th_ReportDisplay - the Lightning Web Component that shows the list of ad-hoq badges and/or trailmixes based on a report. Administrators can create a report, for example new badges created this week, and then input the report's developer name into the compoment to have it display the badges or trailmixes on the report. To find a report's developer name run the report, click edit, click the down arrow next to the save button, click Properties and copy the "Report Unique Name" field.
- supports the following design attributes:
- Component Title - Display Title of Compoment
- Badge Report Developer Name - API name of badge report (see above paragraph for details)
- Trailmix Report Developer Name - API name of trailmix report (see above paragraph for details)
- Page Size (Integer) - the number of records to show per page
- Warning # days until due date (Integer) - Items within this many days will have orange due dates
- Show Add Button? - Checkbox to show or not show add button
- Show Share Button? - Checkbox to show or not show share button
- th_trailheadAssignment_entry - Private LWC component that represents a single badge or trailmix
- th_paginator_entry - Private LWC component that paginates a list of th_trailheadAssignment_entry's
- th_trailheadAssignment_entryAdd - Private LWC component that allows a user to assign learning to themselves
- th_trailheadAssignment_entryShare - Private LWC component that allows a user to share learning to others through chatter
The assignment, recommendation and report component all leverage the private components
The following Process and flows are included:
- Assigned Trailmix Chatter Post: Example of a chatter notification when a Trailmix is assigned
- Assign Lead Trailmix: Example of assigning a Trailmix when a Lead is updated
- Opportunity Badge Recommendation: Example of creating a recommendation when an opporutnity is updated
- TH Login Flow: Login flow that checks for uncompleted assignements and if any are found displays the Assignements LWC. This needs to be manually assigned to a Profile.
All process are deployed as inactive. Clone the latest version, update with a valid Badge or Trailmix Id and Activate.
To allow the Assignment component to be used in places where Lightning Web Components are not yet supported (like Lightning-Out and flow), we provide a 'Wrapper component' (written in aura). It includes the LWC component and can be used in many more areas.
- th_trailheadAssignments_wrap - Wrapper Component
- TH_Assignments - Visualforce Page using Lightning Out
- th_trailheadAssignments_container - Application to allow the component to be used in Lightning Out.
To allow the component to be easier to extend, we have created three Custom Labels to allow customization without touching code.
Name | Description | Default Value |
---|---|---|
th_trailhead_link_address | Address to send users to when clicking the link at the bottom of the Trailhead Assignments / Recomendations component | https://trailhead.salesforce.com/ |
th_trailhead_link_label | Label for the 'Trailhead' link at the bottom of the Trailhead Assignments component | Trailhead |
th_trailhead_trail_icon | Icon to show when Trailmixes are assigned (as they have no icon) | https://trailhead-web.s3.amazonaws.com/... |
th_TrailheadShareCompleteMsg | Message to share for completed trailhead items | Hey, I completed this. Why don't you give it a try? |
th_TrailheadShareIncompleteMsg | Message to share for in-progress trailhead items | Hey, check out this Trailhead learning. |
th_TrailheadMinCharSearchThreshold | Minimum number of characters before a search is perfomed | 3 |
th_TrailheadInputSearchDelay | Number of milliseconds to wait before perfoming a user search | 800 |