mirror of
https://github.com/documenso/documenso.git
synced 2025-11-12 15:53:02 +10:00
feat: stack recipients avatars on dashboard
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import { prisma } from '@documenso/prisma';
|
||||
import { Document, DocumentStatus, Prisma } from '@documenso/prisma/client';
|
||||
import { Document, DocumentStatus, Prisma, Recipient } from '@documenso/prisma/client';
|
||||
|
||||
import { FindResultSet } from '../../types/find-result-set';
|
||||
|
||||
@ -15,6 +15,10 @@ export interface FindDocumentsOptions {
|
||||
};
|
||||
}
|
||||
|
||||
export type DocumentWithReciepient = Document & {
|
||||
Recipient: Recipient[];
|
||||
};
|
||||
|
||||
export const findDocuments = async ({
|
||||
userId,
|
||||
term,
|
||||
@ -22,7 +26,7 @@ export const findDocuments = async ({
|
||||
page = 1,
|
||||
perPage = 10,
|
||||
orderBy,
|
||||
}: FindDocumentsOptions): Promise<FindResultSet<Document>> => {
|
||||
}: FindDocumentsOptions): Promise<FindResultSet<DocumentWithReciepient>> => {
|
||||
const orderByColumn = orderBy?.column ?? 'created';
|
||||
const orderByDirection = orderBy?.direction ?? 'desc';
|
||||
|
||||
@ -48,6 +52,9 @@ export const findDocuments = async ({
|
||||
orderBy: {
|
||||
[orderByColumn]: orderByDirection,
|
||||
},
|
||||
include: {
|
||||
Recipient: true,
|
||||
},
|
||||
}),
|
||||
prisma.document.count({
|
||||
where: {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
provider = "prisma-client-js"
|
||||
previewFeatures = ["extendedWhereUnique"]
|
||||
}
|
||||
|
||||
@ -143,10 +143,10 @@ model Field {
|
||||
recipientId Int?
|
||||
type FieldType
|
||||
page Int
|
||||
positionX Decimal @default(0)
|
||||
positionY Decimal @default(0)
|
||||
width Decimal @default(-1)
|
||||
height Decimal @default(-1)
|
||||
positionX Decimal @default(0)
|
||||
positionY Decimal @default(0)
|
||||
width Decimal @default(-1)
|
||||
height Decimal @default(-1)
|
||||
customText String
|
||||
inserted Boolean
|
||||
Document Document @relation(fields: [documentId], references: [id], onDelete: Cascade)
|
||||
|
||||
@ -72,6 +72,20 @@ module.exports = {
|
||||
900: '#52514a',
|
||||
950: '#2a2925',
|
||||
},
|
||||
water: {
|
||||
DEFAULT: '#d7e4f3',
|
||||
50: '#f3f6fb',
|
||||
100: '#e3ebf6',
|
||||
200: '#d7e4f3',
|
||||
300: '#abc7e5',
|
||||
400: '#82abd8',
|
||||
500: '#658ecc',
|
||||
600: '#5175bf',
|
||||
700: '#4764ae',
|
||||
800: '#3e538f',
|
||||
900: '#364772',
|
||||
950: '#252d46',
|
||||
},
|
||||
},
|
||||
backgroundImage: {
|
||||
'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))',
|
||||
|
||||
Reference in New Issue
Block a user