mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-08-26 22:29:24 +00:00
Add tooltip to Remove Password tool
This commit is contained in:
parent
25cc9ec8d3
commit
196b1de21c
@ -1878,6 +1878,9 @@
|
|||||||
"error": {
|
"error": {
|
||||||
"failed": "An error occurred while removing the password from the PDF."
|
"failed": "An error occurred while removing the password from the PDF."
|
||||||
},
|
},
|
||||||
|
"tooltip": {
|
||||||
|
"description": "Removing password protection requires the password that was used to encrypt the PDF. This will decrypt the document, making it accessible without a password."
|
||||||
|
},
|
||||||
"results": {
|
"results": {
|
||||||
"title": "Decrypted PDFs"
|
"title": "Decrypted PDFs"
|
||||||
}
|
}
|
||||||
|
@ -1740,6 +1740,9 @@
|
|||||||
"error": {
|
"error": {
|
||||||
"failed": "An error occurred while removing the password from the PDF."
|
"failed": "An error occurred while removing the password from the PDF."
|
||||||
},
|
},
|
||||||
|
"tooltip": {
|
||||||
|
"description": "Removing password protection requires the password that was used to encrypt the PDF. This will decrypt the document, making it accessible without a password."
|
||||||
|
},
|
||||||
"results": {
|
"results": {
|
||||||
"title": "Decrypted PDFs"
|
"title": "Decrypted PDFs"
|
||||||
}
|
}
|
||||||
|
20
frontend/src/components/tooltips/useRemovePasswordTips.ts
Normal file
20
frontend/src/components/tooltips/useRemovePasswordTips.ts
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { TooltipContent } from '../../types/tips';
|
||||||
|
|
||||||
|
export const useRemovePasswordTips = (): TooltipContent => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
return {
|
||||||
|
header: {
|
||||||
|
title: t("removePassword.title", "Remove Password")
|
||||||
|
},
|
||||||
|
tips: [
|
||||||
|
{
|
||||||
|
description: t(
|
||||||
|
"removePassword.tooltip.description",
|
||||||
|
"Removing password protection requires the current password that was used to encrypt the PDF. This will decrypt the document, making it accessible without a password."
|
||||||
|
)
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
};
|
@ -16,6 +16,7 @@ import RemovePasswordSettings from "../components/tools/removePassword/RemovePas
|
|||||||
|
|
||||||
import { useRemovePasswordParameters } from "../hooks/tools/removePassword/useRemovePasswordParameters";
|
import { useRemovePasswordParameters } from "../hooks/tools/removePassword/useRemovePasswordParameters";
|
||||||
import { useRemovePasswordOperation } from "../hooks/tools/removePassword/useRemovePasswordOperation";
|
import { useRemovePasswordOperation } from "../hooks/tools/removePassword/useRemovePasswordOperation";
|
||||||
|
import { useRemovePasswordTips } from "../components/tooltips/useRemovePasswordTips";
|
||||||
import { BaseToolProps } from "../types/tool";
|
import { BaseToolProps } from "../types/tool";
|
||||||
|
|
||||||
const RemovePassword = ({ onPreviewFile, onComplete, onError }: BaseToolProps) => {
|
const RemovePassword = ({ onPreviewFile, onComplete, onError }: BaseToolProps) => {
|
||||||
@ -25,6 +26,7 @@ const RemovePassword = ({ onPreviewFile, onComplete, onError }: BaseToolProps) =
|
|||||||
|
|
||||||
const removePasswordParams = useRemovePasswordParameters();
|
const removePasswordParams = useRemovePasswordParameters();
|
||||||
const removePasswordOperation = useRemovePasswordOperation();
|
const removePasswordOperation = useRemovePasswordOperation();
|
||||||
|
const removePasswordTips = useRemovePasswordTips();
|
||||||
|
|
||||||
// Endpoint validation
|
// Endpoint validation
|
||||||
const { enabled: endpointEnabled, loading: endpointLoading } = useEndpointEnabled(removePasswordParams.getEndpointName());
|
const { enabled: endpointEnabled, loading: endpointLoading } = useEndpointEnabled(removePasswordParams.getEndpointName());
|
||||||
@ -104,6 +106,7 @@ const RemovePassword = ({ onPreviewFile, onComplete, onError }: BaseToolProps) =
|
|||||||
isCompleted={passwordCollapsed}
|
isCompleted={passwordCollapsed}
|
||||||
onCollapsedClick={hasResults ? handleSettingsReset : undefined}
|
onCollapsedClick={hasResults ? handleSettingsReset : undefined}
|
||||||
completedMessage={passwordCollapsed ? t('removePassword.password.completed', 'Password configured') : undefined}
|
completedMessage={passwordCollapsed ? t('removePassword.password.completed', 'Password configured') : undefined}
|
||||||
|
tooltip={removePasswordTips}
|
||||||
>
|
>
|
||||||
<RemovePasswordSettings
|
<RemovePasswordSettings
|
||||||
parameters={removePasswordParams.parameters}
|
parameters={removePasswordParams.parameters}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user