Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

CSGAMERSServices/Trailhead-Badge-and-Mix-Assignments-LWC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview DF19 Edition

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:

  1. 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.
  2. 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!

Whats been updated since the last version (TDX19)

  • 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.
New Add Button:New Share Button:
Looking for the older version see here: https://github.com/SalesforceCloudServices/Trailhead-Badge-and-Mix-Assignments-LWC/tree/TDX19-(Old)

What is included

  • 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

Assignment Component

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

Screenshot of Assignment Component

Recommendation Component

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

Screenshot of Recommendation Component

Report Display Component

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

Screenshot of Report Display Component

Private components

Component Breakdown

The assignment, recommendation and report component all leverage the private components

Screenshot of Home Page Component

Processes & Flows

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.

Aura Wrap Component

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.

Lightning Out

Custom Labels

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

About

Provide a list of the current trailhead badges and trailmixes assigned to the current user.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published