fix: stacked avatar colors (#1361)

This commit is contained in:
Ephraim Duncan
2024-10-09 01:25:56 +00:00
committed by GitHub
parent a2db5e9642
commit 2c1a18bafc
6 changed files with 74 additions and 32 deletions

View File

@ -1,12 +1,19 @@
import type { Recipient } from '@documenso/prisma/client';
import { ReadStatus, RecipientRole, SendStatus, SigningStatus } from '@documenso/prisma/client';
export enum RecipientStatusType {
COMPLETED = 'completed',
OPENED = 'opened',
WAITING = 'waiting',
UNSIGNED = 'unsigned',
}
export const getRecipientType = (recipient: Recipient) => {
if (
recipient.role === RecipientRole.CC ||
(recipient.sendStatus === SendStatus.SENT && recipient.signingStatus === SigningStatus.SIGNED)
) {
return 'completed';
return RecipientStatusType.COMPLETED;
}
if (
@ -14,12 +21,33 @@ export const getRecipientType = (recipient: Recipient) => {
recipient.readStatus === ReadStatus.OPENED &&
recipient.signingStatus === SigningStatus.NOT_SIGNED
) {
return 'opened';
return RecipientStatusType.OPENED;
}
if (recipient.sendStatus === 'SENT' && recipient.signingStatus === 'NOT_SIGNED') {
return 'waiting';
if (
recipient.sendStatus === SendStatus.SENT &&
recipient.signingStatus === SigningStatus.NOT_SIGNED
) {
return RecipientStatusType.WAITING;
}
return 'unsigned';
return RecipientStatusType.UNSIGNED;
};
export const getExtraRecipientsType = (extraRecipients: Recipient[]) => {
const types = extraRecipients.map((r) => getRecipientType(r));
if (types.includes(RecipientStatusType.UNSIGNED)) {
return RecipientStatusType.UNSIGNED;
}
if (types.includes(RecipientStatusType.OPENED)) {
return RecipientStatusType.OPENED;
}
if (types.includes(RecipientStatusType.WAITING)) {
return RecipientStatusType.WAITING;
}
return RecipientStatusType.COMPLETED;
};

View File

@ -789,7 +789,7 @@ msgstr "Unterzeichnung abschließen"
msgid "Complete Viewing"
msgstr "Betrachten abschließen"
#: apps/web/src/components/(dashboard)/avatar/stack-avatars-with-tooltip.tsx:58
#: apps/web/src/components/(dashboard)/avatar/stack-avatars-with-tooltip.tsx:62
#: apps/web/src/components/formatter/document-status.tsx:28
msgid "Completed"
msgstr "Abgeschlossen"
@ -2143,7 +2143,7 @@ msgstr "Sobald Sie den QR-Code gescannt oder den Code manuell eingegeben haben,
msgid "Oops! Something went wrong."
msgstr "Hoppla! Etwas ist schief gelaufen."
#: apps/web/src/components/(dashboard)/avatar/stack-avatars-with-tooltip.tsx:97
#: apps/web/src/components/(dashboard)/avatar/stack-avatars-with-tooltip.tsx:101
msgid "Opened"
msgstr "Geöffnet"
@ -3636,7 +3636,7 @@ msgstr "Unable to sign in"
msgid "Unauthorized"
msgstr "Unauthorized"
#: apps/web/src/components/(dashboard)/avatar/stack-avatars-with-tooltip.tsx:112
#: apps/web/src/components/(dashboard)/avatar/stack-avatars-with-tooltip.tsx:116
msgid "Uncompleted"
msgstr "Uncompleted"
@ -3848,7 +3848,7 @@ msgstr "Teams ansehen"
msgid "Viewed"
msgstr "Angesehen"
#: apps/web/src/components/(dashboard)/avatar/stack-avatars-with-tooltip.tsx:82
#: apps/web/src/components/(dashboard)/avatar/stack-avatars-with-tooltip.tsx:86
msgid "Waiting"
msgstr "Warten"

View File

@ -784,7 +784,7 @@ msgstr "Complete Signing"
msgid "Complete Viewing"
msgstr "Complete Viewing"
#: apps/web/src/components/(dashboard)/avatar/stack-avatars-with-tooltip.tsx:58
#: apps/web/src/components/(dashboard)/avatar/stack-avatars-with-tooltip.tsx:62
#: apps/web/src/components/formatter/document-status.tsx:28
msgid "Completed"
msgstr "Completed"
@ -2138,7 +2138,7 @@ msgstr "Once you have scanned the QR code or entered the code manually, enter th
msgid "Oops! Something went wrong."
msgstr "Oops! Something went wrong."
#: apps/web/src/components/(dashboard)/avatar/stack-avatars-with-tooltip.tsx:97
#: apps/web/src/components/(dashboard)/avatar/stack-avatars-with-tooltip.tsx:101
msgid "Opened"
msgstr "Opened"
@ -3631,7 +3631,7 @@ msgstr "Unable to sign in"
msgid "Unauthorized"
msgstr "Unauthorized"
#: apps/web/src/components/(dashboard)/avatar/stack-avatars-with-tooltip.tsx:112
#: apps/web/src/components/(dashboard)/avatar/stack-avatars-with-tooltip.tsx:116
msgid "Uncompleted"
msgstr "Uncompleted"
@ -3843,7 +3843,7 @@ msgstr "View teams"
msgid "Viewed"
msgstr "Viewed"
#: apps/web/src/components/(dashboard)/avatar/stack-avatars-with-tooltip.tsx:82
#: apps/web/src/components/(dashboard)/avatar/stack-avatars-with-tooltip.tsx:86
msgid "Waiting"
msgstr "Waiting"

View File

@ -789,7 +789,7 @@ msgstr "Compléter la signature"
msgid "Complete Viewing"
msgstr "Compléter la visualisation"
#: apps/web/src/components/(dashboard)/avatar/stack-avatars-with-tooltip.tsx:58
#: apps/web/src/components/(dashboard)/avatar/stack-avatars-with-tooltip.tsx:62
#: apps/web/src/components/formatter/document-status.tsx:28
msgid "Completed"
msgstr "Complété"
@ -2143,7 +2143,7 @@ msgstr "Une fois que vous avez scanné le code QR ou saisi le code manuellement,
msgid "Oops! Something went wrong."
msgstr "Oups ! Quelque chose a mal tourné."
#: apps/web/src/components/(dashboard)/avatar/stack-avatars-with-tooltip.tsx:97
#: apps/web/src/components/(dashboard)/avatar/stack-avatars-with-tooltip.tsx:101
msgid "Opened"
msgstr "Ouvert"
@ -3636,7 +3636,7 @@ msgstr "Impossible de se connecter"
msgid "Unauthorized"
msgstr "Non autorisé"
#: apps/web/src/components/(dashboard)/avatar/stack-avatars-with-tooltip.tsx:112
#: apps/web/src/components/(dashboard)/avatar/stack-avatars-with-tooltip.tsx:116
msgid "Uncompleted"
msgstr "Non complet"
@ -3848,7 +3848,7 @@ msgstr "Voir les équipes"
msgid "Viewed"
msgstr "Vu"
#: apps/web/src/components/(dashboard)/avatar/stack-avatars-with-tooltip.tsx:82
#: apps/web/src/components/(dashboard)/avatar/stack-avatars-with-tooltip.tsx:86
msgid "Waiting"
msgstr "En attente"