Skip to content

Mariano/risk improvements#260

Merged
Marfuen merged 3 commits into
mainfrom
mariano/risk-improvements
Apr 3, 2025
Merged

Mariano/risk improvements#260
Marfuen merged 3 commits into
mainfrom
mariano/risk-improvements

Conversation

@Marfuen

@Marfuen Marfuen commented Apr 3, 2025

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Introduced an "Assignee" selection in risk and task management screens, enabling clearer and more consistent assignment during risk creation and task updates.
  • Refactor

    • Unified assignment terminology across dashboards, forms, and tables for improved clarity in displaying responsible parties.
  • Chores

    • Updated the database schema to support the new assignee relationships, ensuring smooth data handling and improved overall performance.

@vercel

vercel Bot commented Apr 3, 2025

Copy link
Copy Markdown

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

Name Status Preview Comments Updated (UTC)
app ❌ Failed (Inspect) Apr 3, 2025 8:55pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
comp-portal ⬜️ Skipped (Inspect) Apr 3, 2025 8:55pm

@coderabbitai

coderabbitai Bot commented Apr 3, 2025

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

Walkthrough

This PR uniformly replaces the use of "owner" and "userId" with "assignee" and "assigneeId" across risk actions, UI components, vendor tasks, and database layers. New asynchronous functions (e.g., getAssignees) have been introduced to fetch member data based on active organization sessions. In addition, formatting and schema adjustments have been made to improve code consistency and readability, while existing functionality and control flow remain largely unchanged.

Changes

File(s) Change Summary
apps/app/src/actions/risk/create-risk-action.ts
apps/app/src/actions/risk/update-risk-action.ts
Updated risk creation and update actions to destructure and pass assigneeId instead of ownerId; no changes to error handling or overall flow.
apps/app/src/actions/schema.ts Reformatted code with consistent indentation; no functionality changes.
apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/risk/(overview)/*
apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/risk/[riskId]/page.tsx
apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/risk/register/*
apps/app/src/components/forms/risks/*
apps/app/src/components/risks/*
apps/app/src/components/sheets/create-risk-sheet.tsx
Introduced new getAssignees functions and updated multiple risk-related components and pages to replace owner/user references with assignee; integrated a new SelectAssignee component for improved assignee selection UI.
apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/vendors/*/tasks/* Replaced user-based fields and logic with assignee-based ones in task detail pages, forms, and component signatures; updated prop types and removed legacy user loading.
packages/db/prisma/migrations/*
packages/db/prisma/schema/*
Dropped columns (ownerId, userId) and added assigneeId in both Risk and Task tables; updated foreign key constraints and modified Prisma schema relationships to link risks and tasks to the Member model.
apps/app/src/components/risks/charts/RisksAssignee.tsx Adjusted mapping logic to reflect changes in data shape (using member.user instead of direct user references); updated URL queries from ownerId to assigneeId.

Sequence Diagram(s)

sequenceDiagram
  participant U as User
  participant SA as SelectAssignee Component
  participant GA as getAssignees()
  participant R as Risk Action Handler
  participant DB as Database

  U->>SA: Open risk form and select assignee
  SA->>GA: Request active members list
  GA->>DB: Query assignees by organization
  DB-->>GA: Return member data
  GA-->>SA: Provide assignee options
  U->>SA: Submit form with selected assigneeId
  SA->>R: Trigger create/update risk action
  R->>DB: Save risk with assigneeId
  DB-->>R: Acknowledge database update
  R-->>SA: Return success response
Loading

Possibly related PRs

Poem

Oh, I’m a rabbit with hops so light,
Chasing carrots in code day and night.
Assignees now lead the risk parade,
Leaving old owners in the shade.
With each updated line, I cheer and grin,
A nibble of progress—let the new flow begin! 🥕🐇


📜 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 40b8a3b and 2536efa.

📒 Files selected for processing (31)
  • apps/app/src/actions/risk/create-risk-action.ts (1 hunks)
  • apps/app/src/actions/risk/update-risk-action.ts (1 hunks)
  • apps/app/src/actions/schema.ts (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/components/SelectAssignee.tsx (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/risk/(overview)/layout.tsx (3 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/risk/(overview)/page.tsx (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/risk/[riskId]/page.tsx (7 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/risk/register/RiskRegisterTable.tsx (4 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/risk/register/components/table/RiskRegisterColumns.tsx (2 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/risk/register/components/table/RiskRegisterFilters.tsx (3 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/risk/register/data/getRisks.ts (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/risk/register/page.tsx (3 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/risk/register/search-params.ts (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/vendors/[vendorId]/actions/schema.ts (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/vendors/[vendorId]/tasks/[taskId]/components/secondary-fields/secondary-fields.tsx (6 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/vendors/[vendorId]/tasks/[taskId]/components/title/title.tsx (3 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/vendors/[vendorId]/tasks/[taskId]/components/title/update-task-sheet.tsx (4 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/vendors/[vendorId]/tasks/[taskId]/page.tsx (3 hunks)
  • apps/app/src/components/forms/risks/create-risk-form.tsx (4 hunks)
  • apps/app/src/components/forms/risks/risk-overview.tsx (5 hunks)
  • apps/app/src/components/risks/charts/RisksAssignee.tsx (3 hunks)
  • apps/app/src/components/risks/charts/risks-by-assignee.tsx (0 hunks)
  • apps/app/src/components/risks/risk-overview.tsx (3 hunks)
  • apps/app/src/components/sheets/create-risk-sheet.tsx (3 hunks)
  • apps/app/src/components/tables/risk-tasks/columns.tsx (3 hunks)
  • apps/app/src/components/tables/risk-tasks/filter-toolbar.tsx (1 hunks)
  • packages/db/prisma/migrations/20250403194504_risk_assignee/migration.sql (1 hunks)
  • packages/db/prisma/migrations/20250403201319_tasks_use_asignee/migration.sql (1 hunks)
  • packages/db/prisma/schema/auth.prisma (1 hunks)
  • packages/db/prisma/schema/risk.prisma (2 hunks)
  • packages/db/prisma/schema/task.prisma (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.

@vercel vercel Bot temporarily deployed to Preview – comp-portal April 3, 2025 20:51 Inactive
@Marfuen Marfuen merged commit 2b2a0e3 into main Apr 3, 2025
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