Compare commits

...

8 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
Mythie bf1c1ff9dc v1.10.2 2025-05-03 08:11:27 +10:00
Mythie 516e237966 fix: resolve issue with uploading templates 2025-05-03 08:09:44 +10:00
Mythie ac7d24eb12 v1.10.1 2025-05-03 07:39:19 +10:00
Mythie 0931c472a7 fix: resolve issue with uploading templates 2025-05-03 07:38:48 +10:00
12 changed files with 2622 additions and 147 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.0"
"version": "1.10.3"
}
+3 -3
View File
@@ -1,12 +1,12 @@
{
"name": "@documenso/root",
"version": "1.10.0",
"version": "1.10.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@documenso/root",
"version": "1.10.0",
"version": "1.10.3",
"workspaces": [
"apps/*",
"packages/*"
@@ -95,7 +95,7 @@
},
"apps/remix": {
"name": "@documenso/remix",
"version": "1.10.0",
"version": "1.10.3",
"dependencies": {
"@documenso/api": "*",
"@documenso/assets": "*",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"private": true,
"version": "1.10.0",
"version": "1.10.3",
"scripts": {
"build": "turbo run build",
"dev": "turbo run dev --filter=@documenso/remix",
@@ -44,28 +44,36 @@ export const createTemplate = async ({
}
}
const folder = await prisma.folder.findFirstOrThrow({
where: {
id: folderId,
...(teamId
? {
team: {
id: teamId,
members: {
some: {
userId,
if (folderId) {
const folder = await prisma.folder.findFirst({
where: {
id: folderId,
...(teamId
? {
team: {
id: teamId,
members: {
some: {
userId,
},
},
},
},
}
: {
userId,
teamId: null,
}),
},
});
}
: {
userId,
teamId: null,
}),
},
});
if (!team) {
if (!folder) {
throw new AppError(AppErrorCode.NOT_FOUND, {
message: 'Folder not found',
});
}
}
if (teamId && !team) {
throw new AppError(AppErrorCode.NOT_FOUND);
}
@@ -75,7 +83,7 @@ export const createTemplate = async ({
userId,
templateDocumentDataId,
teamId,
folderId: folder.id,
folderId: folderId,
templateMeta: {
create: {
language: team?.teamGlobalSettings?.documentLanguage,
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff