remove naming

This commit is contained in:
Anthony Stirling 2025-08-26 11:05:58 +01:00
parent 1c043b60fb
commit 8c4c44b39f
6 changed files with 53 additions and 74 deletions

View File

@ -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."
}
}
}

View File

@ -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": {

View File

@ -14,8 +14,8 @@ interface AutomationEntryProps {
description?: string;
/** MUI Icon component for the badge */
badgeIcon?: React.ComponentType<any>;
/** 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,13 +53,8 @@ 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 (
<React.Fragment key={`${operationName}-${index}`}>
const toolChain = operations.map((op, index) => (
<React.Fragment key={`${op}-${index}`}>
<Text
component="span"
size="sm"
@ -73,7 +68,7 @@ export default function AutomationEntry({
whiteSpace: 'nowrap'
}}
>
{displayName}
{t(`${op}.title`, op)}
</Text>
{index < operations.length - 1 && (
<Text component="span" size="sm" mx={4}>
@ -81,8 +76,7 @@ export default function AutomationEntry({
</Text>
)}
</React.Fragment>
);
});
));
return (
<div style={{ minWidth: '400px', width: 'auto' }}>
@ -125,15 +119,10 @@ export default function AutomationEntry({
/>
)}
<Group gap="xs" justify="flex-start" style={{ flex: 1 }}>
{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 (
<React.Fragment key={`${operationName}-${index}`}>
{operations.map((op, index) => (
<React.Fragment key={`${op}-${index}`}>
<Text size="xs" style={{ color: 'var(--mantine-color-text)' }}>
{displayName}
{t(`${op}.title`, op)}
</Text>
{index < operations.length - 1 && (
@ -142,8 +131,7 @@ export default function AutomationEntry({
</Text>
)}
</React.Fragment>
);
})}
))}
</Group>
</Group>
);

View File

@ -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)}

View File

@ -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',

View File

@ -5,7 +5,6 @@
export interface AutomationOperation {
operation: string;
parameters: Record<string, any>;
displayName?: string; // Custom display name for tooltip
}
export interface AutomationConfig {