Make all tool filtering configurable for developers

This commit is contained in:
James Brunton 2025-08-20 16:32:22 +01:00
parent 2ca823aced
commit 32324cf27e

View File

@ -15,7 +15,7 @@ import SingleLargePage from '../tools/SingleLargePage';
import UnlockPdfForms from '../tools/UnlockPdfForms'; import UnlockPdfForms from '../tools/UnlockPdfForms';
import RemoveCertificateSign from '../tools/RemoveCertificateSign'; import RemoveCertificateSign from '../tools/RemoveCertificateSign';
const showPlaceholderTools = false; // For development purposes. Allows seeing the full list of tools, even if they're unimplemented
// Hook to get the translated tool registry // Hook to get the translated tool registry
export function useFlatToolRegistry(): ToolRegistry { export function useFlatToolRegistry(): ToolRegistry {
@ -618,11 +618,15 @@ export function useFlatToolRegistry(): ToolRegistry {
}, },
}; };
const filteredTools = Object.keys(allTools) if (showPlaceholderTools) {
.filter(key => allTools[key].component !== null || allTools[key].link) return allTools;
.reduce((obj, key) => { } else {
obj[key] = allTools[key]; const filteredTools = Object.keys(allTools)
return obj; .filter(key => allTools[key].component !== null || allTools[key].link)
}, {} as ToolRegistry); .reduce((obj, key) => {
return filteredTools; obj[key] = allTools[key];
return obj;
}, {} as ToolRegistry);
return filteredTools;
}
} }