Skip to content

Commit 73800a5

Browse files
Fix setup assistant fallback bootstrap
1 parent 29ccacb commit 73800a5

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

src/folderview.plus/usr/local/emhttp/plugins/folderview.plus/scripts/folderviewplus.wizard.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,11 @@ const resolveSetupAssistantTemplateBestMatch = (...args) => getWizardSmartDetect
707707
const resolveSetupAssistantSmartBlueprintIndexes = (...args) => getWizardSmartDetectApi().resolveSetupAssistantSmartBlueprintIndexes(...args);
708708
const buildSetupAssistantTemplateAssignmentPreview = (...args) => getWizardSmartDetectApi().buildSetupAssistantTemplateAssignmentPreview(...args);
709709

710+
const SETUP_ASSISTANT_TEMPLATE_FALLBACK_BY_TYPE = Object.freeze({
711+
docker: String((window.FolderViewPlusSmartDetectConfig || {}).fallbackByType?.docker || 'Utilities'),
712+
vm: String((window.FolderViewPlusSmartDetectConfig || {}).fallbackByType?.vm || 'Utility VMs')
713+
});
714+
710715
const buildSetupAssistantTemplatePlanForType = (type) => {
711716
const resolvedType = normalizeManagedType(type);
712717
const bootstrap = getSetupAssistantTemplateBootstrap(resolvedType);

tests/setup-assistant-smart-detect.test.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ test('smart detect thresholds and aliases are centralized in the shared config m
167167
assert.match(wizardJs, /window\.FolderViewPlusWizardSmartDetect \|\| null/);
168168
assert.match(wizardJs, /const getWizardSmartDetectApi = \(\(\) =>/);
169169
assert.match(wizardJs, /cachedApi = wizardSmartDetectModule\.createApi\(/);
170+
assert.match(wizardJs, /const SETUP_ASSISTANT_TEMPLATE_FALLBACK_BY_TYPE = Object\.freeze\(/);
171+
assert.match(wizardJs, /window\.FolderViewPlusSmartDetectConfig \|\| \{\}/);
170172
assert.match(settingsJs, /window\.FolderViewPlusSmartDetectConfig \|\| \{\}/);
171173
});
172174

0 commit comments

Comments
 (0)