Disable the edit and add signer button for completed documents
This commit is contained in:
@@ -291,6 +291,7 @@ const DocumentsPage: NextPageWithLayout = (props: any) => {
|
|||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
router.push("/documents/" + document.id);
|
router.push("/documents/" + document.id);
|
||||||
}}
|
}}
|
||||||
|
disabled={document.status === "COMPLETED"}
|
||||||
/>
|
/>
|
||||||
<IconButton
|
<IconButton
|
||||||
icon={ArrowDownTrayIcon}
|
icon={ArrowDownTrayIcon}
|
||||||
|
|||||||
@@ -88,10 +88,14 @@ const RecipientsPage: NextPageWithLayout = (props: any) => {
|
|||||||
href={"/api/documents/" + props.document.id}>
|
href={"/api/documents/" + props.document.id}>
|
||||||
Download
|
Download
|
||||||
</Button>
|
</Button>
|
||||||
|
{props.document.status !== DocumentStatus.COMPLETED && (
|
||||||
|
<>
|
||||||
<Button
|
<Button
|
||||||
icon={PencilSquareIcon}
|
icon={PencilSquareIcon}
|
||||||
disabled={props.document.status === DocumentStatus.COMPLETED}
|
disabled={props.document.status === DocumentStatus.COMPLETED}
|
||||||
color={props.document.status === DocumentStatus.COMPLETED ? "primary" : "secondary"}
|
color={
|
||||||
|
props.document.status === DocumentStatus.COMPLETED ? "primary" : "secondary"
|
||||||
|
}
|
||||||
className="mr-2"
|
className="mr-2"
|
||||||
href={breadcrumbItems[1].href}>
|
href={breadcrumbItems[1].href}>
|
||||||
Edit Document
|
Edit Document
|
||||||
@@ -112,6 +116,8 @@ const RecipientsPage: NextPageWithLayout = (props: any) => {
|
|||||||
}>
|
}>
|
||||||
Send
|
Send
|
||||||
</Button>
|
</Button>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="mt-10 overflow-hidden rounded-md bg-white p-4 shadow sm:p-6">
|
<div className="mt-10 overflow-hidden rounded-md bg-white p-4 shadow sm:p-6">
|
||||||
@@ -246,7 +252,7 @@ const RecipientsPage: NextPageWithLayout = (props: any) => {
|
|||||||
<span id="signed_icon">
|
<span id="signed_icon">
|
||||||
<span
|
<span
|
||||||
id="sent_icon"
|
id="sent_icon"
|
||||||
className="mt-3 inline-block flex-shrink-0 rounded-full bg-green-100 px-2 py-0.5 text-xs font-medium text-green-800">
|
className={`mt-3 inline-block flex-shrink-0 rounded-full bg-green-100 px-2 py-0.5 text-xs font-medium text-green-800`}>
|
||||||
<CheckBadgeIcon className="mr-1 inline h-5"></CheckBadgeIcon>
|
<CheckBadgeIcon className="mr-1 inline h-5"></CheckBadgeIcon>
|
||||||
Signed
|
Signed
|
||||||
</span>
|
</span>
|
||||||
@@ -256,6 +262,7 @@ const RecipientsPage: NextPageWithLayout = (props: any) => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{props.document.status !== DocumentStatus.COMPLETED && (
|
||||||
<div className="mr-1 flex">
|
<div className="mr-1 flex">
|
||||||
<IconButton
|
<IconButton
|
||||||
icon={PaperAirplaneIcon}
|
icon={PaperAirplaneIcon}
|
||||||
@@ -290,11 +297,13 @@ const RecipientsPage: NextPageWithLayout = (props: any) => {
|
|||||||
className="group-hover:text-neon-dark group-hover:disabled:text-gray-400"
|
className="group-hover:text-neon-dark group-hover:disabled:text-gray-400"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
|
{props.document.status !== "COMPLETED" && (
|
||||||
<Button
|
<Button
|
||||||
icon={UserPlusIcon}
|
icon={UserPlusIcon}
|
||||||
className="mt-3"
|
className="mt-3"
|
||||||
@@ -310,6 +319,7 @@ const RecipientsPage: NextPageWithLayout = (props: any) => {
|
|||||||
}}>
|
}}>
|
||||||
Add Signer
|
Add Signer
|
||||||
</Button>
|
</Button>
|
||||||
|
)}
|
||||||
</form>
|
</form>
|
||||||
</FormProvider>
|
</FormProvider>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ async function createUser(userData: { email: string; password: string }) {
|
|||||||
async function main() {
|
async function main() {
|
||||||
console.info("Start seeding...");
|
console.info("Start seeding...");
|
||||||
const password = "123456789";
|
const password = "123456789";
|
||||||
const email = "example6@documenso.com";
|
const email = "example@documenso.com";
|
||||||
const user = await createUser({
|
const user = await createUser({
|
||||||
email: email,
|
email: email,
|
||||||
password: await hashPassword(password),
|
password: await hashPassword(password),
|
||||||
|
|||||||
Reference in New Issue
Block a user