mirror of
https://github.com/documenso/documenso.git
synced 2025-11-14 00:32:43 +10:00
Merge branch 'main' into bugfix/long_filename
This commit is contained in:
@ -4,7 +4,7 @@ import { NEXT_PUBLIC_WEBAPP_URL, classNames } from "@documenso/lib";
|
|||||||
import { createOrUpdateRecipient, deleteRecipient, sendSigningRequests } from "@documenso/lib/api";
|
import { createOrUpdateRecipient, deleteRecipient, sendSigningRequests } from "@documenso/lib/api";
|
||||||
import { getDocument } from "@documenso/lib/query";
|
import { getDocument } from "@documenso/lib/query";
|
||||||
import { getUserFromToken } from "@documenso/lib/server";
|
import { getUserFromToken } from "@documenso/lib/server";
|
||||||
import { Breadcrumb, Button, Dialog, IconButton } from "@documenso/ui";
|
import { Breadcrumb, Button, Dialog, IconButton, Tooltip } from "@documenso/ui";
|
||||||
import Layout from "../../../components/layout";
|
import Layout from "../../../components/layout";
|
||||||
import { NextPageWithLayout } from "../../_app";
|
import { NextPageWithLayout } from "../../_app";
|
||||||
import {
|
import {
|
||||||
@ -264,6 +264,7 @@ const RecipientsPage: NextPageWithLayout = (props: any) => {
|
|||||||
</div>
|
</div>
|
||||||
{props.document.status !== DocumentStatus.COMPLETED && (
|
{props.document.status !== DocumentStatus.COMPLETED && (
|
||||||
<div className="mr-1 flex">
|
<div className="mr-1 flex">
|
||||||
|
<Tooltip label="Resend">
|
||||||
<IconButton
|
<IconButton
|
||||||
icon={PaperAirplaneIcon}
|
icon={PaperAirplaneIcon}
|
||||||
disabled={
|
disabled={
|
||||||
@ -272,30 +273,37 @@ const RecipientsPage: NextPageWithLayout = (props: any) => {
|
|||||||
item.signingStatus === "SIGNED" ||
|
item.signingStatus === "SIGNED" ||
|
||||||
loading
|
loading
|
||||||
}
|
}
|
||||||
color="secondary"
|
onClick={(event: any) => {
|
||||||
className="my-auto mr-4 h-9"
|
event.preventDefault();
|
||||||
onClick={() => {
|
event.stopPropagation();
|
||||||
if (confirm("Resend this signing request?")) {
|
if (confirm("Resend this signing request?")) {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
sendSigningRequests(props.document, [item.id]).finally(() => {
|
sendSigningRequests(props.document, [item.id]).finally(() => {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}}>
|
}}
|
||||||
Resend
|
className="mx-1 group-hover:text-neon-dark group-hover:disabled:text-gray-400"
|
||||||
</IconButton>
|
/>
|
||||||
|
</Tooltip>
|
||||||
|
<Tooltip label="Delete">
|
||||||
<IconButton
|
<IconButton
|
||||||
icon={TrashIcon}
|
icon={TrashIcon}
|
||||||
disabled={!item.id || item.sendStatus === "SENT" || loading}
|
disabled={!item.id || item.sendStatus === "SENT" || loading}
|
||||||
onClick={() => {
|
onClick={(event: any) => {
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
if (confirm("Delete this signing request?")) {
|
||||||
const removedItem = { ...fields }[index];
|
const removedItem = { ...fields }[index];
|
||||||
remove(index);
|
remove(index);
|
||||||
deleteRecipient(item)?.catch((err) => {
|
deleteRecipient(item)?.catch((err) => {
|
||||||
append(removedItem);
|
append(removedItem);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
className="group-hover:text-neon-dark group-hover:disabled:text-gray-400"
|
className="mx-1 group-hover:text-neon-dark group-hover:disabled:text-gray-400"
|
||||||
/>
|
/>
|
||||||
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
34
packages/ui/components/tooltip/Tooltip.tsx
Normal file
34
packages/ui/components/tooltip/Tooltip.tsx
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
import React, { useState } from "react";
|
||||||
|
import { classNames } from "@documenso/lib";
|
||||||
|
|
||||||
|
export function Tooltip(props: any) {
|
||||||
|
let timeout: NodeJS.Timeout;
|
||||||
|
const [active, setActive] = useState(false);
|
||||||
|
|
||||||
|
const showTip = () => {
|
||||||
|
timeout = setTimeout(() => {
|
||||||
|
setActive(true);
|
||||||
|
}, props.delay || 40);
|
||||||
|
};
|
||||||
|
|
||||||
|
const hideTip = () => {
|
||||||
|
clearInterval(timeout);
|
||||||
|
setActive(false);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="relative" onPointerEnter={showTip} onPointerLeave={hideTip}>
|
||||||
|
{props.children}
|
||||||
|
<div
|
||||||
|
className={classNames(
|
||||||
|
"absolute left-1/4 -translate-x-1/2 transform px-4 transition-all delay-50 duration-120",
|
||||||
|
active && "bottom-9 opacity-100",
|
||||||
|
!active && "pointer-events-none bottom-6 opacity-0"
|
||||||
|
)}>
|
||||||
|
<span className="text-neon-800 bg-neon-200 inline-block rounded py-1 px-2 text-xs">
|
||||||
|
{props.label}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
1
packages/ui/components/tooltip/index.ts
Normal file
1
packages/ui/components/tooltip/index.ts
Normal file
@ -0,0 +1 @@
|
|||||||
|
export { Tooltip } from "./Tooltip";
|
||||||
@ -2,3 +2,4 @@ export { Button, IconButton } from "./components/button/index";
|
|||||||
export { SelectBox } from "./components/selectBox/index";
|
export { SelectBox } from "./components/selectBox/index";
|
||||||
export { Breadcrumb } from "./components/breadcrumb/index";
|
export { Breadcrumb } from "./components/breadcrumb/index";
|
||||||
export { Dialog } from "./components/dialog/index";
|
export { Dialog } from "./components/dialog/index";
|
||||||
|
export { Tooltip } from "./components/tooltip/index";
|
||||||
|
|||||||
Reference in New Issue
Block a user