diff --git a/src/components/Extension/DocuSignExtension/actions/EmbeddedSigningAction/EmbeddedSigningAction.tsx b/src/components/Extension/DocuSignExtension/actions/EmbeddedSigningAction/EmbeddedSigningAction.tsx index 75d03179..a2887ba6 100644 --- a/src/components/Extension/DocuSignExtension/actions/EmbeddedSigningAction/EmbeddedSigningAction.tsx +++ b/src/components/Extension/DocuSignExtension/actions/EmbeddedSigningAction/EmbeddedSigningAction.tsx @@ -42,16 +42,19 @@ export const EmbeddedSigningAction: FC = ({ */ const decodedSignUrl = he.decode(signUrl) - const finishSigning = useCallback(() => { - onSubmit(activity_id) - }, [activity_id, onSubmit]) + const finishSigning = useCallback( + ({ signed }: { signed: boolean }) => { + onSubmit(activity_id, { signed }) + }, + [activity_id, onSubmit] + ) useEffect(() => { if (isFinished) { setIsIframeLoaded(false) if (event === DocuSignEvent.SIGNING_COMPLETE) { - finishSigning() + finishSigning({ signed: true }) } } }, [event, finishSigning, isFinished]) diff --git a/src/components/Extension/DocuSignExtension/actions/EmbeddedSigningAction/FinishedMessage.tsx b/src/components/Extension/DocuSignExtension/actions/EmbeddedSigningAction/FinishedMessage.tsx index 45fe3211..09990a95 100644 --- a/src/components/Extension/DocuSignExtension/actions/EmbeddedSigningAction/FinishedMessage.tsx +++ b/src/components/Extension/DocuSignExtension/actions/EmbeddedSigningAction/FinishedMessage.tsx @@ -6,7 +6,7 @@ import { LoadingPage } from '../../../../LoadingPage' interface FinishedMessage { event: DocuSignEvent - finishSigning: () => void + finishSigning: (args: { signed: boolean }) => void } export const FinishedMessage: FC = ({ @@ -15,6 +15,10 @@ export const FinishedMessage: FC = ({ }) => { const { t } = useTranslation() + const finishAndFailSigning = () => { + finishSigning({ signed: false }) + } + switch (event) { case DocuSignEvent.SIGNING_COMPLETE: return ( @@ -25,7 +29,9 @@ export const FinishedMessage: FC = ({ <>

{t('activities.docu_sign.expired_sign_document')}

- +
) @@ -34,7 +40,9 @@ export const FinishedMessage: FC = ({ <>

{t('activities.docu_sign.failed_sign_document')}

- +
) diff --git a/src/components/Extension/DocuSignExtension/actions/EmbeddedSigningAction/hooks/useCompleteEmbeddedSigningAction.tsx b/src/components/Extension/DocuSignExtension/actions/EmbeddedSigningAction/hooks/useCompleteEmbeddedSigningAction.tsx index 89697061..315f2d75 100644 --- a/src/components/Extension/DocuSignExtension/actions/EmbeddedSigningAction/hooks/useCompleteEmbeddedSigningAction.tsx +++ b/src/components/Extension/DocuSignExtension/actions/EmbeddedSigningAction/hooks/useCompleteEmbeddedSigningAction.tsx @@ -5,8 +5,8 @@ export const useCompleteEmbeddedSigningAction = () => { const { isSubmitting, onSubmit: _onSubmit } = useCompleteExtensionActivity() const onSubmit = useCallback( - async (activityId: string) => { - const dataPoints: DataPoints = [] + async (activityId: string, { signed }: { signed: boolean }) => { + const dataPoints: DataPoints = [{ key: 'signed', value: String(signed) }] return _onSubmit(activityId, dataPoints) },