feat: add user conversion count to admin panel
Description
Display the count of users who signed up after signing at least one document in the admin panel
Changes Made
- Created a new function
getSignerConversionto retrieve the count of converted recipients from the database and added a new metric card in the admin stats page to display the count
Checklist
- [x] I have tested these changes locally and they work as expected.
- [ ] I have added/updated tests that prove the effectiveness of these changes.
- [ ] I have updated the documentation to reflect these changes, if applicable.
- [x] I have followed the project's coding style guidelines.
- [ ] I have addressed the code review feedback from the previous submission, if applicable.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| stg-app | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jul 5, 2024 3:57am |
| stg-docs | ❌ Failed (Inspect) | Jul 5, 2024 3:57am | ||
| stg-marketing | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jul 5, 2024 3:57am |
Walkthrough
This update primarily focuses on enhancing the admin dashboard in the web application by refining icon usage and introducing new functionalities for tracking and displaying signer conversion metrics. Specifically, it replaces several icons with more suitable alternatives and introduces new components and functions for visualizing signer conversion data using charts. The backend now includes functions to retrieve and handle this data, ensuring a more data-driven, visually appealing user interface.
Changes
| File/Directory Path | Change Summary |
|---|---|
apps/web/src/app/(dashboard)/admin/nav.tsx |
Replaced User2 icon with Users icon. |
apps/web/src/app/(dashboard)/admin/stats/page.tsx |
Added FileCog, replaced UserPlus2 with UserPlus, added Users icon, and integrated getSignerConversionMonthly for data retrieval and new chart components. |
apps/web/src/app/(dashboard)/admin/stats/signer-conversion-chart.tsx |
Introduced SignerConversionChart component rendering signer conversion data. |
apps/web/src/components/(dashboard)/metric-card/metric-card.tsx |
Updated styling for h3 element by adding mb-2 class. |
packages/lib/server-only/admin/get-recipients-stats.ts |
Enhanced getRecipientsStats function to include signer conversion data from getSignerConversion. |
packages/lib/server-only/user/get-signer-conversion.ts |
Introduced new functions to query overall and monthly signer conversion data using Prisma. |
Poem
In dashboards bright and grand, New icons take their stand. Charts that shine so clear, Conversion data near. With metrics now displayed, Admins won't be swayed. In code, we've found delight, Making the future bright. 🌟🐇
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?
Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
I pushed a fix in commit <commit_id>.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
@coderabbitaiin 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
@coderabbitaiin 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.@coderabbitai help me debug CodeRabbit configuration file.
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 pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto 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.yamlfile to the root of your repository. - Please see the configuration documentation 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 for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.
🚨 @ephraimduncan has 4 pull requests awaiting review. Please consider reviewing them when possible. 🚨
🚨 @ephraimduncan has 4 pull requests awaiting review. Please consider reviewing them when possible. 🚨
Want to take a crack at migrating the queryRaw to Kysely? We should also include something for the conversion query to only include those who received a document within the last 30 days or so which would imply correlation.
@Mythie I took a shot at Kysely. Let me know what you think.