From 22db7bec766186b474edcb08b9466a0d9062952e Mon Sep 17 00:00:00 2001 From: James Brunton Date: Thu, 14 Aug 2025 15:31:53 +0100 Subject: [PATCH] Improve titles, headers and tooltips in Add Password and Change Permissions (#4210) # Description of Changes Improve titles, headers and tooltips in Add Password and Change Permissions --- .../public/locales/en-GB/translation.json | 27 ++++++------ .../public/locales/en-US/translation.json | 21 +++++---- .../addPassword/AddPasswordSettings.test.tsx | 6 +-- .../tools/addPassword/AddPasswordSettings.tsx | 4 +- .../ChangePermissionsSettings.test.tsx | 44 ++++++------------- .../ChangePermissionsSettings.tsx | 4 +- .../tooltips/useAddPasswordPermissionsTips.ts | 17 +++++++ .../components/tooltips/useAddPasswordTips.ts | 4 -- .../tooltips/useChangePermissionsTips.ts | 7 ++- frontend/src/tools/AddPassword.tsx | 7 ++- frontend/src/tools/ChangePermissions.tsx | 4 +- 11 files changed, 72 insertions(+), 73 deletions(-) create mode 100644 frontend/src/components/tooltips/useAddPasswordPermissionsTips.ts diff --git a/frontend/public/locales/en-GB/translation.json b/frontend/public/locales/en-GB/translation.json index 247162df3..89d9fcee1 100644 --- a/frontend/public/locales/en-GB/translation.json +++ b/frontend/public/locales/en-GB/translation.json @@ -72,6 +72,9 @@ "githubSubmit": "GitHub - Submit a ticket", "discordSubmit": "Discord - Submit Support post" }, + "warning": { + "tooltipTitle": "Warning" + }, "delete": "Delete", "username": "Username", "password": "Password", @@ -1786,9 +1789,8 @@ "error": { "failed": "An error occurred while encrypting the PDF." }, + "title": "Passwords & Encryption", "passwords": { - "title": "Passwords", - "stepTitle": "Passwords & Encryption", "completed": "Passwords configured", "user": { "label": "User Password", @@ -1799,13 +1801,9 @@ "placeholder": "Enter owner password" } }, - "permissions": { - "stepTitle": "Document Permissions" - }, "encryption": { - "title": "Encryption", "keyLength": { - "label": "Key Length", + "label": "Encryption Key Length", "40bit": "40-bit (Low)", "128bit": "128-bit (Standard)", "256bit": "256-bit (High)" @@ -1831,20 +1829,19 @@ "bullet2": "128-bit: Standard security, widely supported", "bullet3": "256-bit: Maximum security, requires modern viewers" }, - "restrictions": { - "title": "Document Restrictions", - "text": "These restrictions control what users can do with the PDF. Most effective when combined with an owner password." + "permissions": { + "text": "These permissions control what users can do with the PDF. Most effective when combined with an owner password." } } }, "changePermissions": { "completed": "Permissions changed", "submit": "Change Permissions", + "title": "Document Permissions", "error": { "failed": "An error occurred while changing PDF permissions." }, - "restrictions": { - "title": "Document Restrictions", + "permissions": { "preventAssembly": { "label": "Prevent assembly of document" }, @@ -1878,8 +1875,10 @@ "title": "Change Permissions" }, "description": { - "title": "Description", - "text": "Changes document permissions. Warning: To make these restrictions unchangeable, use the Add Password tool to set an owner password." + "text": "Changes document permissions, allowing/disallowing access to different features in PDF readers." + }, + "warning": { + "text": "To make these permissions unchangeable, use the Add Password tool to set an owner password." } } } diff --git a/frontend/public/locales/en-US/translation.json b/frontend/public/locales/en-US/translation.json index 641acf013..88a5ba133 100644 --- a/frontend/public/locales/en-US/translation.json +++ b/frontend/public/locales/en-US/translation.json @@ -72,6 +72,9 @@ "githubSubmit": "GitHub - Submit a ticket", "discordSubmit": "Discord - Submit Support post" }, + "warning": { + "tooltipTitle": "Warning" + }, "delete": "Delete", "username": "Username", "password": "Password", @@ -1655,9 +1658,8 @@ "stepTitle": "Document Permissions" }, "encryption": { - "title": "Encryption", "keyLength": { - "label": "Key Length", + "label": "Encryption Key Length", "40bit": "40-bit (Low)", "128bit": "128-bit (Standard)", "256bit": "256-bit (High)" @@ -1683,20 +1685,19 @@ "bullet2": "128-bit: Standard security, widely supported", "bullet3": "256-bit: Maximum security, requires modern viewers" }, - "restrictions": { - "title": "Document Restrictions", - "text": "These restrictions control what users can do with the PDF. Most effective when combined with an owner password." + "permissions": { + "text": "These permissions control what users can do with the PDF. Most effective when combined with an owner password." } } }, "changePermissions": { "completed": "Permissions changed", "submit": "Change Permissions", + "title": "Document Permissions", "error": { "failed": "An error occurred while changing PDF permissions." }, - "restrictions": { - "title": "Document Restrictions", + "permissions": { "preventAssembly": { "label": "Prevent assembly of document" }, @@ -1730,8 +1731,10 @@ "title": "Change Permissions" }, "description": { - "title": "Description", - "text": "Changes document permissions. Warning: To make these restrictions unchangeable, use the Add Password tool to set an owner password." + "text": "Changes document permissions, allowing/disallowing access to different features in PDF readers." + }, + "warning": { + "text": "To make these permissions unchangeable, use the Add Password tool to set an owner password." } } } diff --git a/frontend/src/components/tools/addPassword/AddPasswordSettings.test.tsx b/frontend/src/components/tools/addPassword/AddPasswordSettings.test.tsx index ac4b000f2..92373f60d 100644 --- a/frontend/src/components/tools/addPassword/AddPasswordSettings.test.tsx +++ b/frontend/src/components/tools/addPassword/AddPasswordSettings.test.tsx @@ -63,8 +63,8 @@ describe('AddPasswordSettings', () => { ); // Check that main section titles are rendered - expect(screen.getByText('mock-addPassword.passwords.title')).toBeInTheDocument(); - expect(screen.getByText('mock-addPassword.encryption.title')).toBeInTheDocument(); + expect(screen.getByText('mock-addPassword.passwords.user.label')).toBeInTheDocument(); + expect(screen.getByText('mock-addPassword.encryption.keyLength.label')).toBeInTheDocument(); }); test('should call onParameterChange when password fields are modified', () => { @@ -154,8 +154,6 @@ describe('AddPasswordSettings', () => { ); // Verify that translation keys are being called - expect(mockT).toHaveBeenCalledWith('addPassword.passwords.title', 'Passwords'); - expect(mockT).toHaveBeenCalledWith('addPassword.encryption.title', 'Encryption'); expect(mockT).toHaveBeenCalledWith('addPassword.passwords.user.label', 'User Password'); expect(mockT).toHaveBeenCalledWith('addPassword.passwords.owner.label', 'Owner Password'); }); diff --git a/frontend/src/components/tools/addPassword/AddPasswordSettings.tsx b/frontend/src/components/tools/addPassword/AddPasswordSettings.tsx index 6cce5ef0c..96ce6aad5 100644 --- a/frontend/src/components/tools/addPassword/AddPasswordSettings.tsx +++ b/frontend/src/components/tools/addPassword/AddPasswordSettings.tsx @@ -16,7 +16,6 @@ const AddPasswordSettings = ({ parameters, onParameterChange, disabled = false } {/* Password Settings */} - {t('addPassword.passwords.title', 'Passwords')} - {t('addPassword.encryption.title', 'Encryption')}