From 9cc8bbdfc386e2253e5059c1d3fe2e9f694d5baf Mon Sep 17 00:00:00 2001 From: Tawagot0 <26726263+Tawagot0@users.noreply.github.com> Date: Sat, 20 Jan 2024 17:45:59 +0100 Subject: [PATCH 01/10] fix: docker compose variable --- docker/compose.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker/compose.yml b/docker/compose.yml index 9d4f0e951..a48702bf9 100644 --- a/docker/compose.yml +++ b/docker/compose.yml @@ -23,7 +23,8 @@ services: - database - inbucket environment: - - DATABASE_URL=postgres://documenso:password@database:5432/documenso + - NEXT_PRIVATE_DATABASE_URL=postgres://documenso:password@database:5432/documenso + - NEXT_PRIVATE_DIRECT_DATABASE_URL=postgres://documenso:password@database:5432/documenso - NEXT_PUBLIC_WEBAPP_URL=http://localhost:3000 - NEXTAUTH_SECRET=my-super-secure-secret - NEXTAUTH_URL=http://localhost:3000 From 4909eee40153803a1b7afa3cb9ee2c5e544a9af6 Mon Sep 17 00:00:00 2001 From: Mythie Date: Mon, 22 Jan 2024 21:36:46 +1100 Subject: [PATCH 02/10] feat: add viewing on completed page for pending documents --- .../complete/document-preview-button.tsx | 39 +++++++++++++++++++ .../sign/[token]/complete/layout.tsx | 17 ++++++++ .../(signing)/sign/[token]/complete/page.tsx | 22 ++++++++--- .../components/document/document-dialog.tsx | 2 +- 4 files changed, 73 insertions(+), 7 deletions(-) create mode 100644 apps/web/src/app/(signing)/sign/[token]/complete/document-preview-button.tsx create mode 100644 apps/web/src/app/(signing)/sign/[token]/complete/layout.tsx diff --git a/apps/web/src/app/(signing)/sign/[token]/complete/document-preview-button.tsx b/apps/web/src/app/(signing)/sign/[token]/complete/document-preview-button.tsx new file mode 100644 index 000000000..1ac50f1c0 --- /dev/null +++ b/apps/web/src/app/(signing)/sign/[token]/complete/document-preview-button.tsx @@ -0,0 +1,39 @@ +'use client'; + +import { useState } from 'react'; + +import { FileSearch } from 'lucide-react'; + +import type { DocumentData } from '@documenso/prisma/client'; +import DocumentDialog from '@documenso/ui/components/document/document-dialog'; +import type { ButtonProps } from '@documenso/ui/primitives/button'; +import { Button } from '@documenso/ui/primitives/button'; + +export type DocumentPreviewButtonProps = { + className?: string; + documentData: DocumentData; +} & ButtonProps; + +export const DocumentPreviewButton = ({ + className, + documentData, + ...props +}: DocumentPreviewButtonProps) => { + const [showDialog, setShowDialog] = useState(false); + + return ( + <> + + + + + ); +}; diff --git a/apps/web/src/app/(signing)/sign/[token]/complete/layout.tsx b/apps/web/src/app/(signing)/sign/[token]/complete/layout.tsx new file mode 100644 index 000000000..d3d1c15c3 --- /dev/null +++ b/apps/web/src/app/(signing)/sign/[token]/complete/layout.tsx @@ -0,0 +1,17 @@ +import React from 'react'; + +import { RefreshOnFocus } from '~/components/(dashboard)/refresh-on-focus/refresh-on-focus'; + +export type SigningLayoutProps = { + children: React.ReactNode; +}; + +export default function SigningLayout({ children }: SigningLayoutProps) { + return ( +
+ {children} + + +
+ ); +} diff --git a/apps/web/src/app/(signing)/sign/[token]/complete/page.tsx b/apps/web/src/app/(signing)/sign/[token]/complete/page.tsx index 4b1aed265..ab73755ab 100644 --- a/apps/web/src/app/(signing)/sign/[token]/complete/page.tsx +++ b/apps/web/src/app/(signing)/sign/[token]/complete/page.tsx @@ -17,6 +17,8 @@ import { SigningCard3D } from '@documenso/ui/components/signing-card'; import { truncateTitle } from '~/helpers/truncate-title'; +import { DocumentPreviewButton } from './document-preview-button'; + export type CompletedSigningPageProps = { params: { token?: string; @@ -117,12 +119,20 @@ export default async function CompletedSigningPage({
- + {document.status === DocumentStatus.COMPLETED ? ( + + ) : ( + + )}
{isLoggedIn ? ( diff --git a/packages/ui/components/document/document-dialog.tsx b/packages/ui/components/document/document-dialog.tsx index 6099fecff..2693638fb 100644 --- a/packages/ui/components/document/document-dialog.tsx +++ b/packages/ui/components/document/document-dialog.tsx @@ -5,7 +5,7 @@ import { useState } from 'react'; import * as DialogPrimitive from '@radix-ui/react-dialog'; import { X } from 'lucide-react'; -import { DocumentData } from '@documenso/prisma/client'; +import type { DocumentData } from '@documenso/prisma/client'; import { cn } from '../../lib/utils'; import { Dialog, DialogOverlay, DialogPortal } from '../../primitives/dialog'; From 08011f9545afe29e2ddba18487e0f2a4902710f0 Mon Sep 17 00:00:00 2001 From: Catalin Pit <25515812+catalinpit@users.noreply.github.com> Date: Tue, 23 Jan 2024 02:27:10 +0200 Subject: [PATCH 03/10] chore: added target blank for github link: (#851) --- .../src/components/(dashboard)/layout/profile-dropdown.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/web/src/components/(dashboard)/layout/profile-dropdown.tsx b/apps/web/src/components/(dashboard)/layout/profile-dropdown.tsx index 2dcbb9864..252432b89 100644 --- a/apps/web/src/components/(dashboard)/layout/profile-dropdown.tsx +++ b/apps/web/src/components/(dashboard)/layout/profile-dropdown.tsx @@ -141,7 +141,11 @@ export const ProfileDropdown = ({ user }: ProfileDropdownProps) => { - + Star on Github From e63122a718af30605d924b7228a64b382d6c6046 Mon Sep 17 00:00:00 2001 From: David Nguyen Date: Tue, 23 Jan 2024 11:28:11 +1100 Subject: [PATCH 04/10] chore: update github feature template (#849) --- .github/ISSUE_TEMPLATE/feature-request.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml index ab21e8828..ffb788c23 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.yml +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -33,3 +33,4 @@ body: - label: I have explained the use case or scenario for this feature. - label: I have included any relevant technical details or design suggestions. - label: I understand that this is a suggestion and that there is no guarantee of implementation. + - label: I want to work on creating a PR for this issue if approved From 6aed075c56ee9ef77fa4613d8d395bd23bd7b0de Mon Sep 17 00:00:00 2001 From: Anurag Sharma Date: Tue, 23 Jan 2024 11:38:48 +0530 Subject: [PATCH 05/10] fix: add conditional rendering of OAuth providers (#736) Now google OAuth provider is not rendered if client id is not provided --- .../src/app/(unauthenticated)/signin/page.tsx | 4 +- apps/web/src/components/forms/signin.tsx | 40 +++++++++++-------- packages/lib/constants/auth.ts | 4 ++ 3 files changed, 30 insertions(+), 18 deletions(-) diff --git a/apps/web/src/app/(unauthenticated)/signin/page.tsx b/apps/web/src/app/(unauthenticated)/signin/page.tsx index 0b0333b65..5fda07e70 100644 --- a/apps/web/src/app/(unauthenticated)/signin/page.tsx +++ b/apps/web/src/app/(unauthenticated)/signin/page.tsx @@ -1,5 +1,7 @@ import Link from 'next/link'; +import { IS_GOOGLE_SSO_ENABLED } from '@documenso/lib/constants/auth'; + import { SignInForm } from '~/components/forms/signin'; export default function SignInPage() { @@ -11,7 +13,7 @@ export default function SignInPage() { Welcome back, we are lucky to have you.

- + {process.env.NEXT_PUBLIC_DISABLE_SIGNUP !== 'true' && (

diff --git a/apps/web/src/components/forms/signin.tsx b/apps/web/src/components/forms/signin.tsx index 4e671a569..038f9fe68 100644 --- a/apps/web/src/components/forms/signin.tsx +++ b/apps/web/src/components/forms/signin.tsx @@ -48,9 +48,10 @@ export type TSignInFormSchema = z.infer; export type SignInFormProps = { className?: string; + isGoogleSSOEnabled?: boolean; }; -export const SignInForm = ({ className }: SignInFormProps) => { +export const SignInForm = ({ className, isGoogleSSOEnabled }: SignInFormProps) => { const { toast } = useToast(); const [isTwoFactorAuthenticationDialogOpen, setIsTwoFactorAuthenticationDialogOpen] = useState(false); @@ -203,24 +204,29 @@ export const SignInForm = ({ className }: SignInFormProps) => { {isSubmitting ? 'Signing in...' : 'Sign In'} -

-
- Or continue with -
-
+ {isGoogleSSOEnabled && ( + <> +
+
+ Or continue with +
+
- + + + )} + Date: Tue, 23 Jan 2024 15:54:57 +0100 Subject: [PATCH 06/10] chore: add addi to open page --- apps/marketing/src/app/(marketing)/open/data.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apps/marketing/src/app/(marketing)/open/data.ts b/apps/marketing/src/app/(marketing)/open/data.ts index 3b109ea74..a3f314d9f 100644 --- a/apps/marketing/src/app/(marketing)/open/data.ts +++ b/apps/marketing/src/app/(marketing)/open/data.ts @@ -47,6 +47,14 @@ export const TEAM_MEMBERS = [ engagement: 'Full-Time', joinDate: 'October 9th, 2023', }, + { + name: 'Adithya Krishna', + role: 'Software Engineer - II', + salary: '-', + location: 'India', + engagement: 'Full-Time', + joinDate: 'December 1st, 2023', + }, ]; export const FUNDING_RAISED = [ From 576544344fa3274584f843bbdd432220810bf9ed Mon Sep 17 00:00:00 2001 From: Timur Ercan Date: Tue, 23 Jan 2024 16:20:25 +0100 Subject: [PATCH 07/10] chore: first small step to tracking growth mechanics --- packages/email/template-components/template-footer.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/email/template-components/template-footer.tsx b/packages/email/template-components/template-footer.tsx index 4a9e2c7cf..34cd4047e 100644 --- a/packages/email/template-components/template-footer.tsx +++ b/packages/email/template-components/template-footer.tsx @@ -10,7 +10,7 @@ export const TemplateFooter = ({ isDocument = true }: TemplateFooterProps) => { {isDocument && ( This document was sent using{' '} - + Documenso. From 61967b22c1bbefd3f63f6c7d897472fb793e09d0 Mon Sep 17 00:00:00 2001 From: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com> Date: Wed, 24 Jan 2024 06:04:30 +0530 Subject: [PATCH 08/10] fix: visibility of security fields using identityprovider (#709) fixes #690 --- .../(dashboard)/settings/security/page.tsx | 46 +++++++++++++------ packages/lib/constants/auth.ts | 7 +++ 2 files changed, 38 insertions(+), 15 deletions(-) diff --git a/apps/web/src/app/(dashboard)/settings/security/page.tsx b/apps/web/src/app/(dashboard)/settings/security/page.tsx index 9e99b73e8..ae97e7fb5 100644 --- a/apps/web/src/app/(dashboard)/settings/security/page.tsx +++ b/apps/web/src/app/(dashboard)/settings/security/page.tsx @@ -1,3 +1,4 @@ +import { IDENTITY_PROVIDER_NAME } from '@documenso/lib/constants/auth'; import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-component-session'; import { AuthenticatorApp } from '~/components/forms/2fa/authenticator-app'; @@ -17,28 +18,43 @@ export default async function SecuritySettingsPage() {
- + {user.identityProvider === 'DOCUMENSO' ? ( +
+ -
+
-

Two Factor Authentication

+

Two Factor Authentication

-

- Add and manage your two factor security settings to add an extra layer of security to your - account! -

+

+ Add and manage your two factor security settings to add an extra layer of security to + your account! +

-
-
Two-factor methods
+
+
Two-factor methods
- -
+ +
- {user.twoFactorEnabled && ( -
-
Recovery methods
+ {user.twoFactorEnabled && ( +
+
Recovery methods
- + +
+ )} +
+ ) : ( +
+

+ Your account is managed by {IDENTITY_PROVIDER_NAME[user.identityProvider]} +

+

+ To update your password, enable two-factor authentication, and manage other security + settings, please go to your {IDENTITY_PROVIDER_NAME[user.identityProvider]} account + settings. +

)}
diff --git a/packages/lib/constants/auth.ts b/packages/lib/constants/auth.ts index 9a9652b95..837ca3e3a 100644 --- a/packages/lib/constants/auth.ts +++ b/packages/lib/constants/auth.ts @@ -1,5 +1,12 @@ +import { IdentityProvider } from '@documenso/prisma/client'; + export const SALT_ROUNDS = 12; +export const IDENTITY_PROVIDER_NAME: { [key in IdentityProvider]: string } = { + [IdentityProvider.DOCUMENSO]: 'Documenso', + [IdentityProvider.GOOGLE]: 'Google', +}; + export const IS_GOOGLE_SSO_ENABLED = Boolean( process.env.NEXT_PRIVATE_GOOGLE_CLIENT_ID && process.env.NEXT_PRIVATE_GOOGLE_CLIENT_SECRET, ); From 51d140cf9ae0cebf2323468fc6f2b20e0ecfd4f2 Mon Sep 17 00:00:00 2001 From: Gautam Hegde <85569489+Gautam-Hegde@users.noreply.github.com> Date: Wed, 24 Jan 2024 11:33:57 +0530 Subject: [PATCH 09/10] feat: command group distinction (#854) fixes #836 - Explicit `div` is used instead of `` , since it failed to render borders for dynamic search results, but only works for initial menu. (initial menu) ![cgrp](https://github.com/documenso/documenso/assets/85569489/0ee0aabb-c780-4c03-97e7-cf9905bb9b61) (search results) ![dyanmic](https://github.com/documenso/documenso/assets/85569489/74b0a714-a952-4516-9787-53d50a60b78c) --- apps/web/src/components/(dashboard)/common/command-menu.tsx | 6 +++++- .../components/(dashboard)/layout/verify-email-banner.tsx | 4 ++-- packages/ui/primitives/command.tsx | 6 +++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/apps/web/src/components/(dashboard)/common/command-menu.tsx b/apps/web/src/components/(dashboard)/common/command-menu.tsx index 93f7fa729..0312a96d2 100644 --- a/apps/web/src/components/(dashboard)/common/command-menu.tsx +++ b/apps/web/src/components/(dashboard)/common/command-menu.tsx @@ -252,7 +252,11 @@ const ThemeCommands = ({ setTheme }: { setTheme: (_theme: string) => void }) => ); return THEMES.map((theme) => ( - setTheme(theme.theme)}> + setTheme(theme.theme)} + className="mx-2 first:mt-2 last:mb-2" + > {theme.label} diff --git a/apps/web/src/components/(dashboard)/layout/verify-email-banner.tsx b/apps/web/src/components/(dashboard)/layout/verify-email-banner.tsx index 24e47c186..43eab21c5 100644 --- a/apps/web/src/components/(dashboard)/layout/verify-email-banner.tsx +++ b/apps/web/src/components/(dashboard)/layout/verify-email-banner.tsx @@ -4,7 +4,7 @@ import { useEffect, useState } from 'react'; import { AlertTriangle } from 'lucide-react'; -import { ONE_SECOND } from '@documenso/lib/constants/time'; +import { ONE_DAY, ONE_SECOND } from '@documenso/lib/constants/time'; import { trpc } from '@documenso/trpc/react'; import { Button } from '@documenso/ui/primitives/button'; import { @@ -65,7 +65,7 @@ export const VerifyEmailBanner = ({ email }: VerifyEmailBannerProps) => { if (emailVerificationDialogLastShown) { const lastShownTimestamp = parseInt(emailVerificationDialogLastShown); - if (Date.now() - lastShownTimestamp < 24 * 60 * 60 * 1000) { + if (Date.now() - lastShownTimestamp < ONE_DAY) { return; } } diff --git a/packages/ui/primitives/command.tsx b/packages/ui/primitives/command.tsx index cbc306c66..65f88fc4e 100644 --- a/packages/ui/primitives/command.tsx +++ b/packages/ui/primitives/command.tsx @@ -35,7 +35,7 @@ const CommandDialog = ({ children, commandProps, ...props }: CommandDialogProps) {children} @@ -92,7 +92,7 @@ const CommandGroup = React.forwardRef< Date: Wed, 24 Jan 2024 11:42:33 +0530 Subject: [PATCH 10/10] fix: disabled signing pad when submitting form (#842) fixes : #810 --- apps/web/src/components/forms/profile.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/web/src/components/forms/profile.tsx b/apps/web/src/components/forms/profile.tsx index 0ce5c7f3d..7036f4e43 100644 --- a/apps/web/src/components/forms/profile.tsx +++ b/apps/web/src/components/forms/profile.tsx @@ -112,7 +112,6 @@ export const ProfileForm = ({ className, user }: ProfileFormProps) => {
- { onChange(v ?? '')} />