diff --git a/packages/survey-core/src/utils/utils.ts b/packages/survey-core/src/utils/utils.ts index 1988886a2f..b0c5bbb10c 100644 --- a/packages/survey-core/src/utils/utils.ts +++ b/packages/survey-core/src/utils/utils.ts @@ -164,9 +164,20 @@ function wrapUrlForBackgroundImage(url: string): string { return !!url ? ["url(", url, ")"].join("") : ""; } +//new-name: old-name +const renamedIcons = { + "folder": "chooseFile" +}; + function getIconNameFromProxy(iconName: string): string { if (!iconName) return iconName; var proxyName = (settings.customIcons)[iconName]; + if(!proxyName) { + const oldName = renamedIcons[iconName]; + if(!!oldName) { + proxyName = (settings.customIcons)[oldName]; + } + } return !!proxyName ? proxyName : iconName; } diff --git a/packages/survey-core/tests/components/actionbartests.ts b/packages/survey-core/tests/components/actionbartests.ts index 983fd0bd72..782fc69e55 100644 --- a/packages/survey-core/tests/components/actionbartests.ts +++ b/packages/survey-core/tests/components/actionbartests.ts @@ -44,6 +44,17 @@ QUnit.test( } ); +QUnit.test( + "Support old customIcons names in svg, function getIconNameFromProxy", + (assert) => { + settings.customIcons["chooseFile"] = "new-chooseFile"; + assert.equal(getIconNameFromProxy("chooseFile"), "new-chooseFile"); + assert.equal(getIconNameFromProxy("folder"), "new-chooseFile"); + assert.equal(getIconNameFromProxy("folder-new"), "folder-new"); + delete settings.customIcons["chooseFile"]; + } +); + QUnit.test( "isVisible", (assert) => {