mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-09-08 17:51:20 +02:00
fix signature apperance
This commit is contained in:
parent
070f8b73e5
commit
6a09ec6091
@ -2476,6 +2476,7 @@
|
|||||||
"chooseP12File": "Choose PKCS12 File",
|
"chooseP12File": "Choose PKCS12 File",
|
||||||
"chooseJksFile": "Choose JKS File",
|
"chooseJksFile": "Choose JKS File",
|
||||||
"password": "Certificate Password",
|
"password": "Certificate Password",
|
||||||
|
"passwordOptional": "Leave empty if no password",
|
||||||
"showSignature": "Show visible signature on PDF",
|
"showSignature": "Show visible signature on PDF",
|
||||||
"reason": "Reason for Signing",
|
"reason": "Reason for Signing",
|
||||||
"location": "Location",
|
"location": "Location",
|
||||||
|
@ -64,6 +64,7 @@ const CertificateFilesSettings = ({ parameters, onParameterChange, disabled = fa
|
|||||||
) && (
|
) && (
|
||||||
<TextInput
|
<TextInput
|
||||||
label={t('manageSignatures.signing.password', 'Certificate Password')}
|
label={t('manageSignatures.signing.password', 'Certificate Password')}
|
||||||
|
placeholder={t('manageSignatures.signing.passwordOptional', 'Leave empty if no password')}
|
||||||
type="password"
|
type="password"
|
||||||
value={parameters.password}
|
value={parameters.password}
|
||||||
onChange={(event) => onParameterChange('password', event.currentTarget.value)}
|
onChange={(event) => onParameterChange('password', event.currentTarget.value)}
|
||||||
|
@ -37,8 +37,8 @@ export const useManageSignaturesParameters = (): ManageSignaturesParametersHook
|
|||||||
defaultParameters,
|
defaultParameters,
|
||||||
endpointName: 'manage-signatures',
|
endpointName: 'manage-signatures',
|
||||||
validateFn: (params) => {
|
validateFn: (params) => {
|
||||||
// Requires certificate type and password
|
// Requires certificate type
|
||||||
if (!params.certType || !params.password) {
|
if (!params.certType) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,6 +23,21 @@ const ManageSignatures = (props: BaseToolProps) => {
|
|||||||
const certTypeTips = useCertificateTypeTips();
|
const certTypeTips = useCertificateTypeTips();
|
||||||
const appearanceTips = useSignatureAppearanceTips();
|
const appearanceTips = useSignatureAppearanceTips();
|
||||||
|
|
||||||
|
// Check if certificate files are configured for appearance step
|
||||||
|
const areCertFilesConfigured = () => {
|
||||||
|
const params = base.params.parameters;
|
||||||
|
switch (params.certType) {
|
||||||
|
case 'PEM':
|
||||||
|
return !!(params.privateKeyFile && params.certFile);
|
||||||
|
case 'PKCS12':
|
||||||
|
return !!params.p12File;
|
||||||
|
case 'JKS':
|
||||||
|
return !!params.jksFile;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return createToolFlow({
|
return createToolFlow({
|
||||||
forceStepNumbers: true,
|
forceStepNumbers: true,
|
||||||
files: {
|
files: {
|
||||||
@ -58,8 +73,8 @@ const ManageSignatures = (props: BaseToolProps) => {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t("manageSignatures.appearance.stepTitle", "Signature Appearance"),
|
title: t("manageSignatures.appearance.stepTitle", "Signature Appearance"),
|
||||||
isCollapsed: base.settingsCollapsed,
|
isCollapsed: base.settingsCollapsed || !areCertFilesConfigured(),
|
||||||
onCollapsedClick: base.settingsCollapsed ? base.handleSettingsReset : undefined,
|
onCollapsedClick: (base.settingsCollapsed || !areCertFilesConfigured()) ? base.handleSettingsReset : undefined,
|
||||||
tooltip: appearanceTips,
|
tooltip: appearanceTips,
|
||||||
content: (
|
content: (
|
||||||
<SignatureAppearanceSettings
|
<SignatureAppearanceSettings
|
||||||
|
Loading…
Reference in New Issue
Block a user