Skip to content

chore: update dependencies and improve localization handling#266

Merged
carhartlewis merged 1 commit into
mainfrom
lewis/risk-charts
Apr 3, 2025
Merged

chore: update dependencies and improve localization handling#266
carhartlewis merged 1 commit into
mainfrom
lewis/risk-charts

Conversation

@carhartlewis
Copy link
Copy Markdown
Contributor

@carhartlewis carhartlewis commented Apr 3, 2025

  • Upgraded AWS SDK clients to version 3.782.0 for S3 and SecurityHub.
  • Updated Turbo to version 2.5.0 for performance improvements.
  • Removed unused localization files for Spanish, French, Norwegian, and Portuguese.
  • Simplified localization setup by removing unnecessary language imports.
  • Enhanced error handling in email sending functionality.
  • Refactored various components for improved clarity and consistency in code style.

Summary by CodeRabbit

  • Enhancements

    • Improved validations for role assignments during invitation acceptance and member updates.
    • Streamlined task management through clear assignment requirements and refined status indicators.
  • UI & Form Updates

    • Updated forms for tasks and vendor management now display clearer assignment information.
    • Training video listings now show only content with complete supporting details.
  • Internationalization

    • Language support has been streamlined to English only.

- Upgraded AWS SDK clients to version 3.782.0 for S3 and SecurityHub.
- Updated Turbo to version 2.5.0 for performance improvements.
- Removed unused localization files for Spanish, French, Norwegian, and Portuguese.
- Simplified localization setup by removing unnecessary language imports.
- Enhanced error handling in email sending functionality.
- Refactored various components for improved clarity and consistency in code style.
@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 10:09pm
comp-portal 🔄 Building (Inspect) Visit Preview 💬 Add feedback Apr 3, 2025 10:09pm

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 3, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This update implements extensive changes across the codebase. Many functions now require explicit role and assignee validations, replacing default or legacy values (e.g. “ownerId” is now “assigneeId”). Several hooks and components have their types generalized and status keys updated. Formatting improvements and import reorganizations have been applied throughout. Additionally, locale support was simplified to English only, unused files were removed, and dependency versions plus build tasks were updated.

Changes

File(s) Summary
apps/app/src/actions/organization/accept-invitation.ts
apps/app/src/actions/organization/update-member-role.ts
Added validation in invitation acceptance and member role update actions. Ensures invitation role is defined and validates the role parameter (converting "auditor" to "member").
apps/app/src/actions/risk/task/update-task-action.ts Renamed ownerId to assigneeId for task updates.
apps/app/src/actions/schema.ts Code reformatting for consistent indentation in schema definitions.
apps/app/src/app/…/employees/[employeeId]/page.tsx Updated getTrainingVideos to filter for metadata, improving type safety.
apps/app/src/app/…/evidence/(overview)/hooks/useAssigneeData.ts
apps/app/src/app/…/evidence/(overview)/hooks/useEvidenceData.ts
apps/app/src/app/…/evidence/(overview)/hooks/useFrameworkData.ts
apps/app/src/app/…/evidence/(overview)/hooks/useStatusTranslation.ts
Modified data types from strict types to any[] and revised status keys; introduced a local union type for status values in the translation hook.
apps/app/src/app/…/risk/[riskId]/tasks/[taskId]/page.tsx Cosmetic formatting and indentation adjustments with no functional changes.
apps/app/src/app/…/vendors/[vendorId]/actions/task/create-task-action.ts
apps/app/src/app/…/vendors/[vendorId]/actions/task/update-task-action.ts
apps/app/src/app/…/vendors/[vendorId]/actions/update-vendor-action.ts
In vendor task actions, renamed ownerId to assigneeId, added error checks (e.g. “Assignee ID is required”), and removed unused properties.
apps/app/src/app/…/vendors/[vendorId]/components/secondary-fields/secondary-fields.tsx
apps/app/src/app/…/vendors/[vendorId]/components/secondary-fields/update-secondary-fields-form.tsx
Applied formatting enhancements and updated vendor prop types; changed field naming from ownerId to assigneeId.
apps/app/src/app/…/vendors/[vendorId]/components/tasks/create-vendor-task-form.tsx
apps/app/src/app/…/vendors/[vendorId]/components/title-and-description/update-title-and-description-form.tsx
apps/app/src/app/…/vendors/[vendorId]/page.tsx
apps/app/src/app/…/vendors/register/components/VendorRegisterFilters.tsx
Adjusted form default values and formatting to reflect the renaming from ownerId to assigneeId.
apps/app/src/app/api/v1/employees/route.ts
apps/app/src/app/api/v1/risks/[id]/route.ts
apps/app/src/app/api/v1/risks/route.ts
Updated API routes: added explicit Role type casting, replaced ownerId with assigneeId, and restructured nested user data under assignee.
apps/app/src/components/forms/policies/update-policy-form.tsx
apps/app/src/components/forms/risks/task/update-task-form.tsx
apps/app/src/components/forms/risks/task/update-task-overview-form.tsx
apps/app/src/components/forms/risks/update-risk-form.tsx
In form components for risks and tasks, updated default values and field names from ownerId to assigneeId, and modified imports (from TemplatePolicy to Policy).
apps/app/src/components/modals/create-org-modal.tsx Reorganized imports and updated the success callback for organization creation with a new organization reference structure.
apps/app/src/components/policies/charts/policies-by-assignee.tsx
apps/app/src/components/policies/charts/policies-by-framework.tsx
apps/app/src/components/policies/sheets/policy-archive-sheet.tsx
apps/app/src/components/policies/sheets/policy-overview-sheet.tsx
Deleted obsolete policy charts; updated imports in sheets to use Policy instead of TemplatePolicy, with minor formatting changes.
apps/app/src/components/tables/risk-register/empty-states.tsx
apps/app/src/components/tables/risk-register/filter-toolbar.tsx
Made formatting adjustments and updated type definitions in risk register tables, now passing assignees from updated user structures.
apps/app/src/data/tools/risks.ts
apps/app/src/lib/db/employee.ts
In data tools and DB utility, replaced ownerId with assigneeId and added the Role type to the employee module with explicit type casting.
apps/app/src/locales/client.ts
apps/app/src/locales/es.ts
apps/app/src/locales/fr.ts
apps/app/src/locales/no.ts
apps/app/src/locales/pt.ts
apps/app/src/locales/server.ts
Removed all non-English language files and imports; now only English is supported.
package.json
packages/auth/src/auth.ts
packages/email/lib/resend.ts
turbo.json
Updated dependency versions, added an import for OTP verification emails, applied formatting fixes, and introduced a new auth:build task with updated build dependencies.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant API
    participant DB

    Client->>API: completeInvitation(invitation)
    alt invitation.role defined
        API->>DB: Create member using invitation.role
        DB-->>API: Member created
        API-->>Client: Success response
    else invitation.role missing
        API-->>Client: Error "Invitation role is required"
    end
Loading
sequenceDiagram
    participant Client
    participant API
    participant AuthClient

    Client->>API: updateMemberRole(role)
    alt role provided
        API->>API: if role=="auditor", convert to "member"
        API->>AuthClient: updateMemberRole(validRole)
        AuthClient-->>API: Update successful
        API-->>Client: Success response
    else no role provided
        API-->>Client: Error "Role is required"
    end
Loading
sequenceDiagram
    participant Client
    participant API
    participant DB

    Client->>API: createVendorTask(assigneeId, details)
    alt assigneeId provided
        API->>DB: Create task with assigneeId
        DB-->>API: Task created
        API-->>Client: Task creation success
    else missing assigneeId
        API-->>Client: Error "Assignee ID is required"
    end
Loading

Possibly related PRs

Poem

I’m a little rabbit, hopping with delight,
Code paths renewed under the soft moonlight.
Roles are validated, assignments made clear,
With every renamed field, the vision is near.
Dancing through modules with a skip and a hop,
In a world of clean code, I just can’t stop!
🐇🌙


📜 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 6aa663a and 44b1caf.

⛔ Files ignored due to path filters (2)
  • bun.lock is excluded by !**/*.lock
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (45)
  • apps/app/src/actions/organization/accept-invitation.ts (1 hunks)
  • apps/app/src/actions/organization/update-member-role.ts (1 hunks)
  • apps/app/src/actions/risk/task/update-task-action.ts (2 hunks)
  • apps/app/src/actions/schema.ts (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/employees/[employeeId]/page.tsx (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/evidence/(overview)/hooks/useAssigneeData.ts (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/evidence/(overview)/hooks/useEvidenceData.ts (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/evidence/(overview)/hooks/useFrameworkData.ts (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/evidence/(overview)/hooks/useStatusTranslation.ts (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/risk/[riskId]/tasks/[taskId]/page.tsx (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/vendors/[vendorId]/actions/task/create-task-action.ts (2 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/vendors/[vendorId]/actions/task/update-task-action.ts (2 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/vendors/[vendorId]/actions/update-vendor-action.ts (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/vendors/[vendorId]/components/secondary-fields/secondary-fields.tsx (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/vendors/[vendorId]/components/secondary-fields/update-secondary-fields-form.tsx (2 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/vendors/[vendorId]/components/tasks/create-vendor-task-form.tsx (2 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/vendors/[vendorId]/components/title-and-description/update-title-and-description-form.tsx (2 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/vendors/[vendorId]/page.tsx (2 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/vendors/register/components/VendorRegisterFilters.tsx (1 hunks)
  • apps/app/src/app/api/v1/employees/route.ts (2 hunks)
  • apps/app/src/app/api/v1/risks/[id]/route.ts (2 hunks)
  • apps/app/src/app/api/v1/risks/route.ts (1 hunks)
  • apps/app/src/components/forms/policies/update-policy-form.tsx (2 hunks)
  • apps/app/src/components/forms/risks/task/update-task-form.tsx (1 hunks)
  • apps/app/src/components/forms/risks/task/update-task-overview-form.tsx (2 hunks)
  • apps/app/src/components/forms/risks/update-risk-form.tsx (2 hunks)
  • apps/app/src/components/modals/create-org-modal.tsx (2 hunks)
  • apps/app/src/components/policies/charts/policies-by-assignee.tsx (0 hunks)
  • apps/app/src/components/policies/charts/policies-by-framework.tsx (0 hunks)
  • apps/app/src/components/policies/sheets/policy-archive-sheet.tsx (1 hunks)
  • apps/app/src/components/policies/sheets/policy-overview-sheet.tsx (1 hunks)
  • apps/app/src/components/tables/risk-register/empty-states.tsx (1 hunks)
  • apps/app/src/components/tables/risk-register/filter-toolbar.tsx (2 hunks)
  • apps/app/src/data/tools/risks.ts (1 hunks)
  • apps/app/src/lib/db/employee.ts (2 hunks)
  • apps/app/src/locales/client.ts (0 hunks)
  • apps/app/src/locales/es.ts (0 hunks)
  • apps/app/src/locales/fr.ts (0 hunks)
  • apps/app/src/locales/no.ts (0 hunks)
  • apps/app/src/locales/pt.ts (0 hunks)
  • apps/app/src/locales/server.ts (0 hunks)
  • package.json (2 hunks)
  • packages/auth/src/auth.ts (1 hunks)
  • packages/email/lib/resend.ts (1 hunks)
  • turbo.json (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 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