feat: stack recipients avatars on dashboard

This commit is contained in:
Ephraim Atta-Duncan
2023-06-23 12:20:49 +00:00
committed by Mythie
parent 12d8cebd4c
commit 00a15124be
5 changed files with 111 additions and 8 deletions

View File

@@ -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: {

View File

@@ -1,6 +1,6 @@
generator client {
provider = "prisma-client-js"
previewFeatures = ["extendedWhereUnique", "jsonProtocol"]
provider = "prisma-client-js"
previewFeatures = ["extendedWhereUnique"]
}
datasource db {
@@ -144,10 +144,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)

View File

@@ -76,6 +76,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))',