mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-08-26 14:19:24 +00:00
Make all tool filtering configurable for developers
This commit is contained in:
parent
2ca823aced
commit
32324cf27e
@ -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,6 +618,9 @@ export function useFlatToolRegistry(): ToolRegistry {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (showPlaceholderTools) {
|
||||||
|
return allTools;
|
||||||
|
} else {
|
||||||
const filteredTools = Object.keys(allTools)
|
const filteredTools = Object.keys(allTools)
|
||||||
.filter(key => allTools[key].component !== null || allTools[key].link)
|
.filter(key => allTools[key].component !== null || allTools[key].link)
|
||||||
.reduce((obj, key) => {
|
.reduce((obj, key) => {
|
||||||
@ -626,3 +629,4 @@ export function useFlatToolRegistry(): ToolRegistry {
|
|||||||
}, {} as ToolRegistry);
|
}, {} as ToolRegistry);
|
||||||
return filteredTools;
|
return filteredTools;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user