Skip to content

FileInvite: Number of major Issues with Form viewer #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: fileInvite
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 35 additions & 3 deletions app/components/PDFViewer/signingDemo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ const SignDemo: React.FC<{ allUsers: User[]; user: User }> = ({ allUsers, user }
}).then(async function (inst: any) {
trackInst = inst;
setInstance(inst);

// **** Getting Digital Signature Info ****
const info = await inst.getSignaturesInfo();
if(info.status === "valid" || info.status === "warning") digitallySigned = info;
Expand All @@ -196,10 +196,42 @@ const SignDemo: React.FC<{ allUsers: User[]; user: User }> = ({ allUsers, user }
};

// **** Handling Add Signature / Initial UI ****
// START - FILEINVITE CONSOLE LOGS
inst.addEventListener('document.saveStateChange', async (event: any) => {
if (event.hasUnsavedChanges && inst) {
console.log({
test: 'document.saveStateChange',
changes: event.hasUnsavedChanges,
});
}
});

inst.addEventListener("formFieldValues.update", (formFields: any) => {
if (formFields) {
const fields = formFields
.map((formField: any) => {
if (formField) {
return {
name: formField.name,
value: formField['value']
};
}

return formField;
})
.toArray();

console.log({
test: 'formFieldValues.update',
updatedFormFields: fields
});
}
});
// END - FILEINVITE CONSOLE LOGS

// Track which signature form field was clicked on
// and wether it was an initial field or not.
inst.addEventListener("annotations.press",
inst.addEventListener("annotations.press",
(event: any) => {
let lastFormFieldClicked = event.annotation;

Expand Down Expand Up @@ -368,4 +400,4 @@ const SignDemo: React.FC<{ allUsers: User[]; user: User }> = ({ allUsers, user }
);
};

export default dynamic(() => Promise.resolve(SignDemo), { ssr: false });
export default dynamic(() => Promise.resolve(SignDemo), { ssr: false });