mirror of
https://github.com/documenso/documenso.git
synced 2025-11-19 11:12:06 +10:00
feat: use existing expiry date if available
This commit is contained in:
@ -84,6 +84,7 @@ export const AddSignersFormPartial = ({
|
|||||||
email: '',
|
email: '',
|
||||||
role: RecipientRole.SIGNER,
|
role: RecipientRole.SIGNER,
|
||||||
signingOrder: 1,
|
signingOrder: 1,
|
||||||
|
expiry: undefined,
|
||||||
actionAuth: undefined,
|
actionAuth: undefined,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
@ -100,6 +101,7 @@ export const AddSignersFormPartial = ({
|
|||||||
name: recipient.name,
|
name: recipient.name,
|
||||||
email: recipient.email,
|
email: recipient.email,
|
||||||
role: recipient.role,
|
role: recipient.role,
|
||||||
|
expiry: recipient.expired ?? undefined,
|
||||||
signingOrder: recipient.signingOrder ?? index + 1,
|
signingOrder: recipient.signingOrder ?? index + 1,
|
||||||
actionAuth:
|
actionAuth:
|
||||||
ZRecipientAuthOptionsSchema.parse(recipient.authOptions)?.actionAuth ?? undefined,
|
ZRecipientAuthOptionsSchema.parse(recipient.authOptions)?.actionAuth ?? undefined,
|
||||||
@ -184,6 +186,7 @@ export const AddSignersFormPartial = ({
|
|||||||
email: '',
|
email: '',
|
||||||
role: RecipientRole.SIGNER,
|
role: RecipientRole.SIGNER,
|
||||||
actionAuth: undefined,
|
actionAuth: undefined,
|
||||||
|
expiry: undefined,
|
||||||
signingOrder: signers.length > 0 ? (signers[signers.length - 1]?.signingOrder ?? 0) + 1 : 1,
|
signingOrder: signers.length > 0 ? (signers[signers.length - 1]?.signingOrder ?? 0) + 1 : 1,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -218,6 +221,7 @@ export const AddSignersFormPartial = ({
|
|||||||
email: user?.email ?? '',
|
email: user?.email ?? '',
|
||||||
role: RecipientRole.SIGNER,
|
role: RecipientRole.SIGNER,
|
||||||
actionAuth: undefined,
|
actionAuth: undefined,
|
||||||
|
expiry: undefined,
|
||||||
signingOrder: signers.length > 0 ? (signers[signers.length - 1]?.signingOrder ?? 0) + 1 : 1,
|
signingOrder: signers.length > 0 ? (signers[signers.length - 1]?.signingOrder ?? 0) + 1 : 1,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -255,6 +259,7 @@ export const AddSignersFormPartial = ({
|
|||||||
'email',
|
'email',
|
||||||
'name',
|
'name',
|
||||||
'role',
|
'role',
|
||||||
|
'expiry',
|
||||||
'signingOrder',
|
'signingOrder',
|
||||||
'actionAuth',
|
'actionAuth',
|
||||||
];
|
];
|
||||||
|
|||||||
@ -15,6 +15,7 @@ export const ZAddSignerSchema = z.object({
|
|||||||
.min(1),
|
.min(1),
|
||||||
name: z.string(),
|
name: z.string(),
|
||||||
role: z.nativeEnum(RecipientRole),
|
role: z.nativeEnum(RecipientRole),
|
||||||
|
expiry: z.date().optional(),
|
||||||
signingOrder: z.number().optional(),
|
signingOrder: z.number().optional(),
|
||||||
actionAuth: ZMapNegativeOneToUndefinedSchema.pipe(ZRecipientActionAuthTypesSchema.optional()),
|
actionAuth: ZMapNegativeOneToUndefinedSchema.pipe(ZRecipientActionAuthTypesSchema.optional()),
|
||||||
});
|
});
|
||||||
|
|||||||
@ -63,6 +63,9 @@ export default function DocumentExpiryDialog({
|
|||||||
|
|
||||||
const form = useForm<z.infer<typeof formSchema>>({
|
const form = useForm<z.infer<typeof formSchema>>({
|
||||||
resolver: zodResolver(formSchema),
|
resolver: zodResolver(formSchema),
|
||||||
|
defaultValues: {
|
||||||
|
expiry: signer.expiry,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const { mutateAsync: setSignerExpiry, isLoading } = trpc.recipient.setSignerExpiry.useMutation({
|
const { mutateAsync: setSignerExpiry, isLoading } = trpc.recipient.setSignerExpiry.useMutation({
|
||||||
|
|||||||
Reference in New Issue
Block a user