From 8c4c44b39fd594ec819cd31f35527ef838983e2e Mon Sep 17 00:00:00 2001 From: Anthony Stirling <77850077+Frooodle@users.noreply.github.com.> Date: Tue, 26 Aug 2025 11:05:58 +0100 Subject: [PATCH] remove naming --- .../public/locales/en-GB/translation.json | 16 +++- .../public/locales/en-US/translation.json | 11 --- .../tools/automate/AutomationEntry.tsx | 86 ++++++++----------- .../tools/automate/AutomationSelection.tsx | 2 +- .../tools/automate/useSuggestedAutomations.ts | 11 --- frontend/src/types/automation.ts | 1 - 6 files changed, 53 insertions(+), 74 deletions(-) diff --git a/frontend/public/locales/en-GB/translation.json b/frontend/public/locales/en-GB/translation.json index 2c9a0a6cd..c18849441 100644 --- a/frontend/public/locales/en-GB/translation.json +++ b/frontend/public/locales/en-GB/translation.json @@ -2275,6 +2275,20 @@ "description": "Configure the settings for this tool. These settings will be applied when the automation runs.", "cancel": "Cancel", "save": "Save Configuration" - } + }, + "copyToSaved": "Copy to Saved" } + }, + "automation": { + "suggested": { + "securePdfIngestion": "Secure PDF Ingestion", + "securePdfIngestionDesc": "Comprehensive PDF processing workflow that sanitises documents, applies OCR with cleanup, converts to PDF/A format for long-term archival, and optimises file size.", + "emailPreparation": "Email Preparation", + "emailPreparationDesc": "Optimises PDFs for email distribution by compressing files, splitting large documents into 20MB chunks for email compatibility, and removing metadata for privacy.", + "secureWorkflow": "Security Workflow", + "secureWorkflowDesc": "Secures PDF documents by removing potentially malicious content like JavaScript and embedded files, then adds password protection to prevent unauthorised access.", + "processImages": "Process Images", + "processImagesDesc": "Converts multiple image files into a single PDF document, then applies OCR technology to extract searchable text from the images." + } + } } diff --git a/frontend/public/locales/en-US/translation.json b/frontend/public/locales/en-US/translation.json index 5ff617c9e..ab5b66802 100644 --- a/frontend/public/locales/en-US/translation.json +++ b/frontend/public/locales/en-US/translation.json @@ -2117,17 +2117,6 @@ "secureWorkflowDesc": "Secures PDF documents by removing potentially malicious content like JavaScript and embedded files, then adds password protection to prevent unauthorized access.", "processImages": "Process Images", "processImagesDesc": "Converts multiple image files into a single PDF document, then applies OCR technology to extract searchable text from the images." - }, - "operation": { - "sanitize": "Sanitize", - "ocrCleanup": "OCR & Cleanup", - "pdfaConversion": "PDF/A Conversion", - "compress": "Compress", - "splitBySize": "Split by Size (20MB)", - "sanitizeMetadata": "Remove Metadata", - "addPassword": "Add Password Protection", - "imageToPdf": "Image to PDF", - "ocr": "OCR Text Extraction" } }, "automate": { diff --git a/frontend/src/components/tools/automate/AutomationEntry.tsx b/frontend/src/components/tools/automate/AutomationEntry.tsx index 5e050db1a..8c07fb14b 100644 --- a/frontend/src/components/tools/automate/AutomationEntry.tsx +++ b/frontend/src/components/tools/automate/AutomationEntry.tsx @@ -14,8 +14,8 @@ interface AutomationEntryProps { description?: string; /** MUI Icon component for the badge */ badgeIcon?: React.ComponentType; - /** Array of tool operation names in the workflow OR full operation objects with display names */ - operations: string[] | Array<{operation: string; displayName?: string}>; + /** Array of tool operation names in the workflow */ + operations: string[]; /** Click handler */ onClick: () => void; /** Whether to keep the icon at normal color (for special cases like "Add New") */ @@ -53,36 +53,30 @@ export default function AutomationEntry({ const createTooltipContent = () => { if (!description) return null; - const toolChain = operations.map((op, index) => { - // Handle both string[] and operation object arrays - const operationName = typeof op === 'string' ? op : op.operation; - const displayName = typeof op === 'object' && op.displayName ? op.displayName : t(`${operationName}.title`, operationName); - - return ( - - - {displayName} + const toolChain = operations.map((op, index) => ( + + + {t(`${op}.title`, op)} + + {index < operations.length - 1 && ( + + → - {index < operations.length - 1 && ( - - → - - )} - - ); - }); + )} + + )); return (
@@ -125,25 +119,19 @@ export default function AutomationEntry({ /> )} - {operations.map((op, index) => { - // Handle both string[] and operation object arrays - const operationName = typeof op === 'string' ? op : op.operation; - const displayName = typeof op === 'object' && op.displayName ? op.displayName : t(`${operationName}.title`, operationName); - - return ( - - - {displayName} - + {operations.map((op, index) => ( + + + {t(`${op}.title`, op)} + - {index < operations.length - 1 && ( - - → - - )} - - ); - })} + {index < operations.length - 1 && ( + + → + + )} + + ))} ); diff --git a/frontend/src/components/tools/automate/AutomationSelection.tsx b/frontend/src/components/tools/automate/AutomationSelection.tsx index 4c535be6d..197a96b3e 100644 --- a/frontend/src/components/tools/automate/AutomationSelection.tsx +++ b/frontend/src/components/tools/automate/AutomationSelection.tsx @@ -68,7 +68,7 @@ export default function AutomationSelection({ title={automation.name} description={automation.description} badgeIcon={automation.icon} - operations={automation.operations} + operations={automation.operations.map(op => op.operation)} onClick={() => onRun(automation)} showMenu={true} onCopy={() => onCopyFromSuggested(automation)} diff --git a/frontend/src/hooks/tools/automate/useSuggestedAutomations.ts b/frontend/src/hooks/tools/automate/useSuggestedAutomations.ts index 09caea51c..047f041e4 100644 --- a/frontend/src/hooks/tools/automate/useSuggestedAutomations.ts +++ b/frontend/src/hooks/tools/automate/useSuggestedAutomations.ts @@ -23,7 +23,6 @@ export function useSuggestedAutomations(): SuggestedAutomation[] { operations: [ { operation: "sanitize", - displayName: t("automation.operation.sanitize", "Sanitize"), parameters: { removeJavaScript: true, removeEmbeddedFiles: true, @@ -35,7 +34,6 @@ export function useSuggestedAutomations(): SuggestedAutomation[] { }, { operation: "ocr", - displayName: t("automation.operation.ocrCleanup", "OCR & Cleanup"), parameters: { languages: ['eng'], ocrType: 'skip-text', @@ -45,7 +43,6 @@ export function useSuggestedAutomations(): SuggestedAutomation[] { }, { operation: "convert", - displayName: t("automation.operation.pdfaConversion", "PDF/A Conversion"), parameters: { fromExtension: 'pdf', toExtension: 'pdfa', @@ -56,7 +53,6 @@ export function useSuggestedAutomations(): SuggestedAutomation[] { }, { operation: "compress", - displayName: t("automation.operation.compress", "Compress"), parameters: { compressionLevel: 5, grayscale: false, @@ -78,7 +74,6 @@ export function useSuggestedAutomations(): SuggestedAutomation[] { operations: [ { operation: "compress", - displayName: t("automation.operation.compress", "Compress"), parameters: { compressionLevel: 5, grayscale: false, @@ -90,7 +85,6 @@ export function useSuggestedAutomations(): SuggestedAutomation[] { }, { operation: "splitPdf", - displayName: t("automation.operation.splitBySize", "Split by Size (20MB)"), parameters: { mode: 'bySizeOrCount', pages: '', @@ -106,7 +100,6 @@ export function useSuggestedAutomations(): SuggestedAutomation[] { }, { operation: "sanitize", - displayName: t("automation.operation.sanitizeMetadata", "Remove Metadata"), parameters: { removeJavaScript: false, removeEmbeddedFiles: false, @@ -128,7 +121,6 @@ export function useSuggestedAutomations(): SuggestedAutomation[] { operations: [ { operation: "sanitize", - displayName: t("automation.operation.sanitize", "Sanitize"), parameters: { removeJavaScript: true, removeEmbeddedFiles: true, @@ -140,7 +132,6 @@ export function useSuggestedAutomations(): SuggestedAutomation[] { }, { operation: "addPassword", - displayName: t("automation.operation.addPassword", "Add Password Protection"), parameters: { password: 'password', ownerPassword: '', @@ -169,7 +160,6 @@ export function useSuggestedAutomations(): SuggestedAutomation[] { operations: [ { operation: "convert", - displayName: t("automation.operation.imageToPdf", "Image to PDF"), parameters: { fromExtension: 'image', toExtension: 'pdf', @@ -185,7 +175,6 @@ export function useSuggestedAutomations(): SuggestedAutomation[] { }, { operation: "ocr", - displayName: t("automation.operation.ocr", "OCR Text Extraction"), parameters: { languages: ['eng'], ocrType: 'skip-text', diff --git a/frontend/src/types/automation.ts b/frontend/src/types/automation.ts index 0e05016dc..8d2cb5ae8 100644 --- a/frontend/src/types/automation.ts +++ b/frontend/src/types/automation.ts @@ -5,7 +5,6 @@ export interface AutomationOperation { operation: string; parameters: Record; - displayName?: string; // Custom display name for tooltip } export interface AutomationConfig {