Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

procyon release #190

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 34 additions & 1 deletion force-app/main/default/classes/TimelineService.cls
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ public with sharing class TimelineService {
'Icon__c, ' +
'Icon_Background_Colour__c, ' +
'Position_Date_Field__c, ' +
'Position_End_Date_Field__c, ' +
'Object_Name__c, ' +
'Type_Field__c, ' +
'Drilldown_Id_Field__c, ' +
Expand Down Expand Up @@ -151,6 +152,7 @@ public with sharing class TimelineService {
timelineRecord.objectName = timelineConfigurationRecord.Object_Name__c;
timelineRecord.type = timelineConfigurationRecord.Type_Field__c;
timelineRecord.positionDateField = timelineConfigurationRecord.Position_Date_Field__c;
timelineRecord.positionEndDateField = timelineConfigurationRecord.Position_End_Date_Field__c;
timelineRecord.fallbackTooltipField = timelineConfigurationRecord.Fallback_Tooltip_Field__c;
timelineRecord.tooltipIdField = timelineConfigurationRecord.Tooltip_Id_Field__c;
timelineRecord.tooltipObject = timelineConfigurationRecord.Tooltip_Object_Name__c;
Expand All @@ -163,6 +165,7 @@ public with sharing class TimelineService {
);
mapOfFields.put(timelineRecord.detailField, timelineRecord.objectName);
mapOfFields.put(timelineRecord.positionDateField, timelineRecord.objectName);
mapOfFields.put(timelineRecord.positionEndDateField, timelineRecord.objectName);
mapOfFields.put(timelineRecord.fallbackTooltipField, timelineRecord.objectName);
mapOfFields.put(timelineRecord.tooltipIdField, timelineRecord.objectName);
mapOfFields.put(timelineRecord.drilldownIdField, timelineRecord.objectName);
Expand All @@ -182,8 +185,23 @@ public with sharing class TimelineService {
String tooltipIdField = String.valueOf(tcr.tooltipIdField);
String drilldownIdField = String.valueOf(tcr.drilldownIdField);
String typeField = String.valueOf(tcr.type);

String selectStatement = '(SELECT Id, '
+ tcr.detailField + ', '
+ tcr.positionDateField + '';

if (String.valueOf(tcr.positionEndDateField) != null && String.valueOf(tcr.positionEndDateField) != ''){
selectStatement = selectStatement + ', '
+ tcr.positionEndDateField + '';
}

String selectStatement = '(SELECT Id, ' + tcr.detailField + ', ' + tcr.positionDateField + '';
String selectStatement = '(SELECT Id, ' +
tcr.detailField + ', ' +
tcr.positionDateField +
(String.isBlank(tcr.positionEndDateField)
? ''
: (', ' + tcr.positionEndDateField)
);

if (
(typeField != null && typeField != '') &&
Expand Down Expand Up @@ -293,6 +311,11 @@ public with sharing class TimelineService {
eachCh,
tr.objectName
);
Map<String, String> positionEndValues = getFieldValues(
tr.positionEndDateField,
eachCh,
tr.objectName
);
Map<String, String> fallbackValues = getFieldValues(
tr.fallbackTooltipField,
eachCh,
Expand Down Expand Up @@ -329,6 +352,12 @@ public with sharing class TimelineService {
mapData.put('detailFieldLabel', detailValues.get('label'));
mapData.put('positionDateField', positionValues.get('label'));
mapData.put('positionDateValue', positionValues.get('value'));
mapData.put('positionEndDateField', positionEndValues.get('label'));
if (String.isBlank(positionEndValues.get('value'))){
mapData.put('positionEndDateValue', positionValues.get('value'));
} else {
mapData.put('positionEndDateValue', positionEndValues.get('value'));
}
mapData.put('objectName', tr.objectName);
mapData.put('fallbackTooltipField', fallbackValues.get('label'));
mapData.put('fallbackTooltipValue', fallbackValues.get('value'));
Expand Down Expand Up @@ -603,8 +632,12 @@ public with sharing class TimelineService {
private String detailFieldLabel;
private String icon;
private String iconBackground;
private String positionEndDateField;
private String positionEndDateValue;
private String positionDateField;
private String positionDateValue;
private String positionEndDateField;
private String positionDateEndValue;
private String objectName;
private String type;
private String tooltipIdField;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
<field>Position_Date_Field__c</field>
<value xsi:type="xsd:string">CreatedDate</value>
</values>
<values>
<field>Position_End_Date_Field__c</field>
<value xsi:nil="true"/>
</values>
<values>
<field>Relationship_Name__c</field>
<value xsi:type="xsd:string">AccountContactRelations</value>
Expand All @@ -46,6 +50,10 @@
<field>Sequence__c</field>
<value xsi:type="xsd:double">40.0</value>
</values>
<values>
<field>Test__c</field>
<value xsi:type="xsd:boolean">false</value>
</values>
<values>
<field>Tooltip_Id_Field__c</field>
<value xsi:nil="true"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
<field>Position_Date_Field__c</field>
<value xsi:type="xsd:string">PurchaseDate</value>
</values>
<values>
<field>Position_End_Date_Field__c</field>
<value xsi:nil="true"/>
</values>
<values>
<field>Relationship_Name__c</field>
<value xsi:type="xsd:string">Assets</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
<field>Detail_Field__c</field>
<value xsi:type="xsd:string">Subject</value>
</values>
<values>
<field>Drilldown_Id_Field__c</field>
<value xsi:nil="true"/>
</values>
<values>
<field>Fallback_Tooltip_Field__c</field>
<value xsi:nil="true"/>
Expand All @@ -34,6 +38,10 @@
<field>Position_Date_Field__c</field>
<value xsi:type="xsd:string">CreatedDate</value>
</values>
<values>
<field>Position_End_Date_Field__c</field>
<value xsi:nil="true"/>
</values>
<values>
<field>Relationship_Name__c</field>
<value xsi:type="xsd:string">Cases</value>
Expand All @@ -42,6 +50,18 @@
<field>Sequence__c</field>
<value xsi:type="xsd:double">50.0</value>
</values>
<values>
<field>Test__c</field>
<value xsi:type="xsd:boolean">false</value>
</values>
<values>
<field>Tooltip_Id_Field__c</field>
<value xsi:nil="true"/>
</values>
<values>
<field>Tooltip_Object_Name__c</field>
<value xsi:nil="true"/>
</values>
<values>
<field>Type_Field__c</field>
<value xsi:nil="true"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
<field>Position_Date_Field__c</field>
<value xsi:type="xsd:string">CreatedDate</value>
</values>
<values>
<field>Position_End_Date_Field__c</field>
<value xsi:nil="true"/>
</values>
<values>
<field>Relationship_Name__c</field>
<value xsi:type="xsd:string">Contacts</value>
Expand All @@ -46,6 +50,10 @@
<field>Sequence__c</field>
<value xsi:type="xsd:double">40.0</value>
</values>
<values>
<field>Test__c</field>
<value xsi:type="xsd:boolean">false</value>
</values>
<values>
<field>Tooltip_Id_Field__c</field>
<value xsi:nil="true"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
<field>Position_Date_Field__c</field>
<value xsi:type="xsd:string">StartDate</value>
</values>
<values>
<field>Position_End_Date_Field__c</field>
<value xsi:nil="true"/>
</values>
<values>
<field>Relationship_Name__c</field>
<value xsi:type="xsd:string">Entitlements</value>
Expand All @@ -46,6 +50,10 @@
<field>Sequence__c</field>
<value xsi:type="xsd:double">86.0</value>
</values>
<values>
<field>Test__c</field>
<value xsi:type="xsd:boolean">false</value>
</values>
<values>
<field>Tooltip_Id_Field__c</field>
<value xsi:nil="true"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
<field>Detail_Field__c</field>
<value xsi:type="xsd:string">Subject</value>
</values>
<values>
<field>Drilldown_Id_Field__c</field>
<value xsi:nil="true"/>
</values>
<values>
<field>Fallback_Tooltip_Field__c</field>
<value xsi:type="xsd:string">Owner.Name</value>
Expand All @@ -34,6 +38,10 @@
<field>Position_Date_Field__c</field>
<value xsi:type="xsd:string">StartDateTime</value>
</values>
<values>
<field>Position_End_Date_Field__c</field>
<value xsi:nil="true"/>
</values>
<values>
<field>Relationship_Name__c</field>
<value xsi:type="xsd:string">Events</value>
Expand All @@ -42,6 +50,18 @@
<field>Sequence__c</field>
<value xsi:type="xsd:double">20.0</value>
</values>
<values>
<field>Test__c</field>
<value xsi:type="xsd:boolean">false</value>
</values>
<values>
<field>Tooltip_Id_Field__c</field>
<value xsi:nil="true"/>
</values>
<values>
<field>Tooltip_Object_Name__c</field>
<value xsi:nil="true"/>
</values>
<values>
<field>Type_Field__c</field>
<value xsi:nil="true"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
<field>Detail_Field__c</field>
<value xsi:type="xsd:string">ContentDocument.Title</value>
</values>
<values>
<field>Drilldown_Id_Field__c</field>
<value xsi:nil="true"/>
</values>
<values>
<field>Fallback_Tooltip_Field__c</field>
<value xsi:type="xsd:string">ContentDocument.FileExtension</value>
Expand All @@ -34,6 +38,10 @@
<field>Position_Date_Field__c</field>
<value xsi:type="xsd:string">SystemModstamp</value>
</values>
<values>
<field>Position_End_Date_Field__c</field>
<value xsi:nil="true"/>
</values>
<values>
<field>Relationship_Name__c</field>
<value xsi:type="xsd:string">ContentDocumentLinks</value>
Expand All @@ -42,6 +50,18 @@
<field>Sequence__c</field>
<value xsi:type="xsd:double">30.0</value>
</values>
<values>
<field>Test__c</field>
<value xsi:type="xsd:boolean">false</value>
</values>
<values>
<field>Tooltip_Id_Field__c</field>
<value xsi:nil="true"/>
</values>
<values>
<field>Tooltip_Object_Name__c</field>
<value xsi:nil="true"/>
</values>
<values>
<field>Type_Field__c</field>
<value xsi:type="xsd:string">ContentDocument.FileType</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
<field>Detail_Field__c</field>
<value xsi:type="xsd:string">Name</value>
</values>
<values>
<field>Drilldown_Id_Field__c</field>
<value xsi:nil="true"/>
</values>
<values>
<field>Fallback_Tooltip_Field__c</field>
<value xsi:nil="true"/>
Expand All @@ -34,6 +38,10 @@
<field>Position_Date_Field__c</field>
<value xsi:type="xsd:string">CreatedDate</value>
</values>
<values>
<field>Position_End_Date_Field__c</field>
<value xsi:nil="true"/>
</values>
<values>
<field>Relationship_Name__c</field>
<value xsi:type="xsd:string">Opportunities</value>
Expand All @@ -42,6 +50,18 @@
<field>Sequence__c</field>
<value xsi:type="xsd:double">60.0</value>
</values>
<values>
<field>Test__c</field>
<value xsi:type="xsd:boolean">false</value>
</values>
<values>
<field>Tooltip_Id_Field__c</field>
<value xsi:nil="true"/>
</values>
<values>
<field>Tooltip_Object_Name__c</field>
<value xsi:nil="true"/>
</values>
<values>
<field>Type_Field__c</field>
<value xsi:nil="true"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
<field>Position_Date_Field__c</field>
<value xsi:type="xsd:string">EffectiveDate</value>
</values>
<values>
<field>Position_End_Date_Field__c</field>
<value xsi:nil="true"/>
</values>
<values>
<field>Relationship_Name__c</field>
<value xsi:type="xsd:string">Orders</value>
Expand All @@ -46,6 +50,10 @@
<field>Sequence__c</field>
<value xsi:type="xsd:double">87.0</value>
</values>
<values>
<field>Test__c</field>
<value xsi:type="xsd:boolean">false</value>
</values>
<values>
<field>Tooltip_Id_Field__c</field>
<value xsi:nil="true"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
<field>Position_Date_Field__c</field>
<value xsi:type="xsd:string">StartDate</value>
</values>
<values>
<field>Position_End_Date_Field__c</field>
<value xsi:nil="true"/>
</values>
<values>
<field>Relationship_Name__c</field>
<value xsi:type="xsd:string">ServiceContracts</value>
Expand All @@ -46,6 +50,10 @@
<field>Sequence__c</field>
<value xsi:type="xsd:double">85.0</value>
</values>
<values>
<field>Test__c</field>
<value xsi:type="xsd:boolean">false</value>
</values>
<values>
<field>Tooltip_Id_Field__c</field>
<value xsi:nil="true"/>
Expand Down
Loading