mirror of
https://github.com/documenso/documenso.git
synced 2025-11-17 02:01:33 +10:00
feat: wip
This commit is contained in:
@ -7,6 +7,7 @@ import { useSession } from 'next-auth/react';
|
|||||||
import { match } from 'ts-pattern';
|
import { match } from 'ts-pattern';
|
||||||
|
|
||||||
import { getFile } from '@documenso/lib/universal/upload/get-file';
|
import { getFile } from '@documenso/lib/universal/upload/get-file';
|
||||||
|
import { formatDocumentsPath } from '@documenso/lib/utils/teams';
|
||||||
import type { Document, Recipient, User } from '@documenso/prisma/client';
|
import type { Document, Recipient, User } from '@documenso/prisma/client';
|
||||||
import { DocumentStatus, SigningStatus } from '@documenso/prisma/client';
|
import { DocumentStatus, SigningStatus } from '@documenso/prisma/client';
|
||||||
import type { DocumentWithData } from '@documenso/prisma/types/document-with-data';
|
import type { DocumentWithData } from '@documenso/prisma/types/document-with-data';
|
||||||
@ -39,8 +40,7 @@ export const DataTableActionButton = ({ row, teamUrl }: DataTableActionButtonPro
|
|||||||
const isComplete = row.status === DocumentStatus.COMPLETED;
|
const isComplete = row.status === DocumentStatus.COMPLETED;
|
||||||
const isSigned = recipient?.signingStatus === SigningStatus.SIGNED;
|
const isSigned = recipient?.signingStatus === SigningStatus.SIGNED;
|
||||||
|
|
||||||
// Todo: Teams - Extract calculation.
|
const documentsPath = formatDocumentsPath(teamUrl);
|
||||||
const documentsPath = teamUrl ? `/t/${teamUrl}/documents` : '/documents';
|
|
||||||
|
|
||||||
const onDownloadClick = async () => {
|
const onDownloadClick = async () => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -18,6 +18,7 @@ import {
|
|||||||
import { useSession } from 'next-auth/react';
|
import { useSession } from 'next-auth/react';
|
||||||
|
|
||||||
import { getFile } from '@documenso/lib/universal/upload/get-file';
|
import { getFile } from '@documenso/lib/universal/upload/get-file';
|
||||||
|
import { formatDocumentsPath } from '@documenso/lib/utils/teams';
|
||||||
import type { Document, Recipient, User } from '@documenso/prisma/client';
|
import type { Document, Recipient, User } from '@documenso/prisma/client';
|
||||||
import { DocumentStatus } from '@documenso/prisma/client';
|
import { DocumentStatus } from '@documenso/prisma/client';
|
||||||
import type { DocumentWithData } from '@documenso/prisma/types/document-with-data';
|
import type { DocumentWithData } from '@documenso/prisma/types/document-with-data';
|
||||||
@ -63,7 +64,7 @@ export const DataTableActionDropdown = ({ row, teamUrl }: DataTableActionDropdow
|
|||||||
// const isSigned = recipient?.signingStatus === SigningStatus.SIGNED;
|
// const isSigned = recipient?.signingStatus === SigningStatus.SIGNED;
|
||||||
const isDocumentDeletable = isOwner;
|
const isDocumentDeletable = isOwner;
|
||||||
|
|
||||||
const documentsPath = teamUrl ? `/t/${teamUrl}/documents` : '/documents';
|
const documentsPath = formatDocumentsPath(teamUrl);
|
||||||
|
|
||||||
const onDownloadClick = async () => {
|
const onDownloadClick = async () => {
|
||||||
let document: DocumentWithData | null = null;
|
let document: DocumentWithData | null = null;
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { useRouter } from 'next/navigation';
|
import { useRouter } from 'next/navigation';
|
||||||
|
|
||||||
|
import { formatDocumentsPath } from '@documenso/lib/utils/teams';
|
||||||
import { trpc as trpcReact } from '@documenso/trpc/react';
|
import { trpc as trpcReact } from '@documenso/trpc/react';
|
||||||
import { Button } from '@documenso/ui/primitives/button';
|
import { Button } from '@documenso/ui/primitives/button';
|
||||||
import {
|
import {
|
||||||
@ -39,7 +40,7 @@ export const DuplicateDocumentDialog = ({
|
|||||||
}
|
}
|
||||||
: undefined;
|
: undefined;
|
||||||
|
|
||||||
const documentsPath = teamUrl ? `/t/${teamUrl}/documents` : '/documents';
|
const documentsPath = formatDocumentsPath(teamUrl);
|
||||||
|
|
||||||
const { mutateAsync: duplicateDocument, isLoading: isDuplicateLoading } =
|
const { mutateAsync: duplicateDocument, isLoading: isDuplicateLoading } =
|
||||||
trpcReact.document.duplicateDocument.useMutation({
|
trpcReact.document.duplicateDocument.useMutation({
|
||||||
|
|||||||
@ -38,7 +38,6 @@ export const MobileNav = ({ className, ...props }: MobileNavProps) => {
|
|||||||
</Button>
|
</Button>
|
||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
{/* Todo: Teams */}
|
|
||||||
<Link href="/settings/teams">
|
<Link href="/settings/teams">
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
|
|||||||
@ -126,10 +126,9 @@ export default function TeamBillingInvoicesDataTable({
|
|||||||
rows: 3,
|
rows: 3,
|
||||||
component: (
|
component: (
|
||||||
<>
|
<>
|
||||||
{/* Todo: Teams */}
|
|
||||||
<TableCell className="w-1/3 py-4 pr-4">
|
<TableCell className="w-1/3 py-4 pr-4">
|
||||||
<div className="flex w-full flex-row items-center">
|
<div className="flex w-full flex-row items-center">
|
||||||
<Skeleton className="h-12 w-12 flex-shrink-0 rounded-full" />
|
<Skeleton className="h-7 w-7 flex-shrink-0 rounded" />
|
||||||
|
|
||||||
<div className="ml-2 flex flex-grow flex-col">
|
<div className="ml-2 flex flex-grow flex-col">
|
||||||
<Skeleton className="h-4 w-1/2 max-w-[8rem]" />
|
<Skeleton className="h-4 w-1/2 max-w-[8rem]" />
|
||||||
|
|||||||
@ -38,7 +38,6 @@ export const findTeamMemberInvites = async ({
|
|||||||
userId,
|
userId,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// Todo: Teams - Should only certain roles be able to find members?
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -1,9 +1,10 @@
|
|||||||
import { P, match } from 'ts-pattern';
|
import { P, match } from 'ts-pattern';
|
||||||
|
|
||||||
import { prisma } from '@documenso/prisma';
|
import { prisma } from '@documenso/prisma';
|
||||||
import { Prisma, TeamMember } from '@documenso/prisma/client';
|
import type { TeamMember } from '@documenso/prisma/client';
|
||||||
|
import { Prisma } from '@documenso/prisma/client';
|
||||||
|
|
||||||
import { FindResultSet } from '../../types/find-result-set';
|
import type { FindResultSet } from '../../types/find-result-set';
|
||||||
|
|
||||||
export interface FindTeamMembersOptions {
|
export interface FindTeamMembersOptions {
|
||||||
userId: number;
|
userId: number;
|
||||||
@ -37,7 +38,6 @@ export const findTeamMembers = async ({
|
|||||||
userId,
|
userId,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// Todo: Teams - Should only certain roles be able to find members?
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -53,8 +53,6 @@ export const transferTeamOwnership = async ({ token }: TransferTeamOwnershipOpti
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Todo: Teams - Add billing message in email indicating that billing will be passed on when transferring a team.
|
|
||||||
|
|
||||||
await tx.team.update({
|
await tx.team.update({
|
||||||
where: {
|
where: {
|
||||||
id: team.id,
|
id: team.id,
|
||||||
|
|||||||
@ -5,3 +5,7 @@ export const formatTeamUrl = (teamUrl: string, baseUrl?: string) => {
|
|||||||
|
|
||||||
return `${formattedBaseUrl}/t/${teamUrl}`;
|
return `${formattedBaseUrl}/t/${teamUrl}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const formatDocumentsPath = (teamUrl?: string) => {
|
||||||
|
return teamUrl ? `/t/${teamUrl}/documents` : '/documents';
|
||||||
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user