Skip to content

Commit

Permalink
Merge pull request #150 from SFDO-Community/oct23-sprint
Browse files Browse the repository at this point in the history
Consolidate Branches
  • Loading branch information
tschug authored Dec 2, 2023
2 parents 66778d0 + 932dd4b commit a1c7474
Show file tree
Hide file tree
Showing 36 changed files with 1,450 additions and 60 deletions.
6 changes: 6 additions & 0 deletions cumulusci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ flows:
flow: sample_inds
ui_options:
is_required: False
is_recommended: False
3:
task: deploy_training_indicators
ui_options:
is_required: False
is_recommended: False
config_dev:
steps:
3:
Expand Down
12 changes: 2 additions & 10 deletions force-app/main/default/classes/IndicatorController.cls
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ public with sharing class IndicatorController {
public String BundleDescription {get; set;}
@AuraEnabled
public String BundleId {get; set;}
// @AuraEnabled
// public String BackgroundColor {get; set;}
// @AuraEnabled
// public String ForegroundColor {get; set;}
@AuraEnabled
public List<IndicatorItem> Items {get; set;}
}
Expand Down Expand Up @@ -166,8 +162,6 @@ public with sharing class IndicatorController {
wrapper.CardTitle = 'Unbundled Items';
wrapper.BundleDescription = null;
wrapper.BundleId = null;
// wrapper.BackgroundColor = null;
// wrapper.ForegroundColor = null;
wrapper.Items = new List<IndicatorItem>();

for(Indicator_Item__mdt indicatorItem : Cmdt.getAllOrphanItems()){
Expand Down Expand Up @@ -220,7 +214,7 @@ public with sharing class IndicatorController {

extension.IsActive = itemExtension.Active__c;
extension.ContainsText = itemExtension.Contains_Text__c;
extension.TextOperator = itemExtension.Text_Operator__c;
extension.TextOperator = String.isNotBlank(itemExtension.Text_Operator__c) ? itemExtension.Text_Operator__c : 'Contains';
extension.Maximum = itemExtension.Maximum__c;
extension.Minimum = itemExtension.Minimum__c;
extension.ExtensionHoverText = itemExtension.Hover_Text__c;
Expand Down Expand Up @@ -266,8 +260,6 @@ public with sharing class IndicatorController {
wrapper.CardTitle = bundle.Card_Title__c;
wrapper.BundleDescription = bundle.Description__c;
wrapper.BundleId = bundle.Id;
// wrapper.BackgroundColor = bundle.Card_Icon_Background__c;
// wrapper.ForegroundColor = bundle.Card_Icon_Foreground__c;
wrapper.ObjectName = bundle.sObject__r.Label;
if(bundle.sObject__r.Label != bundle.sObject__r.QualifiedApiName){
wrapper.ObjectName += ' (' + bundle.sObject__r.QualifiedApiName + ')';
Expand Down Expand Up @@ -321,7 +313,7 @@ public with sharing class IndicatorController {

extension.IsActive = itemExtension.Active__c;
extension.ContainsText = itemExtension.Contains_Text__c;
extension.TextOperator = itemExtension.Text_Operator__c;
extension.TextOperator = String.isNotBlank(itemExtension.Text_Operator__c) ? itemExtension.Text_Operator__c : 'Contains';
extension.Maximum = itemExtension.Maximum__c;
extension.Minimum = itemExtension.Minimum__c;
extension.ExtensionHoverText = itemExtension.Hover_Text__c;
Expand Down
15 changes: 4 additions & 11 deletions force-app/main/default/lwc/indicatorBundle/indicatorBundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export default class IndicatorBundle extends LightningElement {
if (item.ZeroBehavior === 'Treat Zeroes as Blanks' && dataValue === 0){
dataValue = null;
}
console.log('DataValue',dataValue); // Retain for debug purposes
// console.log('DataValue',dataValue); // Retain for debug purposes

let showDefault = false;
if( item.HoverValue || item.TextValue || item.IconName || item.ImageUrl ){
Expand Down Expand Up @@ -220,19 +220,14 @@ export default class IndicatorBundle extends LightningElement {
// console.log('Value',dataValue + ' ' + extension.TextOperator + ' ' + compareValue); // Retain for debug purposes
if(extension.TextOperator === 'Contains'){
match = fieldValue.includes(compareValue);
// console.log('Contains', fieldValue.includes(compareValue));
} else if (extension.TextOperator === 'Does Not Equal') {
match = fieldValue != compareValue;
// console.log('Not equal', fieldValue != compareValue);
} else if (extension.TextOperator === 'Equals') {
match = fieldValue === compareValue;
// console.log('Equal', fieldValue === compareValue);
} else if (extension.TextOperator === 'Starts With'){
match = fieldValue.startsWith(compareValue);
// console.log('Start with', fieldValue.startsWith(compareValue));
} else {
match = fieldValue.includes(compareValue);
// console.log('Else', fieldValue.includes(compareValue));
}
}
// Else if the extension uses a Minimum boundary
Expand Down Expand Up @@ -264,8 +259,6 @@ export default class IndicatorBundle extends LightningElement {
"IconBackground" : extension.BackgroundColor,
"IconForeground" : extension.ForegroundColor
};

// console.dir(matchedExtension);
}
} // End-If extension.IsActive
}
Expand Down Expand Up @@ -316,10 +309,10 @@ export default class IndicatorBundle extends LightningElement {
//If no Icon Text is entered if the field is a Boolean then show the icon otherwise show the field value
...dataValue || dataValue === 0 ? {
...matchedExtension ? {
fTextShown: matchedExtension.TextValue
fTextShown: matchedExtension.TextValue ? matchedExtension.TextValue.toUpperCase().substring(0,3) : ''
} : {
...dataValue && item.TextValue ? {
fTextShown : item.TextValue
fTextShown : item.TextValue.toUpperCase().substring(0,3)
} : {
...item.EmptyStaticBehavior === 'Use Icon Only' ? {
fTextShown : ''
Expand All @@ -330,7 +323,7 @@ export default class IndicatorBundle extends LightningElement {
}
} : {
...(dataValue === false || dataValue === null || dataValue === '') && item.DisplayFalse ? {
fTextShown : item.FalseTextValue ? item.FalseTextValue : ''
fTextShown : item.FalseTextValue ? item.FalseTextValue.toUpperCase().substring(0,3) : ''
} : {
fTextShown : ''
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,32 @@ export default class IndicatorBundleKey extends LightningModal {
// console.dir(JSON.parse(JSON.stringify(item)));
if(item.ImageUrl || item.IconName){
// Show Normal
let fillDesc = '';
if(item.TextValue || item.TextValue === 0){
fillDesc = 'Static Text';
} else if (item.EmptyStaticBehavior === 'Use Field Value'){
fillDesc = 'Field Value';
} else if (item.EmptyStaticBehavior === 'Use Icon Only'){
if(item.ImageUrl && item.IconName) {
fillDesc = 'Image/Fallback Icon';
} else if(item.ImageUrl){
fillDesc = 'Image';
} else if(item.IconName){
fillDesc = 'Icon';
} else {
fillDesc = '';
}
}

let normalIcon = {
IndicatorId: item.IndicatorId,
IconName: item.IconName ? item.IconName : '',
TextValue: item.TextValue ? item.TextValue : '',
TextValue: item.TextValue ? item.TextValue.toUpperCase().substring(0,3) : '',
ImageUrl: item.ImageUrl ? item.ImageUrl : '',
HoverValue: item.HoverValue ? '\"' + item.HoverValue + '\"' : 'Field Value',
Priority: '',
ExtensionLogic: item.FieldLabel + ' has a value',
FillType: item.TextValue ? 'Static Text' : item.EmptyStaticBehavior,
FillType: fillDesc,
Description: '',
Background: item.BackgroundColor,
Foreground: item.ForegroundColor
Expand All @@ -62,15 +79,28 @@ export default class IndicatorBundleKey extends LightningModal {

if(item.FalseImageUrl || item.FalseIcon){
// Show Inverse
let fillDesc = '';
if(item.FalseTextValue || item.FalseTextValue === 0){
fillDesc = 'Static Text';
} else if(item.FalseImageUrl && item.FalseIcon) {
fillDesc = 'Image/Fallback Icon';
} else if(item.FalseImageUrl){
fillDesc = 'Image';
} else if(item.FalseIcon){
fillDesc = 'Icon';
} else {
fillDesc = '';
}

let inverseIcon = {
IndicatorId: item.IndicatorId,
IconName: item.FalseIcon ? item.FalseIcon : '',
TextValue: item.FalseTextValue ? item.FalseTextValue : '',
TextValue: item.FalseTextValue ? item.FalseTextValue.toUpperCase().substring(0,3) : '',
ImageUrl: item.FalseImageUrl ? item.FalseImageUrl : '',
HoverValue: item.FalseHoverValue ? '\"' + item.FalseHoverValue + '\"' : 'Field\'s Value',
HoverValue: item.FalseHoverValue ? '\"' + item.FalseHoverValue + '\"' : 'Field Value',
Priority: '',
ExtensionLogic: item.FieldLabel + ' is false or blank',
FillType: item.FalseTextValue ? 'Static Text' : 'Icon/Image',
FillType: fillDesc,
Description: '',
Background: item.InverseBackgroundColor,
Foreground: item.InverseForegroundColor
Expand All @@ -94,6 +124,23 @@ export default class IndicatorBundleKey extends LightningModal {
orderedExtensions.forEach(
ext =>
{
let fillDesc = '';
if(ext.ExtensionTextValue || ext.ExtensionTextValue === 0){
fillDesc = 'Static Text';
} else if (item.EmptyStaticBehavior === 'Use Field Value'){
fillDesc = 'Field Value';
} else if (item.EmptyStaticBehavior === 'Use Icon Only'){
if(ext.ExtensionImageUrl && ext.ExtensionIconValue) {
fillDesc = 'Image/Fallback Icon';
} else if(ext.ExtensionImageUrl){
fillDesc = 'Image';
} else if(ext.ExtensionIconValue){
fillDesc = 'Icon';
} else {
fillDesc = '';
}
}

let extensionIcon = {
IndicatorId: ext.ExtensionId,
IconName: ext.ExtensionIconValue ? ext.ExtensionIconValue : '',
Expand All @@ -102,15 +149,16 @@ export default class IndicatorBundleKey extends LightningModal {
HoverValue: ext.ExtensionHoverText ? '\"' + ext.ExtensionHoverText + '\"' : 'Field Value',
Priority: ext.PriorityOrder ? ext.PriorityOrder : '',
ExtensionLogic: '',
FillType: ext.ExtensionTextValue ? 'Static Text' : 'Icon/Image',
FillType: fillDesc,
Description: ext.ExtensionDescription,
Background: ext.BackgroundColor,
Foreground: ext.ForegroundColor
Foreground: ext.ForegroundColor,
Operator: ext.TextOperator
};

if(ext.ContainsText) {
extensionIcon.ExtensionLogic = item.FieldLabel + ' contains: \"' + ext.ContainsText + '\"';
} else if (ext.Minimum) {
extensionIcon.ExtensionLogic = item.FieldLabel + ' ' + ext.TextOperator.toUpperCase() + ' \"' + ext.ContainsText + '\"';
} else if (ext.Minimum || ext.Minimum === 0) {
let range = item.FieldLabel + ' greater than or equal to ' + ext.Minimum;
if(ext.Maximum){
range += ' and less than ' + ext.Maximum;
Expand Down
2 changes: 1 addition & 1 deletion force-app/main/default/lwc/key/key.html
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ <h2>Item is not active. No indicators will be shown, even if they are active.</
<lightning-layout-item padding="around-small" size="1" class="slds-border_bottom">
<b>Fill Type </b>
<span style="position:relative; top:-4px;">
<lightning-helptext content="Fill Type indicates if the indicator using a Lightning icon display's static text over an icon, the field's value over an icon, or only the icon."></lightning-helptext>
<lightning-helptext content="Fill Type indicates if the indicator using an image, an image with a fallback icon, static text over an icon, the field's value over an icon, or only the icon."></lightning-helptext>
</span>
</lightning-layout-item>
</template>
Expand Down
Loading

0 comments on commit a1c7474

Please sign in to comment.