From 44df05fccfa3ec26c9e0a3671a5b700454894970 Mon Sep 17 00:00:00 2001 From: Jacob Nichols Date: Mon, 28 Jul 2025 11:27:07 -0500 Subject: [PATCH] fix missing icons --- src/templates/bootstrap5/iconClass.ts | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/templates/bootstrap5/iconClass.ts b/src/templates/bootstrap5/iconClass.ts index 7227cc9fb..cf6f3f4d4 100644 --- a/src/templates/bootstrap5/iconClass.ts +++ b/src/templates/bootstrap5/iconClass.ts @@ -110,6 +110,7 @@ export default (iconset: iconset, name: string, spinning: boolean) => { biName = 'question-circle'; break; case 'remove-circle': + name = 'circle-xmark'; biName = 'x-circle'; break; case 'new-window': @@ -166,5 +167,23 @@ export default (iconset: iconset, name: string, spinning: boolean) => { biName = 'arrow-clockwise'; break; } - return spinning ? 'spinner-border spinner-border-sm' : `${iconset} ${iconset}-${iconset === 'bi' ? biName : name}`; + + function generateIconClass() { + if (spinning){ + return 'spinner-border spinner-border-sm'; + } + const iconName = iconset === 'bi' ? biName : name; + // Handles legacy icons names. For example, fa-remove-circle was changed to fa-circle-xmark in a major version + // update of font-awesome. To handle cases where customers are still on a very old version of font-awesome add + // a fallback if statement to handle such cases + function handleLegacyIconNames() { + if (iconset === 'fa' && name === 'circle-xmark'){ + return `${iconset}-${name} ${iconset}-remove-circle` + } + return `${iconset}-${iconName}`; + } + + return `${iconset} ${handleLegacyIconNames()}` + } + return generateIconClass(); };