From 056277cef8dab57a3c012aeb0c204203c8a573e6 Mon Sep 17 00:00:00 2001 From: Dave Norris Date: Tue, 19 Mar 2024 10:47:40 +1100 Subject: [PATCH 01/13] fix: pmd unused variables --- force-app/main/default/classes/TimelineService.cls | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/force-app/main/default/classes/TimelineService.cls b/force-app/main/default/classes/TimelineService.cls index b8cf805..35f3506 100644 --- a/force-app/main/default/classes/TimelineService.cls +++ b/force-app/main/default/classes/TimelineService.cls @@ -16,7 +16,7 @@ public with sharing class TimelineService { Map parentDetails = getParentDetails(parentObjectId, parentFieldName); String parentObjectType = parentDetails.get('QueryObjectType'); - String parentConfigType = parentDetails.get('ConfigObjectType'); + String parentConfigType = parentDetails.get('ConfigObjectType'); //NOPMD parentObjectId = parentDetails.get('Id'); Map childObjects = getChildObjects(parentObjectType); @@ -98,7 +98,7 @@ public with sharing class TimelineService { Map parentDetails = getParentDetails(parentObjectId, parentFieldName); String parentObjectType = parentDetails.get('QueryObjectType'); - String parentConfigType = parentDetails.get('ConfigObjectType'); + String parentConfigType = parentDetails.get('ConfigObjectType'); //NOPMD parentObjectId = parentDetails.get('Id'); earliestRange = String.ValueOf((Decimal.ValueOf(earliestRange) * 12).intValue()); From c540d11acaf251874aa57fd694733ae6f5f097d8 Mon Sep 17 00:00:00 2001 From: Dave Norris Date: Tue, 19 Mar 2024 11:35:42 +1100 Subject: [PATCH 02/13] chore: release documentation --- changelog.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/changelog.md b/changelog.md index 56cf5b8..033aaa9 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,13 @@ # Change Log +## XX Xxx 2024 v1.15.0 + +**WHAT'S NEW** +- Changed Salesforce API to v60.0 from v59.0 + +**BUG FIXES** +- Fixed memory leak issue + ## 30 Jan 2024 v1.14.0 **WHAT'S NEW** From 6467f9837eef45e0b4071a68e6ca2d2a9b2543be Mon Sep 17 00:00:00 2001 From: Dave Norris Date: Thu, 4 Apr 2024 13:33:28 +1100 Subject: [PATCH 03/13] chore: update release notes --- changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.md b/changelog.md index 033aaa9..1533625 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,7 @@ **WHAT'S NEW** - Changed Salesforce API to v60.0 from v59.0 +- Added EmailMessage drilldown support for ActivityHistory and OpenActivities **BUG FIXES** - Fixed memory leak issue From dd4f13efb8c0355af0e85d513ba86ac889c11fc0 Mon Sep 17 00:00:00 2001 From: Dave Norris Date: Fri, 5 Apr 2024 08:43:06 +1100 Subject: [PATCH 04/13] feat: emailmessage drilldown (#287) --- .../main/default/classes/TimelineService.cls | 18 ++++++++++++++++++ .../main/default/lwc/timeline/timeline.js | 5 +++++ 2 files changed, 23 insertions(+) diff --git a/force-app/main/default/classes/TimelineService.cls b/force-app/main/default/classes/TimelineService.cls index 35f3506..c287655 100644 --- a/force-app/main/default/classes/TimelineService.cls +++ b/force-app/main/default/classes/TimelineService.cls @@ -199,6 +199,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' + ''; } @@ -330,6 +337,16 @@ public with sharing class TimelineService { Map 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')); @@ -649,6 +666,7 @@ public with sharing class TimelineService { private String fallbackNameField; private String fallbackNameValue; private String inclusionField; + private String alternateDetailId; private Id recordId; } diff --git a/force-app/main/default/lwc/timeline/timeline.js b/force-app/main/default/lwc/timeline/timeline.js index d2c71e3..b9e3089 100755 --- a/force-app/main/default/lwc/timeline/timeline.js +++ b/force-app/main/default/lwc/timeline/timeline.js @@ -492,6 +492,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; @@ -727,6 +728,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]({ From 1de6cf952fbf3b1e4e116422a37902dfa22ecdf2 Mon Sep 17 00:00:00 2001 From: Dave Norris Date: Wed, 2 Oct 2024 20:52:22 +1000 Subject: [PATCH 05/13] fix: person account task --- force-app/main/default/classes/TimelineService.cls | 1 + 1 file changed, 1 insertion(+) diff --git a/force-app/main/default/classes/TimelineService.cls b/force-app/main/default/classes/TimelineService.cls index c287655..4aa07cf 100644 --- a/force-app/main/default/classes/TimelineService.cls +++ b/force-app/main/default/classes/TimelineService.cls @@ -187,6 +187,7 @@ public with sharing class TimelineService { objName == 'ActivityHistory' || objName == 'TaskRelation' || objName == 'ContentDocumentLink' || + objName == 'TaskWhoRelation' || objName == 'LookedUpFromActivity') ) { selectStatement = selectStatement + ', ' + tcr.type + ''; From 104d1be46adaed8e7c82d2182b8ad5c74df01087 Mon Sep 17 00:00:00 2001 From: Dave Norris Date: Wed, 2 Oct 2024 21:02:45 +1000 Subject: [PATCH 06/13] chore: version increment --- changelog.md | 4 ++-- .../main/default/classes/TimelineParentPicklist.cls-meta.xml | 2 +- .../default/classes/TimelineParentPicklist_Test.cls-meta.xml | 2 +- force-app/main/default/classes/TimelineService.cls-meta.xml | 2 +- .../main/default/classes/TimelineService_Test.cls-meta.xml | 2 +- .../main/default/lwc/illustration/illustration.js-meta.xml | 2 +- force-app/main/default/lwc/timeline/timeline.js-meta.xml | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/changelog.md b/changelog.md index 1533625..dd1a6bb 100644 --- a/changelog.md +++ b/changelog.md @@ -3,11 +3,11 @@ ## 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 **BUG FIXES** -- Fixed memory leak issue +- Fixed issue plotting tasks for Person Accounts ## 30 Jan 2024 v1.14.0 diff --git a/force-app/main/default/classes/TimelineParentPicklist.cls-meta.xml b/force-app/main/default/classes/TimelineParentPicklist.cls-meta.xml index b1a915c..651b172 100644 --- a/force-app/main/default/classes/TimelineParentPicklist.cls-meta.xml +++ b/force-app/main/default/classes/TimelineParentPicklist.cls-meta.xml @@ -1,5 +1,5 @@ - 59.0 + 61.0 Active diff --git a/force-app/main/default/classes/TimelineParentPicklist_Test.cls-meta.xml b/force-app/main/default/classes/TimelineParentPicklist_Test.cls-meta.xml index b1a915c..651b172 100644 --- a/force-app/main/default/classes/TimelineParentPicklist_Test.cls-meta.xml +++ b/force-app/main/default/classes/TimelineParentPicklist_Test.cls-meta.xml @@ -1,5 +1,5 @@ - 59.0 + 61.0 Active diff --git a/force-app/main/default/classes/TimelineService.cls-meta.xml b/force-app/main/default/classes/TimelineService.cls-meta.xml index b1a915c..651b172 100644 --- a/force-app/main/default/classes/TimelineService.cls-meta.xml +++ b/force-app/main/default/classes/TimelineService.cls-meta.xml @@ -1,5 +1,5 @@ - 59.0 + 61.0 Active diff --git a/force-app/main/default/classes/TimelineService_Test.cls-meta.xml b/force-app/main/default/classes/TimelineService_Test.cls-meta.xml index b1a915c..651b172 100755 --- a/force-app/main/default/classes/TimelineService_Test.cls-meta.xml +++ b/force-app/main/default/classes/TimelineService_Test.cls-meta.xml @@ -1,5 +1,5 @@ - 59.0 + 61.0 Active diff --git a/force-app/main/default/lwc/illustration/illustration.js-meta.xml b/force-app/main/default/lwc/illustration/illustration.js-meta.xml index 861701c..8691883 100755 --- a/force-app/main/default/lwc/illustration/illustration.js-meta.xml +++ b/force-app/main/default/lwc/illustration/illustration.js-meta.xml @@ -1,5 +1,5 @@ - 59.0 + 61.0 false diff --git a/force-app/main/default/lwc/timeline/timeline.js-meta.xml b/force-app/main/default/lwc/timeline/timeline.js-meta.xml index c80b452..c14e2d7 100755 --- a/force-app/main/default/lwc/timeline/timeline.js-meta.xml +++ b/force-app/main/default/lwc/timeline/timeline.js-meta.xml @@ -1,6 +1,6 @@ - 59.0 + 61.0 true Time Warp From 53751e1f3e4f50c66b42311ce24161f46072d57e Mon Sep 17 00:00:00 2001 From: Dave Norris Date: Thu, 10 Oct 2024 15:44:55 +1100 Subject: [PATCH 07/13] feat: slds v2 support --- .../main/default/lwc/timeline/timeline.css | 18 +- .../main/default/lwc/timeline/timeline.html | 274 +++++++++--------- .../main/default/lwc/timeline/timeline.js | 14 +- .../default/lwc/timeline/timeline.js-meta.xml | 2 + 4 files changed, 164 insertions(+), 144 deletions(-) diff --git a/force-app/main/default/lwc/timeline/timeline.css b/force-app/main/default/lwc/timeline/timeline.css index 3250d6b..dd2e73c 100644 --- a/force-app/main/default/lwc/timeline/timeline.css +++ b/force-app/main/default/lwc/timeline/timeline.css @@ -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; } @@ -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; @@ -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; @@ -281,10 +284,12 @@ } .timeline-summary-verbose { + padding-right: 10px; display: none; } .timeline-summary-short { + padding-right: 10px; display: inline-block !important; } } @@ -304,5 +309,10 @@ } .timeline-summary-short { + padding-right: 10px; display: none; } + +.timeline-summary-verbose { + padding-right: 10px; +} \ No newline at end of file diff --git a/force-app/main/default/lwc/timeline/timeline.html b/force-app/main/default/lwc/timeline/timeline.html index e4d5c40..25b1e6d 100755 --- a/force-app/main/default/lwc/timeline/timeline.html +++ b/force-app/main/default/lwc/timeline/timeline.html @@ -1,165 +1,165 @@ - + \ No newline at end of file diff --git a/force-app/main/default/lwc/timeline/timeline.js b/force-app/main/default/lwc/timeline/timeline.js index 06408ca..918b6d1 100755 --- a/force-app/main/default/lwc/timeline/timeline.js +++ b/force-app/main/default/lwc/timeline/timeline.js @@ -26,6 +26,7 @@ import SHOWING from '@salesforce/label/c.Timeline_Label_Showing'; import ITEMS from '@salesforce/label/c.Timeline_Label_Items'; import FILTERS from '@salesforce/label/c.Timeline_Label_Filters'; import TYPE_LEGEND from '@salesforce/label/c.Timeline_Label_Filter_Type_Legend'; +import DATE_LEGEND from '@salesforce/label/c.Timeline_Label_Filter_Date_Legend'; import DATE_RANGE_LEGEND from '@salesforce/label/c.Timeline_Label_Date_Range_Legend'; import FILE_TYPE from '@salesforce/label/c.Timeline_Label_Files'; import ALL_TYPES from '@salesforce/label/c.Timeline_Label_Filter_All_Types'; @@ -126,6 +127,7 @@ export default class timeline extends NavigationMixin(LightningElement) { ITEMS, FILTERS, TYPE_LEGEND, + DATE_LEGEND, DATE_RANGE_LEGEND, FILE_TYPE, ALL_TYPES, @@ -213,7 +215,6 @@ export default class timeline extends NavigationMixin(LightningElement) { this.allFilterValues.push(key); } } - this.isFilterLoaded = true; } else if (result.error) { let errorType = 'Error'; let errorHeading, @@ -455,9 +456,9 @@ export default class timeline extends NavigationMixin(LightningElement) { recordCopy.recordId = record.objectId; recordCopy.id = index; - recordCopy.label = - record.detailField.length <= 30 ? record.detailField : record.detailField.slice(0, 30) + '...'; + recordCopy.label = record.detailField; recordCopy.objectName = record.objectName; + recordCopy.objectLabel = record.objectLabel; recordCopy.positionDateField = record.positionDateField; if (record.positionDateType === 'DATE') { @@ -635,6 +636,18 @@ export default class timeline extends NavigationMixin(LightningElement) { timelineCanvas.attr('height', svgHeight - 1); timelineCanvas.SVGHeight = svgHeight; + if(me.isLanguageRightToLeft){ + timelineCanvas.append('clipPath') + .attr('id', 'clipText') + .append('polygon') + .attr('points','-215,0 0,0 0,30 -215,30'); + } + else{ + timelineCanvas.append('clipPath') + .attr('id', 'clipText') + .append('polygon') + .attr('points','0,0 215,0 215,30 0,30'); + } timelineCanvas.data = timelineCanvas .selectAll('[class~=timeline-canvas-record]') @@ -690,6 +703,10 @@ export default class timeline extends NavigationMixin(LightningElement) { .attr('y', 1) .attr('height', 22) .attr('width', 22) + .attr('aria-label', function (d){ + const altText = d.objectLabel; + return altText; + }) .attr('xlink:href', function (d) { let iconImage = ''; @@ -713,9 +730,17 @@ export default class timeline extends NavigationMixin(LightningElement) { return iconImage; }); + timelineCanvas.records + .append('text') + .attr('class', 'sr-only') + .text(function (d) { + return d.positionDateValue; + }); + timelineCanvas.records .append('text') .attr('class', 'timeline-canvas-record-label') + .attr('clip-path','url(#clipText)') .attr('x', function () { let x = 30; switch (me.isLanguageRightToLeft) { @@ -730,6 +755,7 @@ export default class timeline extends NavigationMixin(LightningElement) { }) .attr('y', 16) .attr('font-size', 12) + .attr('tabindex', '0') .on('click', function (event, d) { let drilldownId = d.recordId; if (d.drilldownId !== '') { @@ -774,6 +800,49 @@ export default class timeline extends NavigationMixin(LightningElement) { } } }) + .on('keydown', function (event, d) { + if(event.key === ' ' || event.key === 'Enter'){ + + let drilldownId = d.recordId; + if (d.drilldownId !== '') { + drilldownId = d.drilldownId; + } + + switch (d.objectName) { + case 'ContentDocumentLink': { + me[NavigationMixin.Navigate]({ + type: 'standard__namedPage', + attributes: { + pageName: 'filePreview' + }, + state: { + selectedRecordId: d.recordId + } + }); + break; + } + case 'CaseComment': { + const toastEvent = new ShowToastEvent({ + title: me.toast.NAVIGATION_HEADER, + message: me.toast.NAVIGATION_BODY, + messageData: [d.objectName] + }); + this.dispatchEvent(toastEvent); + break; + } + default: { + me[NavigationMixin.Navigate]({ + type: 'standard__recordPage', + attributes: { + recordId: drilldownId, + actionName: 'view' + } + }); + break; + } + } + } + }) .on('mouseover', function (event, d) { let tooltipId = d.recordId; let tooltipObject = d.objectName; @@ -802,21 +871,44 @@ export default class timeline extends NavigationMixin(LightningElement) { switch (me.isLanguageRightToLeft) { case true: - tipPosition = - this.getBoundingClientRect().top - - 30 + - 'px ;left:' + - (this.getBoundingClientRect().left - tooltipDIV.offsetWidth - 15) + - 'px ;visibility:visible'; - break; + if(this.getBoundingClientRect().width < 184){ + tipPosition = + this.getBoundingClientRect().top - + 30 + + 'px ;left:' + + (this.getBoundingClientRect().left - tooltipDIV.offsetWidth - 15) + + 'px ;visibility:visible'; + break; + } + else{ + tipPosition = + this.getBoundingClientRect().top - + 30 + + 'px ;left:' + + (this.getBoundingClientRect().right- tooltipDIV.offsetWidth - 215) + + 'px ;visibility:visible'; + break; + } + default: - tipPosition = - this.getBoundingClientRect().top - - 30 + - 'px ;left:' + - (this.getBoundingClientRect().right + 15) + - 'px ;visibility:visible'; - break; + if(this.getBoundingClientRect().width < 184){ + tipPosition = + this.getBoundingClientRect().top - + 30 + + 'px ;left:' + + (this.getBoundingClientRect().right + 15) + + 'px ;visibility:visible'; + break; + } + else{ + tipPosition = + this.getBoundingClientRect().top - + 30 + + 'px ;left:' + + (this.getBoundingClientRect().left + 205) + + 'px ;visibility:visible'; + break; + } } tooltipDIV.setAttribute('style', 'top:' + tipPosition); }) @@ -858,6 +950,8 @@ export default class timeline extends NavigationMixin(LightningElement) { const axis = targetSVG .insert('g', ':first-child') .attr('class', axisConfig.class + '-' + me.timelineWidth) + .attr('role', 'presentation') + .attr('aria-hidden', 'true') .call(x_axis); if (typeof axisConfig.translate === 'object') { @@ -1269,15 +1363,19 @@ export default class timeline extends NavigationMixin(LightningElement) { const filterPopover = this.template.querySelector('div.timeline-filter'); const filterClasses = String(filterPopover.classList); const refreshButton = this.template.querySelector('lightning-button-icon.timeline-refresh'); + const closeButton = this.template.querySelector('[data-id="closeDialogBtn"]'); + const filterButton = this.template.querySelector('[data-id="filterBtn"]'); if (filterClasses.includes('slds-is-open')) { refreshButton.disabled = false; filterPopover.classList.remove('slds-is-open'); this.isFilter = false; + filterButton.focus(); } else { refreshButton.disabled = true; filterPopover.classList.add('slds-is-open'); this.isFilter = true; + closeButton.focus(); } switch (this.isLanguageRightToLeft) { @@ -1312,6 +1410,16 @@ export default class timeline extends NavigationMixin(LightningElement) { } } + handleStartDateChange(e){ + this.zoomStartDateString = e.target.value; + this.isFilterUpdated = true; + } + + handleEndDateChange(e){ + this.zoomEndDateString = e.target.value; + this.isFilterUpdated = true; + } + handleAllTypesChange(e) { if (e.target.checked === true) { this.filterValues = this.allFilterValues; @@ -1347,6 +1455,20 @@ export default class timeline extends NavigationMixin(LightningElement) { } applyFilter() { + console.log('applyFilter start'); + console.log('this.filterValues: '+this.filterValues); + if (this.zoomStartDateString) { + this.zoomStartDate = new Date(this.zoomStartDateString); // Convert string to Date object + console.log('Start Date updated to:', this.zoomStartDate); + } else { + console.log('Please enter a valid startdate.'); + } + if (this.zoomEndDateString) { + this.zoomEndDate = new Date(this.zoomEndDateString); // Convert string to Date object + console.log('End Date updated to:', this.zoomEndDate); + } else { + console.log('Please enter a valid end date.'); + } this.refreshTimeline(); this.isFilterUpdated = false; this.startingFilterValues = this.filterValues;