SergeWilfried / docu

DocuSign Alternative.
https://notario.progiciel.co/
GNU Affero General Public License v3.0
1 stars 0 forks source link

feat: upstream sync #160

Closed SergeWilfried closed 5 months ago

SergeWilfried commented 5 months ago

Summary by CodeRabbit

vercel[bot] commented 5 months ago

@catalinpit is attempting to deploy a commit to the Serge Wilfried's projects Team on Vercel.

A member of the Team first needs to authorize it.

coderabbitai[bot] commented 5 months ago
Walkthrough ## Walkthrough This update enhances user experience and functionality across various components and modules. Key improvements include refined import statements, added UI elements and props for better layout control, and updated logic for document and template handling. The changes aim to streamline operations, improve code readability, and ensure a smoother interaction flow for end-users. ## Changes | Files | Changes | |-------|---------| | `SIGNING.md`, `.../certificate.p12` | Added instructions for path creation when placing certificates. | | Various `.tsx` and `.ts` files in `apps/marketing/src` | Updated import statements, added eslint-disable comments, and modified class attributes for UI enhancements. | | `.../new-template-dialog.tsx`, `.../complete/page.tsx` | Enhanced dialog components and page layouts for better user interaction. | | `.../desktop-nav.tsx`, `.../header.tsx`, `.../menu-switcher.tsx`, `.../mobile-navigation.tsx` | Refactored navigation components, updated props, and adjusted UI responsiveness. | | `.../document-router/router.ts`, `.../search-documents-with-keyword.ts` | Improved document handling logic and API definitions. | | `.../avatar.tsx`, `.../command.tsx`, `.../dialog.tsx`, `.../add-signers.tsx`, `.../add-template-placeholder-recipients.tsx` | Added new props and functionality to UI components, including session management and user role-based features. | > πŸ°βœ¨πŸ“œ > In the burrows of code, where the digital seeds grow, > A rabbit hopped through, with updates in tow. > With a click and a clack, new features align, > Streamlined and sleek, oh, how they shine! > Cheers to the changes, may they hop far and wide, > In the meadows of software, with pride as our guide. πŸŒΌπŸš€ > πŸ°βœ¨πŸ“œ

Recent Review Details **Configuration used: CodeRabbit UI**
Commits Files that changed from the base of the PR and between 3a6c7dd629aa4be1a884e22d7f3757c3029a9661 and 3d3c53db023a5910792740bb52d575e79e841d9c.
Files selected for processing (30) * SIGNING.md (1 hunks) * apps/marketing/src/api/claim-plan/fetcher.ts (1 hunks) * apps/marketing/src/app/(marketing)/open/bar-metrics.tsx (1 hunks) * apps/marketing/src/app/(marketing)/open/funding-raised.tsx (1 hunks) * apps/marketing/src/app/(marketing)/open/metric-card.tsx (1 hunks) * apps/marketing/src/app/(marketing)/open/salary-bands.tsx (1 hunks) * apps/marketing/src/app/(marketing)/oss-friends/container.tsx (1 hunks) * apps/marketing/src/app/robots.ts (1 hunks) * apps/marketing/src/app/sitemap.ts (1 hunks) * apps/marketing/src/components/(marketing)/hero.tsx (1 hunks) * apps/marketing/src/components/(marketing)/open-build-template-bento.tsx (1 hunks) * apps/marketing/src/components/(marketing)/widget.tsx (2 hunks) * apps/marketing/src/components/form/form-error-message.tsx (1 hunks) * apps/marketing/src/components/ui/background.tsx (1 hunks) * apps/marketing/src/providers/next-theme.tsx (1 hunks) * apps/web/src/app/(dashboard)/templates/new-template-dialog.tsx (6 hunks) * apps/web/src/app/(signing)/sign/[token]/complete/page.tsx (1 hunks) * apps/web/src/components/(dashboard)/common/command-menu.tsx (4 hunks) * apps/web/src/components/(dashboard)/layout/desktop-nav.tsx (4 hunks) * apps/web/src/components/(dashboard)/layout/header.tsx (1 hunks) * apps/web/src/components/(dashboard)/layout/menu-switcher.tsx (2 hunks) * apps/web/src/components/(dashboard)/layout/mobile-navigation.tsx (2 hunks) * packages/api/v1/openapi.ts (1 hunks) * packages/lib/server-only/document/search-documents-with-keyword.ts (2 hunks) * packages/trpc/server/document-router/router.ts (1 hunks) * packages/ui/primitives/avatar.tsx (3 hunks) * packages/ui/primitives/command.tsx (1 hunks) * packages/ui/primitives/dialog.tsx (1 hunks) * packages/ui/primitives/document-flow/add-signers.tsx (7 hunks) * packages/ui/primitives/template-flow/add-template-placeholder-recipients.tsx (7 hunks)
Files skipped from review due to trivial changes (5) * apps/marketing/src/app/(marketing)/open/metric-card.tsx * apps/marketing/src/app/(marketing)/open/salary-bands.tsx * apps/marketing/src/components/ui/background.tsx * packages/trpc/server/document-router/router.ts * packages/ui/primitives/command.tsx
Additional comments not posted (31)
apps/marketing/src/app/robots.ts (1)
`1-1`: The use of `type` in the import statement for `MetadataRoute` is a good practice for TypeScript to ensure that this import is used only for type checking and does not result in any runtime JavaScript output.
apps/marketing/src/providers/next-theme.tsx (1)
`6-6`: The use of `type` in the import statement for `ThemeProviderProps` is a good practice for TypeScript to ensure that this import is used only for type checking and does not result in any runtime JavaScript output.
packages/api/v1/openapi.ts (1)
`5-33`: The enhancements made to the `OpenAPIV1` object, including the addition of security schemes and detailed API information, are well-structured and improve the clarity and functionality of the API interactions. This is a significant improvement in defining the API's behavior and security considerations.
apps/marketing/src/components/form/form-error-message.tsx (1)
`2-2`: The use of `type` in the import statement for `FieldError` is a good practice for TypeScript to ensure that this import is used only for type checking and does not result in any runtime JavaScript output.
apps/marketing/src/app/sitemap.ts (1)
`1-1`: The use of `type` in the import statement for `MetadataRoute` is a good practice for TypeScript to ensure that this import is used only for type checking and does not result in any runtime JavaScript output.
apps/marketing/src/api/claim-plan/fetcher.ts (1)
`1-1`: The use of `type` in the import statement for `TClaimPlanRequestSchema` is a good practice for TypeScript to ensure that this import is used only for type checking and does not result in any runtime JavaScript output.
apps/marketing/src/app/(marketing)/open/bar-metrics.tsx (1)
`58-58`: The use of an eslint-disable comment for `@typescript-eslint/consistent-type-assertions` is justified here to allow the type assertion for `dataKey`. However, it's important to ensure that such overrides are used sparingly and only when absolutely necessary to avoid potential issues with type safety.
apps/marketing/src/app/(marketing)/oss-friends/container.tsx (2)
`5-5`: The use of `type` in the import statement for `Variants` is a good practice for TypeScript to ensure that this import is used only for type checking and does not result in any runtime JavaScript output. --- `12-12`: The use of `type` in the import statement for `TOSSFriendsSchema` is a good practice for TypeScript to ensure that this import is used only for type checking and does not result in any runtime JavaScript output.
apps/marketing/src/app/(marketing)/open/funding-raised.tsx (1)
`16-16`: Consider providing a brief explanation for disabling the ESLint rule to maintain code quality and help future maintainers understand the context.
packages/ui/primitives/avatar.tsx (1)
`66-72`: > :memo: **NOTE** > This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [58-78] LGTM! The addition of `textSectionClassName` provides flexibility in styling the text section of the avatar component.
apps/web/src/components/(dashboard)/layout/mobile-navigation.tsx (1)
`46-52`: > :memo: **NOTE** > This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [49-90] The changes to the `MobileNavigation` component, including the reduced max-width and the added line break, should improve the mobile user experience. Ensure that the new width does not affect the layout negatively on smaller devices.
apps/web/src/components/(dashboard)/layout/desktop-nav.tsx (1)
`21-34`: > :memo: **NOTE** > This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [24-73] Refactoring to directly use `setIsCommandMenuOpen` in the `onClick` handler simplifies the component's state management. Ensure that all instances where `setIsCommandMenuOpen` is used have been updated accordingly.
apps/web/src/components/(dashboard)/layout/header.tsx (1)
`61-61`: Ensure that the `setIsCommandMenuOpen` prop is properly handled in the `DesktopNav` component to avoid any unintended side effects.
apps/marketing/src/components/(marketing)/open-build-template-bento.tsx (1)
`1-1`: Using TypeScript's `type` import syntax for `HTMLAttributes` is a good practice as it makes the imports cleaner and more explicit about what is being used as a type.
packages/ui/primitives/dialog.tsx (1)
`57-85`: Addition of `overlayClassName` prop enhances flexibility for custom styling.
apps/web/src/components/(dashboard)/common/command-menu.tsx (1)
`100-103`: Simplification of `searchResults` logic improves code clarity and maintainability.
apps/web/src/app/(signing)/sign/[token]/complete/page.tsx (1)
`134-134`: Addition of top margin improves spacing and visual layout.
apps/web/src/components/(dashboard)/layout/menu-switcher.tsx (1)
`93-99`: > :memo: **NOTE** > This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [96-105] Adjustments to `Button` and `AvatarWithText` components enhance responsiveness and flexibility.
apps/web/src/app/(dashboard)/templates/new-template-dialog.tsx (1)
`185-241`: > :memo: **NOTE** > This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [21-238] Additions and refactoring in `NewTemplateDialog` enhance structure and maintainability.
apps/marketing/src/components/(marketing)/hero.tsx (1)
`99-99`: Responsive text sizing improves readability on different devices.
packages/ui/primitives/template-flow/add-template-placeholder-recipients.tsx (1)
`160-240`: > :memo: **NOTE** > This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [93-292] Addition of functionality to add oneself as a recipient and updates to role descriptions enhance user experience.
apps/marketing/src/components/(marketing)/widget.tsx (2)
`349-349`: LGTM! The addition of the `truncate` class enhances the UI by preventing text overflow. --- `363-363`: LGTM! The addition of the `truncate` class to the input field helps maintain a clean UI by preventing text overflow.
packages/ui/primitives/document-flow/add-signers.tsx (7)
`8-8`: Ensure that the `useSession` hook is used appropriately and securely, especially in a client-side environment.
Verification successful --- The usage of the `useSession` hook across various files in the project, including `add-signers.tsx`, consistently follows the pattern of destructuring to obtain the `session` data directly from the hook. This pattern does not inherently expose sensitive data as it does not manipulate or display the session data inappropriately. The security of the session data usage primarily depends on how the `session` object is subsequently handled, which is not detailed in the provided outputs. Given the consistent and typical usage pattern of the `useSession` hook observed in the outputs, there are no immediate red flags regarding security concerns in the context of the `add-signers.tsx` file or other similar usages in the project. However, developers should ensure that the session data is handled securely in the application logic that follows the hook's invocation. ### Conclusion The `useSession` hook is used appropriately in the `add-signers.tsx` file in a manner consistent with other parts of the application. There is no evidence from the provided script outputs that suggests improper exposure of sensitive data through the use of this hook.
Scripts Executed The following scripts were executed for the analysis: --- Script: ```shell #!/bin/bash # Verify that the useSession hook is not exposing sensitive data ast-grep --lang typescript --pattern $'useSession() { $$$ }' ``` Length of output: 504 --- --- Script: ```shell #!/bin/bash # Search for all instances where `useSession` is used in TypeScript files rg --type ts "useSession()" ``` Length of output: 3289
--- `64-65`: The session data retrieval and user variable assignment look correct. However, ensure that the session data is handled securely and that there's no risk of exposing sensitive information. --- `141-149`: The `onAddSelfSigner` function correctly uses the session user data to add a signer. Ensure that this function is tested thoroughly, especially the fallback values when user data is not available. --- `226-230`: The logic to disable the email input field based on various conditions (submission status, recipient status, and user email match) is implemented correctly. This prevents users from modifying the email of a signer that matches the session user or has already been sent the document. --- `258-262`: The logic to disable the name input field mirrors that of the email field, ensuring consistency in handling signer information. This is crucial for maintaining data integrity and user experience. --- `488-500`: The "Add myself" button implementation uses the `onAddSelfSigner` function to add the session user as a signer. Ensure that this button is only visible and functional under appropriate conditions, such as when the user is not already a signer.
Verification successful --- The "Add myself" button is conditionally rendered based on whether the user's email is already in the signers list, as shown in the provided code snippet. The button is disabled if `isSubmitting` is true or if any signer in the `signers` list has an email that matches the user's email. This implementation aligns with the requirement that the button should only be functional when the user is not already a signer. Therefore, the implementation of the "Add myself" button as described in the review comment is correct.
Scripts Executed The following scripts were executed for the analysis: --- Script: ```shell #!/bin/bash # Verify that the "Add myself" button is conditionally rendered ast-grep --lang typescript --pattern $'Button { $$$ "Add myself" $$$ }' ``` Length of output: 526 --- --- Script: ```shell #!/bin/bash # Correct the ast-grep pattern to verify the conditional rendering of the "Add myself" button ast-grep --lang typescript --pattern $'Button { $$$ "Add myself" $$$ }' ``` Length of output: 526
--- `503-520`: The implementation of the toggle for showing advanced settings is well-handled, using a checkbox to control the visibility based on the document type and existing settings. This enhances the user interface by allowing users to control the complexity of the form based on their needs.
--- Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Share - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)
Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit .` - `Generate unit testing code for this file.` - `Open a follow-up GitHub issue for this discussion.` - Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples: - `@coderabbitai generate unit testing code for this file.` - `@coderabbitai modularize this function.` - PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples: - `@coderabbitai generate interesting stats about this repository and render them as a table.` - `@coderabbitai show all the console.log statements in this repository.` - `@coderabbitai read src/utils.ts and generate unit testing code.` - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.` Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. ### CodeRabbit Commands (invoked as PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger a review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai help` to get help. Additionally, you can add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### CodeRabbit Configration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information. - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json` ### Documentation and Community - Visit our [Documentation](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit. - Join our [Discord Community](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.