Skip to content

Commit

Permalink
Merge branch 'epsilon' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
deejay-hub authored Dec 11, 2024
2 parents 873c647 + dade3d4 commit 2e54b7b
Show file tree
Hide file tree
Showing 15 changed files with 71 additions and 21 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ cd timeline-lwc
}
],
"sfdcLoginUrl": "https://login.salesforce.com",
"sourceApiVersion": "59.0"
"sourceApiVersion": "61.0"
}
```

Expand Down Expand Up @@ -159,11 +159,12 @@ The component has the following properties that can be set at design time in App
| `Parent Record` | Adjusts the timeline parent id | Dynamic Picklist (valid relationships) |
| `Title` | Adjusts the label | String |
| `Height` | Adjusts the vertical height | Picklist (1 - 5) |
| `Icon Style` | Adjusts the iconography style | Picklist (Square, Circular) |
| `Historical Time Range (Years)` | Adjusts the start date | Picklist (0.25 - 10) |
| `Future Time Range (Years)` | Adjusts the end date | Picklist (0.25 - 10) |
| `Zoom Based On` | Adjusts the position of the zoom | Picklist (First Date, Current Date, Last Activity) |
| `Zoom Range (Days)` | Adjusts the extent of the zoom | Integer min 15 max 365 |
| `Show Today` | Plots a line for the current date/time | Picklist (No/Various Colours) |
| `Show Today` | Plots a line for the current date/time | Picklist (No/Various Colours) |

#### Custom Labels

Expand Down
8 changes: 6 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
## XX Xxx 2024 v1.15.0

**WHAT'S NEW**
- Changed Salesforce API to v60.0 from v59.0
- Changed Salesforce API to v61.0 from v59.0
- Added EmailMessage drilldown support for ActivityHistory and OpenActivities
- Added UI support for SLDS v2 (Enhanced Lightning)
- Added support for circular iconography to align with SLDS v2

**BUG FIXES**
- Fixed memory leak issue
- Fixed issue plotting tasks for Person Accounts
- Fixed font and font size mismatches with SLDS v1 and v2

## 30 Jan 2024 v1.14.0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>59.0</apiVersion>
<apiVersion>61.0</apiVersion>
<status>Active</status>
</ApexClass>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>59.0</apiVersion>
<apiVersion>61.0</apiVersion>
<status>Active</status>
</ApexClass>
19 changes: 19 additions & 0 deletions force-app/main/default/classes/TimelineService.cls
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ public with sharing class TimelineService {
objName == 'ActivityHistory' ||
objName == 'TaskRelation' ||
objName == 'ContentDocumentLink' ||
objName == 'TaskWhoRelation' ||
objName == 'LookedUpFromActivity')
) {
selectStatement = selectStatement + ', ' + tcr.type + '';
Expand All @@ -203,6 +204,13 @@ public with sharing class TimelineService {
selectStatement = selectStatement + ', ActivityDate' + '';
}

if (
(objName == 'OpenActivity' || objName == 'ActivityHistory') &&
!selectStatement.contains('AlternateDetailId')
) {
selectStatement = selectStatement + ', AlternateDetailId' + '';
}

if (objName == 'ContentDocumentLink') {
selectStatement = selectStatement + ', ' + 'ContentDocumentId' + '';
}
Expand Down Expand Up @@ -334,6 +342,16 @@ public with sharing class TimelineService {

Map<String, String> typeValues = getFieldValues(tr.type, eachCh, tr.objectName);

String alternateDetailId = '';

if ( (tr.objectName == 'OpenActivity' || tr.objectName == 'ActivityHistory') &&
(String.valueOf(eachCh.get('AlternateDetailId')) != '' &&
String.valueOf(eachCh.get('AlternateDetailId')) != null) ) {
alternateDetailId = String.valueOf(eachCh.get('AlternateDetailId'));
}

mapData.put('alternateDetailId', alternateDetailId);

if (tr.objectName == 'ContentDocumentLink') {
//NOPMD
myId = String.valueOf(eachCh.get('ContentDocumentId'));
Expand Down Expand Up @@ -655,6 +673,7 @@ public with sharing class TimelineService {
private String fallbackNameField;
private String fallbackNameValue;
private String inclusionField;
private String alternateDetailId;
private Id recordId;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>59.0</apiVersion>
<apiVersion>61.0</apiVersion>
<status>Active</status>
</ApexClass>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>59.0</apiVersion>
<apiVersion>61.0</apiVersion>
<status>Active</status>
</ApexClass>
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</values>
<values>
<field>Object_Name__c</field>
<value xsi:type="xsd:string">EventRelation</value>
<value xsi:type="xsd:string">EventWhoRelation</value>
</values>
<values>
<field>Parent_Object__c</field>
Expand All @@ -40,7 +40,7 @@
</values>
<values>
<field>Relationship_Name__c</field>
<value xsi:type="xsd:string">EventRelations</value>
<value xsi:type="xsd:string">PersonEventWhoRelations</value>
</values>
<values>
<field>Sequence__c</field>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</values>
<values>
<field>Object_Name__c</field>
<value xsi:type="xsd:string">TaskRelation</value>
<value xsi:type="xsd:string">TaskWhoRelation</value>
</values>
<values>
<field>Parent_Object__c</field>
Expand All @@ -40,7 +40,7 @@
</values>
<values>
<field>Relationship_Name__c</field>
<value xsi:type="xsd:string">TaskRelations</value>
<value xsi:type="xsd:string">PersonTaskWhoRelations</value>
</values>
<values>
<field>Sequence__c</field>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>59.0</apiVersion>
<apiVersion>61.0</apiVersion>
<isExposed>false</isExposed>
</LightningComponentBundle>
19 changes: 15 additions & 4 deletions force-app/main/default/lwc/timeline/timeline.css
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
.stencil-label {
background-color: #b0adab;
background-color: #83807f;
height: 0.4rem;
border-radius: 2rem;
width: 10rem;
}

.stencil-value {
background-color: #969492;
background-color: #5f5e5d;
height: 0.4rem;
border-radius: 2rem;
margin-top: 0.5rem;
width: 10rem;
}

Expand All @@ -24,6 +23,10 @@
text-align: center;
}

.slds-spinner_container, .slds-spinner--container {
border-radius: 20px !important;
}

.illustration {
padding: 10px 5px 5px 5px;
border-radius: 5px 5px 5px 5px;
Expand Down Expand Up @@ -214,7 +217,7 @@
}

.timeline-wrapper {
margin: 10px 10px 10px 10px;
--margin: 5px 5px 5px 5px;
border: 1px solid #747474;
border-radius: 3px;
position: relative;
Expand Down Expand Up @@ -281,10 +284,12 @@
}

.timeline-summary-verbose {
padding-right: 10px;
display: none;
}

.timeline-summary-short {
padding-right: 10px;
display: inline-block !important;
}
}
Expand All @@ -304,6 +309,7 @@
}

.timeline-summary-short {
padding-right: 10px;
display: none;
}

Expand All @@ -320,4 +326,9 @@

.slds-panel__body {
padding-bottom: 50px;
}

.timeline-summary-verbose {
padding-right: 10px;

}
19 changes: 16 additions & 3 deletions force-app/main/default/lwc/timeline/timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export default class timeline extends NavigationMixin(LightningElement) {
@api timelineParent; //parent field for the lwc set as design attribute
@api timelineTitle; //title for the lwc set as design attribute
@api preferredHeight; //height of the timeline set as design attribute
@api iconStyle; //the style of icon plotted in the canvas
@api earliestRange; //How far back in time to go
@api latestRange; //How far into the future to go
@api zoomTo; //Zoom to current dat or latest activity
Expand Down Expand Up @@ -113,6 +114,13 @@ export default class timeline extends NavigationMixin(LightningElement) {
No: "#107cad"
};

iconStyleMap = {
Square: 3,
Circular: 20
};

iconRoundedValue = 3;

label = {
DAYS,
SHOWING,
Expand Down Expand Up @@ -246,6 +254,7 @@ export default class timeline extends NavigationMixin(LightningElement) {

if (!this._d3Rendered) {
this.todaysColour = this.todayColourMap[this.showToday];
this.iconRoundedValue = this.iconStyleMap[this.iconStyle];
//set the height of the component as the height is dynamic based on the attributes
let timelineDIV = this.template.querySelector('div.timeline-canvas');
this.currentParentField = this.timelineParent;
Expand Down Expand Up @@ -493,6 +502,7 @@ export default class timeline extends NavigationMixin(LightningElement) {
recordCopy.tooltipId = record.tooltipId;
recordCopy.tooltipObject = record.tooltipObject;
recordCopy.drilldownId = record.drilldownId;
recordCopy.alternateDetailId = record.alternateDetailId;

recordCopy.type = record.type;
recordCopy.icon = record.icon;
Expand Down Expand Up @@ -655,7 +665,6 @@ export default class timeline extends NavigationMixin(LightningElement) {
.attr('transform', function (d) {
return 'translate(' + timelineCanvas.x(d.time) + ', ' + timelineCanvas.y(d.swimlane) + ')';
});

if (timelineCanvas.records.size() > 0) {
timelineCanvas.records
.append('rect')
Expand Down Expand Up @@ -685,8 +694,8 @@ export default class timeline extends NavigationMixin(LightningElement) {
.attr('y', 0)
.attr('width', 24)
.attr('height', 24)
.attr('rx', 3)
.attr('ry', 3);
.attr('rx', me.iconRoundedValue)
.attr('ry', me.iconRoundedValue);

timelineCanvas.records
.append('image')
Expand Down Expand Up @@ -753,6 +762,10 @@ export default class timeline extends NavigationMixin(LightningElement) {
drilldownId = d.drilldownId;
}

if (d.alternateDetailId !== '') {
drilldownId = d.alternateDetailId;
}

switch (d.objectName) {
case 'ContentDocumentLink': {
me[NavigationMixin.Navigate]({
Expand Down
4 changes: 3 additions & 1 deletion force-app/main/default/lwc/timeline/timeline.js-meta.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="timeline">
<apiVersion>59.0</apiVersion>
<apiVersion>61.0</apiVersion>
<isExposed>true</isExposed>
<masterLabel>Time Warp</masterLabel>
<targets>
Expand All @@ -14,6 +14,7 @@
<property name="timelineParent" label="Parent Record" type="String" datasource="apex://TimelineParentPicklist" required="true" />
<property name="timelineTitle" label="Title" default="Timeline" required="true" type="String" />
<property name="preferredHeight" label="Height" default="3 - Default" required="true" type="String" datasource="1 - Smallest, 2 - Small, 3 - Default, 4 - Big, 5 - Biggest" />
<property name="iconStyle" label="Icon Style" default="Square" required="true" type="String" datasource="Square, Circular" />
<property name="earliestRange" label="Historical Time Range (Years)" default="3" required="true" type="String" datasource="0.25, 0.5, 1, 1.5, 2, 3, 4, 5, 6, 7, 8, 9, 10" description="Specify the start range for the timeline. As n minus current date."/>
<property name="latestRange" label="Future Time Range (Years)" default="0.5" required="true" type="String" datasource="0.25, 0.5, 1, 1.5, 2, 3, 4, 5, 6, 7, 8, 9, 10" description="Specify the end range for the timeline. As n plus current date."/>
<property name="zoomTo" label="Zoom Based On" default="Current Date" required="true" type="String" datasource="Current Date, Last Activity, First Activity" description="Zoom to the last record found (even if it's in the past or future) OR zoom to the current date (even if there are no records)."/>
Expand All @@ -30,6 +31,7 @@
<property name="timelineParent" label="Parent Record" type="String" datasource="apex://TimelineParentPicklist" required="true" />
<property name="timelineTitle" label="Title" default="Timeline" required="true" type="String" />
<property name="preferredHeight" label="Height" default="3 - Default" required="true" type="String" datasource="1 - Smallest, 2 - Small, 3 - Default, 4 - Big, 5 - Biggest" />
<property name="iconStyle" label="Icon Style" default="Square" required="true" type="String" datasource="Square, Circular" />
<property name="earliestRange" label="Historical Time Range (Years)" default="3" required="true" type="String" datasource="0.25, 0.5, 1, 1.5, 2, 3, 4, 5, 6, 7, 8, 9, 10" description="Specify the start range for the timeline. As n minus current date."/>
<property name="latestRange" label="Future Time Range (Years)" default="0.5" required="true" type="String" datasource="0.25, 0.5, 1, 1.5, 2, 3, 4, 5, 6, 7, 8, 9, 10" description="Specify the end range for the timeline. As n plus current date."/>
<property name="zoomTo" label="Zoom Based On" default="Current Date" required="true" type="String" datasource="Current Date, Last Activity, First Activity" description="Zoom to the last record found (even if it's in the past or future) OR zoom to the current date (even if there are no records)."/>
Expand Down
Binary file modified images/appBuilderDemo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/heroDemo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2e54b7b

Please sign in to comment.