Compare commits

...

4 Commits

Author SHA1 Message Date
Ephraim Atta-Duncan 5a238d99d8 fix: single signer wording 2025-05-10 21:34:15 +00:00
Lucas Smith 2f48679b0b fix: make lang cookie httpOnly (#1783) 2025-05-08 15:59:43 +10:00
Mythie e40c5d9d24 v1.10.3 2025-05-03 09:23:25 +10:00
Mythie ab323f149f fix: resolve issue with uploading templates 2025-05-03 09:23:17 +10:00
6 changed files with 31 additions and 8 deletions
@@ -1,6 +1,6 @@
import { useLingui } from '@lingui/react';
import { Plural, Trans } from '@lingui/react/macro';
import { DocumentStatus, TeamMemberRole } from '@prisma/client';
import { DocumentStatus, SigningStatus, TeamMemberRole } from '@prisma/client';
import { ChevronLeft, Clock9, Users2 } from 'lucide-react';
import { Link, redirect } from 'react-router';
import { match } from 'ts-pattern';
@@ -111,10 +111,25 @@ export async function loader({ params, request }: Route.LoaderArgs) {
recipients,
};
let isSingleSignerDocument = false;
if (
documentWithRecipients.status === DocumentStatus.PENDING &&
documentWithRecipients.recipients.length === 1
) {
const singleRecipient = documentWithRecipients.recipients[0];
if (
singleRecipient.email === user.email &&
singleRecipient.signingStatus === SigningStatus.SIGNED
) {
isSingleSignerDocument = true;
}
}
return superLoaderJson({
document: documentWithRecipients,
documentRootPath,
fields,
isSingleSignerDocument,
});
}
@@ -124,7 +139,7 @@ export default function DocumentPage() {
const { _ } = useLingui();
const { user } = useSession();
const { document, documentRootPath, fields } = loaderData;
const { document, documentRootPath, fields, isSingleSignerDocument } = loaderData;
const { recipients, documentData, documentMeta } = document;
@@ -237,6 +252,10 @@ export default function DocumentPage() {
<Trans>This document is currently a draft and has not been sent</Trans>
))
.with(DocumentStatus.PENDING, () => {
if (isSingleSignerDocument) {
return <Trans>This document has been signed and is being finalized.</Trans>;
}
const pendingRecipients = recipients.filter(
(recipient) => recipient.signingStatus === 'NOT_SIGNED',
);
@@ -1,6 +1,10 @@
import { createCookie } from 'react-router';
import { env } from '@documenso/lib/utils/env';
export const langCookie = createCookie('lang', {
path: '/',
maxAge: 60 * 60 * 24 * 365 * 2,
httpOnly: true,
secure: env('NODE_ENV') === 'production',
});
+1 -1
View File
@@ -100,5 +100,5 @@
"vite-plugin-babel-macros": "^1.0.6",
"vite-tsconfig-paths": "^5.1.4"
},
"version": "1.10.2"
"version": "1.10.3"
}
+3 -3
View File
@@ -1,12 +1,12 @@
{
"name": "@documenso/root",
"version": "1.10.2",
"version": "1.10.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@documenso/root",
"version": "1.10.2",
"version": "1.10.3",
"workspaces": [
"apps/*",
"packages/*"
@@ -95,7 +95,7 @@
},
"apps/remix": {
"name": "@documenso/remix",
"version": "1.10.2",
"version": "1.10.3",
"dependencies": {
"@documenso/api": "*",
"@documenso/assets": "*",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"private": true,
"version": "1.10.2",
"version": "1.10.3",
"scripts": {
"build": "turbo run build",
"dev": "turbo run dev --filter=@documenso/remix",
@@ -73,7 +73,7 @@ export const createTemplate = async ({
}
}
if (!team) {
if (teamId && !team) {
throw new AppError(AppErrorCode.NOT_FOUND);
}