Skip to content

ssr and loading states#181

Merged
Marfuen merged 1 commit into
mainfrom
mariano/cleanup
Mar 26, 2025
Merged

ssr and loading states#181
Marfuen merged 1 commit into
mainfrom
mariano/cleanup

Conversation

@Marfuen
Copy link
Copy Markdown
Contributor

@Marfuen Marfuen commented Mar 26, 2025

Summary by CodeRabbit

  • New Features

    • Introduced an enriched compliance dashboard with interactive progress indicators and detailed framework statuses.
    • Added new loading animations to enhance the user experience during data fetching.
  • Refactor

    • Consolidated and relocated compliance components into a unified overview section for streamlined navigation.
    • Updated redirection and menu links to guide users directly to the dedicated overview page.

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 26, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
app 🔄 Building (Inspect) Visit Preview 💬 Add feedback Mar 26, 2025 3:19pm
comp-portal ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 26, 2025 3:19pm

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 26, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The changes reorganize the compliance and framework overview functionality. Several components, hooks, and layouts in the "home" directory have been removed and replaced with new implementations under the "overview" section. New components include updated progress displays, status charts, loading states, and layouts. Data fetching is now handled by new async functions for compliance scores, framework categories, and frameworks. Additionally, the redirection logic and routing have been adjusted to reflect the new overview paths, and minor formatting improvements were applied in the database seed file.

Changes

File(s) Change Summary
apps/app/src/app/[locale]/.../(home)/components/FrameworkProgress.tsx
apps/app/src/app/[locale]/.../(home)/components/RequirementStatusChart.tsx
Removed legacy components for compliance progress and status display.
apps/app/src/app/[locale]/.../(home)/layout.tsx Removed the home layout component that rendered secondary menus and children.
apps/app/src/app/[locale]/.../frameworks/[frameworkId]/hooks/useOrganizationCategories.ts
apps/app/src/app/[locale]/.../frameworks/[frameworkId]/hooks/useOrganizationFramework.ts
apps/app/src/hooks/use-compliance-scores.ts
Removed custom hooks for fetching organization and compliance data.
apps/app/src/app/[locale]/.../overview/components/FrameworkProgress.tsx
apps/app/src/app/[locale]/.../overview/components/RequirementStatusChart.tsx
apps/app/src/app/[locale]/.../overview/components/types.ts
Added new overview components for compliance display with associated TypeScript interfaces.
apps/app/src/app/[locale]/.../overview/data/getComplianceScores.ts
apps/app/src/app/[locale]/.../overview/data/getFrameworkCategories.ts
apps/app/src/app/[locale]/.../overview/data/getFrameworks.ts
Introduced new asynchronous functions to fetch compliance scores, framework categories, and frameworks.
apps/app/src/app/[locale]/.../overview/layout.tsx
apps/app/src/app/[locale]/.../overview/page.tsx
apps/app/src/app/[locale]/page.tsx
apps/app/src/components/main-menu.tsx
Updated layout and page components to include the organization ID, adjust redirection logic, and use the dedicated overview routes.
apps/app/src/app/[locale]/.../overview/loading.tsx
apps/app/src/app/[locale]/.../overview/frameworks/controls/[id]/loading.tsx
Added new loading state components for the overview and control details.
packages/db/prisma/seed.js Reformatted code for improved readability without altering the seeding logic.

Sequence Diagram(s)

sequenceDiagram
  participant U as User
  participant DP as DashboardPage
  participant GS as getComplianceScores
  participant GC as getComplianceCategories
  participant FO as FrameworksOverview
  participant DB as Database

  U->>DP: Request overview (locale, orgId)
  DP->>GS: Fetch compliance scores
  GS->>DB: Query compliance data
  DB-->>GS: Return compliance scores
  DP->>GC: Fetch framework categories
  GC->>DB: Query category data
  DB-->>GC: Return framework categories
  DP->>FO: Render overview with frameworks, complianceScores, frameworksWithCompliance
  FO-->>U: Display updated compliance data
Loading
sequenceDiagram
  participant U as User
  participant L as Layout
  participant Auth as auth
  participant I18n as getI18n
  participant SM as SecondaryMenu
  participant R as Redirect

  U->>L: Navigate to overview page
  L->>Auth: Request user session
  L->>I18n: Retrieve localization strings
  Auth-->>L: Return session (with orgId)
  alt Valid orgId
    L->>SM: Render secondary menu with overview link
    L->>Main: Render child components
    L-->>U: Display overview layout
  else Missing orgId
    L->>R: Trigger redirection to authentication
  end
Loading

Poem

I'm a bunny with a happy leap,
Watching old code quietly sleep.
New paths and hooks in overview reside,
With loading carrots on every side.
I hop along these changes bright—
A joyful dance in code's delight!
🐇🌸


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 324cd37 and dcaed71.

📒 Files selected for processing (22)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/(home)/components/FrameworkProgress.tsx (0 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/(home)/components/RequirementStatusChart.tsx (0 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/(home)/layout.tsx (0 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/(home)/overview/frameworks/[frameworkId]/hooks/useOrganizationCategories.ts (0 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/(home)/overview/frameworks/[frameworkId]/hooks/useOrganizationFramework.ts (0 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/layout.tsx (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/overview/components/FrameworkProgress.tsx (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/overview/components/FrameworksOverview.tsx (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/overview/components/RequirementStatusChart.tsx (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/overview/components/types.ts (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/overview/data/getComplianceScores.ts (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/overview/data/getFrameworkCategories.ts (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/overview/data/getFrameworks.ts (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/overview/frameworks/[frameworkId]/loading.tsx (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/overview/frameworks/controls/[id]/loading.tsx (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/overview/layout.tsx (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/overview/loading.tsx (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/overview/page.tsx (2 hunks)
  • apps/app/src/app/[locale]/page.tsx (1 hunks)
  • apps/app/src/components/main-menu.tsx (1 hunks)
  • apps/app/src/hooks/use-compliance-scores.ts (0 hunks)
  • packages/db/prisma/seed.js (2 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration 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 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant