Skip to content

Lewis/evidence table changes#258

Merged
carhartlewis merged 6 commits into
mainfrom
lewis/evidence-table-changes
Apr 3, 2025
Merged

Lewis/evidence table changes#258
carhartlewis merged 6 commits into
mainfrom
lewis/evidence-table-changes

Conversation

@carhartlewis
Copy link
Copy Markdown
Contributor

@carhartlewis carhartlewis commented Apr 3, 2025

Summary by CodeRabbit

  • New Features

    • Introduced a refreshed dashboard view that dynamically adjusts navigation based on organization context and leverages asynchronous data fetching for improved responsiveness.
  • Refactor

    • Streamlined the dashboard experience by consolidating and removing outdated components related to layouts, loading states, filtering, and detailed views.
  • Chore

    • Cleaned up obsolete types, constants, and auxiliary components for a leaner codebase.

- Updated migration logic to conditionally create schemas and extensions based on the presence of 'supabase' in the DATABASE_URL.
- This change improves compatibility with different database environments and prevents execution errors.
- Streamlined the migration logic by directly checking the DATABASE_URL for 'supabase' to determine schema and extension creation.
- Removed unnecessary variable declarations and logging, enhancing clarity and maintainability of the migration script.
…table with new data fetching and filtering logic for improved performance and maintainability
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 3, 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 Apr 3, 2025 8:38pm
comp-portal 🔄 Building (Inspect) Visit Preview 💬 Add feedback Apr 3, 2025 8:38pm

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 3, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This pull request removes numerous React components, pages, hooks, constants, and types associated with the evidence dashboard. Significant deletions include layout components, loading states, evidence listing and filtering modules, table subcomponents, and context providers. In addition, a new asynchronous PoliciesPage component with updated metadata generation has been introduced and the EvidenceTable component has been modified to support dynamic routing via the organization ID.

Changes

File(s) Change Summary
apps/app/src/app/[locale]/.../evidence/all/(overview)/layout.tsx,
apps/app/src/app/[locale]/.../evidence/all/(overview)/page.tsx,
apps/app/src/app/[locale]/.../evidence/all/[id]/layout.tsx,
apps/app/src/app/[locale]/.../evidence/all/[id]/page.tsx
Removed layout components and pages (including PolicyDetails, generateMetadata functions, data fetching logic, and internationalization calls) for both evidence overview and detailed views.
apps/app/src/app/[locale]/.../evidence/all/components/EvidenceList.tsx,
apps/app/src/app/[locale]/.../evidence/all/components/EvidenceListUIStates.tsx,
apps/app/src/app/[locale]/.../evidence/all/components/EvidenceSummaryCards.tsx
Removed components that handled evidence listing, UI error/empty states, and summary cards displaying evidence task information.
apps/app/src/app/[locale]/.../evidence/all/components/evidence-table.tsx,
apps/app/src/app/[locale]/.../evidence/all/components/index.ts,
apps/app/src/app/[locale]/.../evidence/all/components/table/**/* (including files: EvidenceFilters/ActiveFilterBadges.tsx, EvidenceFilters/index.ts, EvidenceListColumns.tsx, EvidenceListHeader.tsx, EvidenceListTable.tsx, table/components/AssigneeAvatar.tsx, table/components/filterCategories.tsx, table/components/filterConfigs.tsx, table/index.ts)
Removed or refactored table-related components and exports used for evidence filtering, column definitions, header rendering, row components, and filtering configurations. The EvidenceTable component was also updated to use useParams for dynamic routing (updating the rowClickBasePath).
apps/app/src/app/[locale]/.../evidence/all/hooks/useEvidenceTableContext.tsx Removed the custom hook and context provider managing evidence table state (pagination, filters, search, and loading states).
apps/app/src/app/[locale]/.../evidence/all/loading.tsx Refactored the loading component: updated method signature (renamed to Loading), removed extraneous wrapper, and adjusted properties (columnCount, filterCount, cellWidths, and shrinkZero).
apps/app/src/app/[locale]/.../evidence/all/page.tsx Replaced the previous EvidencePage structure with an asynchronous PoliciesPage component that fetches evidence data (using promises), applies validated filters, and generates page metadata using internationalization functions.
apps/app/src/app/[locale]/.../evidence/all/types.ts,
apps/app/src/app/[locale]/.../evidence/constants.ts
Removed type definitions for EvidenceTaskRow and constant arrays for departments (ALL_DEPARTMENTS) and frequencies (ALL_FREQUENCIES).

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant P as PoliciesPage
    participant VF as ValidFilters Service
    participant GE as Evidence Data Service
    participant ET as EvidenceTable

    U->>P: Navigate to Policies Page
    P->>P: Extract params & parse searchParams
    P->>VF: Validate filters via getValidFilters
    VF-->>P: Return valid filters
    P->>GE: Call getEvidence with searchParams & filters
    GE-->>P: Return evidence data (promise)
    P->>ET: Render EvidenceTable with fetched data
    P->>P: Generate metadata using getI18n & setStaticParamsLocale
Loading

Possibly related PRs

Poem

I'm a hopping rabbit in the codeyard today,
Skipping over components that no longer display.
Layouts and filters vanish without a trace,
Leaving a sleek new flow in their place.
Cheers to clean code and paths that delight—
May our PRs sparkle, so fresh and bright!
🐰💻


📜 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 04809d3 and 5366e2e.

📒 Files selected for processing (24)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/evidence/all/(overview)/layout.tsx (0 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/evidence/all/(overview)/loading.tsx (0 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/evidence/all/(overview)/page.tsx (0 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/evidence/all/[id]/layout.tsx (0 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/evidence/all/[id]/page.tsx (0 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/evidence/all/components/EvidenceList.tsx (0 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/evidence/all/components/EvidenceListUIStates.tsx (0 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/evidence/all/components/EvidenceSummaryCards.tsx (0 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/evidence/all/components/evidence-table.tsx (3 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/evidence/all/components/index.ts (0 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/evidence/all/components/table/EvidenceFilters/ActiveFilterBadges.tsx (0 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/evidence/all/components/table/EvidenceFilters/index.ts (0 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/evidence/all/components/table/EvidenceListColumns.tsx (0 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/evidence/all/components/table/EvidenceListHeader.tsx (0 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/evidence/all/components/table/EvidenceListTable.tsx (0 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/evidence/all/components/table/components/AssigneeAvatar.tsx (0 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/evidence/all/components/table/components/filterCategories.tsx (0 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/evidence/all/components/table/components/filterConfigs.tsx (0 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/evidence/all/components/table/index.ts (0 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/evidence/all/hooks/useEvidenceTableContext.tsx (0 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/evidence/all/loading.tsx (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/evidence/all/page.tsx (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/evidence/all/types.ts (0 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/evidence/constants.ts (0 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