mirror of
https://github.com/documenso/documenso.git
synced 2025-11-20 03:32:14 +10:00
Merge branch 'main' into DOC-185-buttons-alignment
This commit is contained in:
@ -16,7 +16,7 @@ import {
|
||||
} from "@heroicons/react/24/outline";
|
||||
import { getUserFromToken } from "@documenso/lib/server";
|
||||
import { getDocument } from "@documenso/lib/query";
|
||||
import { Document as PrismaDocument } from "@prisma/client";
|
||||
import { Document as PrismaDocument, DocumentStatus } from "@prisma/client";
|
||||
import { Breadcrumb, Button, IconButton } from "@documenso/ui";
|
||||
import { Dialog, Transition } from "@headlessui/react";
|
||||
import {
|
||||
@ -96,14 +96,6 @@ const RecipientsPage: NextPageWithLayout = (props: any) => {
|
||||
</h2>
|
||||
</div>
|
||||
<div className="flex flex-shrink-0 mt-4 md:mt-0 md:ml-4">
|
||||
<Button
|
||||
icon={PencilSquareIcon}
|
||||
color="secondary"
|
||||
className="mr-2"
|
||||
href={breadcrumbItems[1].href}
|
||||
>
|
||||
Edit Document
|
||||
</Button>
|
||||
<Button
|
||||
icon={ArrowDownTrayIcon}
|
||||
color="secondary"
|
||||
@ -112,6 +104,19 @@ const RecipientsPage: NextPageWithLayout = (props: any) => {
|
||||
>
|
||||
Download
|
||||
</Button>
|
||||
<Button
|
||||
icon={PencilSquareIcon}
|
||||
disabled={props.document.status === DocumentStatus.COMPLETED}
|
||||
color={
|
||||
props.document.status === DocumentStatus.COMPLETED
|
||||
? "primary"
|
||||
: "secondary"
|
||||
}
|
||||
className="mr-2"
|
||||
href={breadcrumbItems[1].href}
|
||||
>
|
||||
Edit Document
|
||||
</Button>
|
||||
<Button
|
||||
className="min-w-[125px]"
|
||||
color="primary"
|
||||
|
||||
@ -107,7 +107,6 @@ export async function getServerSideProps(context: any) {
|
||||
where: {
|
||||
documentId: recipient.Document.id,
|
||||
recipientId: recipient.id,
|
||||
type: { in: [FieldType.SIGNATURE] },
|
||||
Signature: { is: null },
|
||||
},
|
||||
include: {
|
||||
|
||||
@ -6,7 +6,7 @@ import { Button, IconButton } from "@documenso/ui";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
|
||||
const SignPage: NextPageWithLayout = (props: any) => {
|
||||
const Signed: NextPageWithLayout = (props: any) => {
|
||||
const router = useRouter();
|
||||
const allRecipientsSigned = props.document.Recipient?.every(
|
||||
(r: any) => r.signingStatus === "SIGNED"
|
||||
@ -47,7 +47,12 @@ const SignPage: NextPageWithLayout = (props: any) => {
|
||||
onClick={(event: any) => {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
router.push("/api/documents/" + props.document.id);
|
||||
router.push(
|
||||
"/api/documents/" +
|
||||
props.document.id +
|
||||
"?token=" +
|
||||
props.recipient.token
|
||||
);
|
||||
}}
|
||||
>
|
||||
Download "{props.document.title}"
|
||||
@ -103,8 +108,9 @@ export async function getServerSideProps(context: any) {
|
||||
props: {
|
||||
document: JSON.parse(JSON.stringify(recipient.Document)),
|
||||
fields: JSON.parse(JSON.stringify(fields)),
|
||||
recipient: JSON.parse(JSON.stringify(recipient)),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export default SignPage;
|
||||
export default Signed;
|
||||
|
||||
Reference in New Issue
Block a user