chore: revert previous changes

This commit is contained in:
Adithya Krishna
2024-04-29 17:48:00 +05:30
committed by GitHub
parent 917c83fc5f
commit 6b5750c7bf

View File

@ -116,7 +116,6 @@ export const AddSignersFormPartial = ({
const onFormSubmit = form.handleSubmit(onSubmit); const onFormSubmit = form.handleSubmit(onSubmit);
const { const {
append: appendSigner, append: appendSigner,
fields: signers, fields: signers,
@ -125,7 +124,7 @@ export const AddSignersFormPartial = ({
control, control,
name: 'signers', name: 'signers',
}); });
const hasBeenSentToRecipientId = (id?: number) => { const hasBeenSentToRecipientId = (id?: number) => {
if (!id) { if (!id) {
return false; return false;
@ -139,6 +138,16 @@ export const AddSignersFormPartial = ({
); );
}; };
const onAddSelfSigner = () => {
appendSigner({
formId: nanoid(12),
name: user?.name ?? '',
email: user?.email ?? '',
role: RecipientRole.SIGNER,
actionAuth: undefined,
});
};
const onAddSigner = () => { const onAddSigner = () => {
appendSigner({ appendSigner({
formId: nanoid(12), formId: nanoid(12),
@ -165,20 +174,6 @@ export const AddSignersFormPartial = ({
removeSigner(index); removeSigner(index);
}; };
const onAddSelfSigner = () => {
const lastSignerIndex = signers.length - 1;
if(!signers[lastSignerIndex].name || !signers[lastSignerIndex].email){
onRemoveSigner(lastSignerIndex)
}
appendSigner({
formId: nanoid(12),
name: user?.name ?? '',
email: user?.email ?? '',
role: RecipientRole.SIGNER,
actionAuth: undefined,
});
};
const onKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => { const onKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {
if (event.key === 'Enter' && event.target instanceof HTMLInputElement) { if (event.key === 'Enter' && event.target instanceof HTMLInputElement) {
onAddSigner(); onAddSigner();
@ -307,10 +302,10 @@ export const AddSignersFormPartial = ({
global action signing authentication method configured in global action signing authentication method configured in
the "General Settings" step the "General Settings" step
</li> </li>
<li> {/* <li>
<strong>Require account</strong> - The recipient must be <strong>Require account</strong> - The recipient must be
signed in signed in
</li> </li> */}
<li> <li>
<strong>Require passkey</strong> - The recipient must have <strong>Require passkey</strong> - The recipient must have
an account and passkey configured via their settings an account and passkey configured via their settings
@ -331,11 +326,13 @@ export const AddSignersFormPartial = ({
{/* Note: -1 is remapped in the Zod schema to the required value. */} {/* Note: -1 is remapped in the Zod schema to the required value. */}
<SelectItem value="-1">Inherit authentication method</SelectItem> <SelectItem value="-1">Inherit authentication method</SelectItem>
{Object.values(RecipientActionAuth).map((authType) => ( {Object.values(RecipientActionAuth)
<SelectItem key={authType} value={authType}> .filter((auth) => auth !== RecipientActionAuth.ACCOUNT)
{DOCUMENT_AUTH_TYPES[authType].value} .map((authType) => (
</SelectItem> <SelectItem key={authType} value={authType}>
))} {DOCUMENT_AUTH_TYPES[authType].value}
</SelectItem>
))}
</SelectContent> </SelectContent>
</Select> </Select>
</FormControl> </FormControl>