Skip to content

Mariano/cleanup - #131

Merged
Marfuen merged 6 commits into
mainfrom
mariano/cleanup
Mar 13, 2025
Merged

Marfuen merged 6 commits into
mainfrom
mariano/cleanup

Conversation

@Marfuen

@Marfuen Marfuen commented Mar 13, 2025 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Introduced an enhanced compliance status chart that visually displays framework progress and compliance indicators.
    • Added upgraded table components for control requirements with interactive headers and responsive loading states.
    • Improved framework grid functionality with refined toggle behavior for easier selection management.
  • Refactor

    • Streamlined server-side actions and centralized schema validations for more consistent behavior.
    • Revised locale handling and module imports to enhance maintainability and performance.

Marfuen added 6 commits March 13, 2025 14:46
…n and mobile responsiveness. Introduced FrameworkCard subcomponent for better modularization and clarity. Enhanced loading state handling and streamlined control compliance logic.
…roved clarity and maintainability. Streamlined imports to focus on essential dependencies.
@vercel

vercel Bot commented Mar 13, 2025

Copy link
Copy Markdown

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 13, 2025 7:36pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
comp-portal ⬜️ Skipped (Inspect) Mar 13, 2025 7:36pm
web ⬜️ Skipped (Inspect) Mar 13, 2025 7:36pm

@Marfuen
Marfuen merged commit 0f019d8 into main Mar 13, 2025
@coderabbitai

coderabbitai Bot commented Mar 13, 2025 •

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

Walkthrough

The pull request restructures the framework and control management modules by removing outdated files and introducing new ones with updated naming conventions and refactored logic. Changes include shifting server-side actions to new paths, streamlining import paths (from relative to absolute), and updating table components, hooks, and layout files. New components and helper functions enhance data validation, UI rendering, and authentication flows while removing redundant code to simplify the overall codebase structure.

Changes

File(s) Change Summary
apps/app/src/actions/framework/select-frameworks-action.ts
apps/app/src/app/[locale]/(app)/(dashboard)/(home)/actions/selectFrameworksAction.ts
.../actions/getFrameworkCategoriesAction.ts
.../actions/getFrameworksAction.ts
Removed the old server-side framework selection action; updated import paths and formatting in getFramework* actions; introduced a new, comprehensive selectFrameworksAction with Zod validation and sequential operations.
apps/app/src/app/[locale]/(app)/(dashboard)/(home)/components/FrameworksGrid.tsx
apps/app/src/app/[locale]/(app)/(dashboard)/(home)/components/FrameworksOverview.tsx
apps/app/src/app/[locale]/(app)/(dashboard)/(home)/components/RequirementStatusChart.tsx
apps/app/src/components/charts/requirement-status.tsx
Added handleFrameworkToggle in FrameworksGrid; updated import paths and reordering in FrameworksOverview; introduced new RequirementStatusChart component; removed the old RequirementStatus component.
.../overview/frameworks/[frameworkId]/components/FrameworkControls.tsx
.../components/table/FrameworkControlsTable.tsx
.../components/table/FrameworkControlsTableColumns.tsx
.../components/table/FrameworkControlsTableHeader.tsx
.../overview/frameworks/controls/[id]/components/SingleControl.tsx
.../overview/frameworks/controls/[id]/components/SingleControlSkeleton.tsx
.../overview/frameworks/controls/[id]/components/data-table/columns.tsx
.../overview/frameworks/controls/[id]/components/data-table/data-table-header.tsx
.../overview/frameworks/controls/[id]/components/table/ControlRequirementsTable.tsx
.../overview/frameworks/controls/[id]/components/table/ControlRequirementsTableColumns.tsx
.../overview/frameworks/controls/[id]/components/table/ControlRequirementsTableHeader.tsx
Renamed and replaced various table components for framework controls and control requirements; updated imports from DataTable to more specific components; added new table header and column configurations; removed outdated data-table files.
apps/app/src/app/[locale]/(app)/(dashboard)/(home)/hooks/useFrameworks.ts
.../overview/frameworks/[frameworkId]/hooks/useOrganizationFramework.ts
Updated import paths and simplified SWR usage by removing explicit type annotations and return types to streamline fetch logic.
.../overview/frameworks/[frameworkId]/actions/getOrganizationCategories.ts
.../overview/frameworks/[frameworkId]/actions/getOrganizationControlsProgress.ts
.../overview/frameworks/[frameworkId]/actions/getOrganizationFramework.ts
Removed unused type imports; added centralized Zod schema constants for validating inputs in organization framework actions.
apps/app/src/app/[locale]/(app)/(dashboard)/(home)/layout.tsx
.../overview/frameworks/[frameworkId]/page.tsx
.../dashboard/risk/(overview)/layout.tsx
.../dashboard/risk/register/layout.tsx
.../dashboard/vendors/(overview)/layout.tsx
Modified layout files: added authentication check with redirection in home layout; removed redundant auth check in framework overview; commented out menu items for risk and vendors to adjust routing.
apps/app/src/utils/locale.ts Introduced a new utility file with asynchronous functions (setupLocale and getParamsWithLocale) to standardize locale configuration.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant AuthActionClient
    participant SelectFrameworksAction
    participant OrgServices
    participant Validator

    User->>AuthActionClient: Trigger framework selection request
    AuthActionClient->>SelectFrameworksAction: Pass user context and framework IDs
    SelectFrameworksAction->>Validator: Validate input via Zod schema
    Validator-->>SelectFrameworksAction: Return validated data
    SelectFrameworksAction->>OrgServices: Verify organization ID available
    alt Organization ID valid
        SelectFrameworksAction->>OrgServices: Create categories, frameworks, policies, and evidence sequentially
        OrgServices-->>SelectFrameworksAction: Return creation results
    else Organization ID missing
        SelectFrameworksAction-->>User: Return unauthorized error
    end
    SelectFrameworksAction-->>User: Respond with success or failure
Loading

Poem

I'm a happy little rabbit, hopping through the code,
Changing paths and schema, lightening up the load.
Old files bid farewell, new functions now arise,
With vibrant grids and tables, all sparkling before our eyes.
In the field of code I frolic, where updates bloom so bright,
A joyful hop of progress, deep into the starry night.
🐰🌟 Happy coding, one small hop at a time!

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.

📜 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 dd0e903 and fc78c63.

📒 Files selected for processing (34)
  • apps/app/src/actions/framework/select-frameworks-action.ts (0 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/(home)/actions/getFrameworkCategoriesAction.ts (2 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/(home)/actions/getFrameworksAction.ts (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/(home)/actions/selectFrameworksAction.ts (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/(home)/components/FrameworksGrid.tsx (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/(home)/components/FrameworksOverview.tsx (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/(home)/components/RequirementStatusChart.tsx (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/(home)/hooks/useFrameworks.ts (3 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/(home)/layout.tsx (2 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/(home)/overview/frameworks/[frameworkId]/actions/getOrganizationCategories.ts (0 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/(home)/overview/frameworks/[frameworkId]/actions/getOrganizationControlsProgress.ts (2 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/(home)/overview/frameworks/[frameworkId]/actions/getOrganizationFramework.ts (2 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/(home)/overview/frameworks/[frameworkId]/components/FrameworkControls.tsx (2 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/(home)/overview/frameworks/[frameworkId]/components/FrameworkOverview.tsx (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/(home)/overview/frameworks/[frameworkId]/components/table/FrameworkControlsTable.tsx (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/(home)/overview/frameworks/[frameworkId]/components/table/FrameworkControlsTableColumns.tsx (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/(home)/overview/frameworks/[frameworkId]/components/table/FrameworkControlsTableHeader.tsx (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/(home)/overview/frameworks/[frameworkId]/hooks/useOrganizationFramework.ts (2 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/(home)/overview/frameworks/[frameworkId]/page.tsx (0 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/(home)/overview/frameworks/controls/[id]/components/SingleControl.tsx (3 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/(home)/overview/frameworks/controls/[id]/components/SingleControlSkeleton.tsx (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/(home)/overview/frameworks/controls/[id]/components/data-table/columns.tsx (0 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/(home)/overview/frameworks/controls/[id]/components/data-table/data-table-header.tsx (0 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/(home)/overview/frameworks/controls/[id]/components/table/ControlRequirementsTable.tsx (4 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/(home)/overview/frameworks/controls/[id]/components/table/ControlRequirementsTableColumns.tsx (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/(home)/overview/frameworks/controls/[id]/components/table/ControlRequirementsTableHeader.tsx (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/(home)/page.tsx (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/risk/(overview)/layout.tsx (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/risk/register/layout.tsx (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/vendors/(overview)/layout.tsx (1 hunks)
  • apps/app/src/components/charts/requirement-status.tsx (0 hunks)
  • apps/app/src/components/tables/frameworks/data-table-header.tsx (0 hunks)
  • apps/app/src/components/tables/frameworks/data-table.tsx (0 hunks)
  • apps/app/src/utils/locale.ts (1 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 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.

This branch was successfully deployed

1 active and 2 inactive deployments
Preview – app — fc78c63e Deployed Mar 13, 2025 by vercel[bot]
Preview – web — fc78c63e Deployed Mar 13, 2025 by vercel[bot]
Preview – comp-portal — fc78c63e Deployed Mar 13, 2025 by vercel[bot]
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