🧹🚧DOC-97 DOC-19

This commit is contained in:
Timur Ercan
2023-02-21 11:19:31 +01:00
parent f3e083e991
commit 2176511ef7
7 changed files with 16 additions and 22 deletions

View File

@ -1,10 +1,7 @@
import { ResizableBox, ResizeCallbackData } from "react-resizable";
import React, { SyntheticEvent, useEffect, useState } from "react";
import React, { useState } from "react";
import Draggable from "react-draggable";
import { CircleStackIcon, TrashIcon } from "@heroicons/react/24/solid";
import Logo from "../logo";
import { IconButton } from "@documenso/ui";
import toast from "react-hot-toast";
import { XCircleIcon } from "@heroicons/react/20/solid";
const stc = require("string-to-color");
@ -20,6 +17,7 @@ type FieldPropsType = {
};
onPositionChanged: any;
onDelete: any;
hidden: boolean;
};
export default function EditableField(props: FieldPropsType) {
@ -52,6 +50,7 @@ export default function EditableField(props: FieldPropsType) {
cancel="strong"
>
<div
hidden={props.hidden}
ref={nodeRef}
className="cursor-move opacity-80 p-2 m-auto w-auto flex-row-reverse text-lg font-bold text-center absolute top-0 left-0 select-none"
style={{

View File

@ -37,7 +37,6 @@ export default function PDFEditor(props: any) {
function onDeleteHandler(id: any) {
const field = fields.find((e) => e.id == id);
const fieldIndex = fields.map((item) => item.id).indexOf(id);
console.log(fieldIndex);
if (fieldIndex > -1) {
const fieldWithoutRemoved = [...fields];
const removedField = fieldWithoutRemoved.splice(fieldIndex, 1);

View File

@ -71,6 +71,7 @@ export default function PDFViewer(props) {
></ReadOnlyField>
) : (
<EditableField
hidden={item.Signature}
key={item.id}
field={item}
className="absolute"

View File

@ -7,18 +7,14 @@ import {
CheckIcon,
DocumentPlusIcon,
EnvelopeIcon,
EyeIcon,
PlusIcon,
SunIcon,
TrashIcon,
} from "@heroicons/react/24/outline";
import Link from "next/link";
import { useRouter } from "next/router";
import { uploadDocument } from "@documenso/features";
import { DocumentStatus } from "@prisma/client";
import { Tooltip as ReactTooltip } from "react-tooltip";
import { getDocumentsForUserFromToken } from "@documenso/lib/query";
import { Button } from "@documenso/ui";
import { Button, IconButton } from "@documenso/ui";
const DocumentsPage: NextPageWithLayout = (props: any) => {
const router = useRouter();
@ -44,7 +40,7 @@ const DocumentsPage: NextPageWithLayout = (props: any) => {
}, []);
function showDocument(documentId: number) {
router.push(`/documents/${documentId}`);
router.push(`/documents/${documentId}/recipients`);
}
return (
@ -227,11 +223,11 @@ const DocumentsPage: NextPageWithLayout = (props: any) => {
</p>
</td>
<td className="relative whitespace-nowrap py-4 pl-3 pr-4 text-right text-sm font-medium sm:pr-6">
<Link href={"/documents/" + document.id}>
<TrashIcon
<div>
<IconButton
icon={TrashIcon}
className="flex-shrink-0 -ml-1 mr-3 h-6 w-6 inline text-neon"
aria-hidden="true"
onClick={(event) => {
onClick={(event: any) => {
event.preventDefault();
event.stopPropagation();
if (
@ -259,9 +255,9 @@ const DocumentsPage: NextPageWithLayout = (props: any) => {
});
}
}}
/>
></IconButton>
<span className="sr-only">, {document.name}</span>
</Link>
</div>
</td>
</tr>
))}

View File

@ -9,7 +9,6 @@ import { DocumentStatus } from "@prisma/client";
import {
InformationCircleIcon,
PaperAirplaneIcon,
UserPlusIcon,
UsersIcon,
} from "@heroicons/react/24/outline";
import { getDocument } from "@documenso/lib/query";
@ -126,7 +125,7 @@ export async function getServerSideProps(context: any) {
return {
props: {
document: document,
document: JSON.parse(JSON.stringify(document)),
},
};
} catch (error) {

View File

@ -69,7 +69,7 @@ const RecipientsPage: NextPageWithLayout = (props: any) => {
className="mr-2"
href={breadcrumbItems[1].href}
>
Customize Document
Edit Document
</Button>
<Button
className="min-w-[125px]"
@ -431,7 +431,7 @@ export async function getServerSideProps(context: any) {
return {
props: {
document: document,
document: JSON.parse(JSON.stringify(document)),
},
};
}

View File

@ -19,7 +19,7 @@ export const getDocument = async (
},
include: {
Recipient: true,
Field: { include: { Recipient: true } },
Field: { include: { Recipient: true, Signature: true } },
},
});