feat: add template enhancements (#1154)

## Description

General enhancements for templates.

## Changes Made

Added the following changes to the template flow:
- Allow adding document meta settings
- Allow adding email settings
- Allow adding document access & action authentication
- Allow adding recipient action authentication
- Save the state between template steps similar to how it works for
documents

Other changes:
- Extract common fields between document and template flows
- Remove the title field from "Use template" since we now have it as
part of the template flow
- Add new API endpoint for generating templates

## Testing Performed

Added E2E tests for templates and creating documents from templates
This commit is contained in:
David Nguyen
2024-05-10 19:45:19 +07:00
committed by GitHub
parent 8f9c07aa8e
commit 2f86bb523b
38 changed files with 2103 additions and 510 deletions

View File

@ -102,7 +102,7 @@ export const adminRouter = router({
try {
return await sealDocument({ documentId: id, isResealing: true });
} catch (err) {
console.log('resealDocument error', err);
console.error('resealDocument error', err);
throw new TRPCError({
code: 'BAD_REQUEST',
@ -123,7 +123,7 @@ export const adminRouter = router({
return await deleteUser({ id });
} catch (err) {
console.log(err);
console.error(err);
throw new TRPCError({
code: 'BAD_REQUEST',
@ -144,7 +144,7 @@ export const adminRouter = router({
requestMetadata: extractNextApiRequestMetadata(ctx.req),
});
} catch (err) {
console.log(err);
console.error(err);
throw new TRPCError({
code: 'BAD_REQUEST',