()
| 274 | return diagnostics; |
| 275 | } |
| 276 | export function buildSettingSourcesProperties(): Property[] { |
| 277 | const enabledSources = getEnabledSettingSources(); |
| 278 | |
| 279 | // Filter to only sources that actually have settings loaded |
| 280 | const sourcesWithSettings = enabledSources.filter(source => { |
| 281 | const settings = getSettingsForSource(source); |
| 282 | return settings !== null && Object.keys(settings).length > 0; |
| 283 | }); |
| 284 | |
| 285 | // Map internal names to user-friendly names |
| 286 | // For policySettings, distinguish between remote and local (or skip if neither exists) |
| 287 | const sourceNames = sourcesWithSettings.map(source => { |
| 288 | if (source === 'policySettings') { |
| 289 | const origin = getPolicySettingsOrigin(); |
| 290 | if (origin === null) { |
| 291 | return null; // Skip - no policy settings exist |
| 292 | } |
| 293 | switch (origin) { |
| 294 | case 'remote': |
| 295 | return 'Enterprise managed settings (remote)'; |
| 296 | case 'plist': |
| 297 | return 'Enterprise managed settings (plist)'; |
| 298 | case 'hklm': |
| 299 | return 'Enterprise managed settings (HKLM)'; |
| 300 | case 'file': |
| 301 | { |
| 302 | const { |
| 303 | hasBase, |
| 304 | hasDropIns |
| 305 | } = getManagedFileSettingsPresence(); |
| 306 | if (hasBase && hasDropIns) { |
| 307 | return 'Enterprise managed settings (file + drop-ins)'; |
| 308 | } |
| 309 | if (hasDropIns) { |
| 310 | return 'Enterprise managed settings (drop-ins)'; |
| 311 | } |
| 312 | return 'Enterprise managed settings (file)'; |
| 313 | } |
| 314 | case 'hkcu': |
| 315 | return 'Enterprise managed settings (HKCU)'; |
| 316 | } |
| 317 | } |
| 318 | return getSettingSourceDisplayNameCapitalized(source); |
| 319 | }).filter((name): name is string => name !== null); |
| 320 | return [{ |
| 321 | label: 'Setting sources', |
| 322 | value: sourceNames |
| 323 | }]; |
| 324 | } |
| 325 | export async function buildInstallationDiagnostics(): Promise<Diagnostic[]> { |
| 326 | const installWarnings = await checkInstall(); |
| 327 | return installWarnings.map(warning => warning.message); |
no test coverage detected