()
| 124 | return diagnostics; |
| 125 | } |
| 126 | export function buildSettingSourcesProperties(): Property[] { |
| 127 | const enabledSources = getEnabledSettingSources(); |
| 128 | |
| 129 | // Filter to only sources that actually have settings loaded |
| 130 | const sourcesWithSettings = enabledSources.filter(source => { |
| 131 | const settings = getSettingsForSource(source); |
| 132 | return settings !== null && Object.keys(settings).length > 0; |
| 133 | }); |
| 134 | |
| 135 | // Map internal names to user-friendly names |
| 136 | // For policySettings, distinguish between remote and local (or skip if neither exists) |
| 137 | const sourceNames = sourcesWithSettings.map(source => { |
| 138 | if (source === 'policySettings') { |
| 139 | const origin = getPolicySettingsOrigin(); |
| 140 | if (origin === null) { |
| 141 | return null; // Skip - no policy settings exist |
| 142 | } |
| 143 | switch (origin) { |
| 144 | case 'remote': |
| 145 | return 'Enterprise managed settings (remote)'; |
| 146 | case 'plist': |
| 147 | return 'Enterprise managed settings (plist)'; |
| 148 | case 'hklm': |
| 149 | return 'Enterprise managed settings (HKLM)'; |
| 150 | case 'file': |
| 151 | { |
| 152 | const { |
| 153 | hasBase, |
| 154 | hasDropIns |
| 155 | } = getManagedFileSettingsPresence(); |
| 156 | if (hasBase && hasDropIns) { |
| 157 | return 'Enterprise managed settings (file + drop-ins)'; |
| 158 | } |
| 159 | if (hasDropIns) { |
| 160 | return 'Enterprise managed settings (drop-ins)'; |
| 161 | } |
| 162 | return 'Enterprise managed settings (file)'; |
| 163 | } |
| 164 | case 'hkcu': |
| 165 | return 'Enterprise managed settings (HKCU)'; |
| 166 | } |
| 167 | } |
| 168 | return getSettingSourceDisplayNameCapitalized(source); |
| 169 | }).filter((name): name is string => name !== null); |
| 170 | return [{ |
| 171 | label: 'Setting sources', |
| 172 | value: sourceNames |
| 173 | }]; |
| 174 | } |
| 175 | export async function buildInstallationDiagnostics(): Promise<Diagnostic[]> { |
| 176 | const installWarnings = await checkInstall(); |
| 177 | return installWarnings.map(warning => warning.message); |
no test coverage detected