Skip to content

Commit

Permalink
Supported Extensions with Badges
Browse files Browse the repository at this point in the history
  • Loading branch information
tschug committed Nov 23, 2024
1 parent b05c0d8 commit 2cca75f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
12 changes: 8 additions & 4 deletions force-app/main/default/lwc/indicatorBundle/indicatorBundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,9 @@ export default class IndicatorBundle extends LightningElement {
"HoverValue" : extension.ExtensionHoverText,
"Priority" : extension.PriorityOrder,
"IconBackground" : extension.BackgroundColor,
"IconForeground" : extension.ForegroundColor
"IconForeground" : extension.ForegroundColor,
"BadgeTextColor" : extension.BadgeTextColor,
"BadgeIconPosition" : extension.BadgeIconPosition
};

// However, if multiple matching is enabled, immediately assign the Extension for use in the Bundle.
Expand All @@ -328,12 +330,14 @@ export default class IndicatorBundle extends LightningElement {
fName: item.FieldApiName,
fTextValue: dataValue,
fImageURL: matchedExtension.ImageUrl,
fHoverValue: (matchedExtension && matchedExtension.HoverValue) ? matchedExtension.HoverValue : assignedHoverValue,
fHoverValue: (matchedExtension && matchedExtension.HoverValue) ? matchedExtension.HoverValue : dataValue,
fShowAvatar: true,
fIconName : matchedExtension.IconName,
fIconBackground : matchedExtension.IconBackground,
fIconForeground : matchedExtension.IconForeground,
fTextShown: matchedExtension.TextValue
fTextShown: matchedExtension.TextValue,
fTextColor: matchedExtension.BadgeTextColor,
fIconPosition: matchedExtension.BadgeIconPosition
}
);
}
Expand Down Expand Up @@ -363,7 +367,7 @@ export default class IndicatorBundle extends LightningElement {
},
// ! If value is false, the false hover will be set.
...dataValue || dataValue === 0 ? {
fHoverValue: (matchedExtension && matchedExtension.HoverValue) ? matchedExtension.HoverValue : assignedHoverValue
fHoverValue: (matchedExtension && matchedExtension.HoverValue) ? matchedExtension.HoverValue : dataValue
} : {
fHoverValue: item.DisplayFalse ? item.FalseHoverValue : ''
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ export default class IndicatorBundleBadge extends LightningElement {

if(this.indBackgroundColor || this.indForegroundColor || this.indTextColor){
var css = this.template.querySelector(".indicatorBadge").style;
css.setProperty('--backgroundColor', this.indBackgroundColor);
css.setProperty('--foregroundColor', this.indForegroundColor);
css.setProperty('--textColor', this.indTextColor);

css.setProperty('--backgroundColor', this.indBackgroundColor ? this.indBackgroundColor : '#f3f3f3');
css.setProperty('--foregroundColor', this.indForegroundColor ? this.indForegroundColor : '#747474');
css.setProperty('--textColor', this.indTextColor ? this.indText : '#181818');
}

}
Expand Down

0 comments on commit 2cca75f

Please sign in to comment.