Skip to content

Dev#501

Merged
dbarzin merged 3 commits intomainfrom
dev
Aug 11, 2025
Merged

Dev#501
dbarzin merged 3 commits intomainfrom
dev

Conversation

@dbarzin
Copy link
Copy Markdown
Owner

@dbarzin dbarzin commented Aug 11, 2025

Summary by CodeRabbit

  • New Features

    • Auditee users can now view the actions list.
    • Progress charts for actions use an improved history source for more accurate timelines.
  • Bug Fixes

    • Corrected role checks in export and delete, restoring proper access control.
  • Style

    • In Documents Check, the Control column is centered and now shows the control ID as the link text.
  • Documentation

    • Updated internal annotations to reflect accurate return types and model namespaces.
  • Refactor

    • Moved progress history computation into the model for cleaner data access.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Aug 11, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Controllers updated for access checks, query cleanup, and PHPDoc corrections. Action progress history computation moved from controller to Action model via new history() method, with views updated to call it. Document check flow stops eager loading and view now shows control_id. Minor whitespace tweak in Document model.

Changes

Cohort / File(s) Summary of Changes
Actions controller access & logic
app/Http/Controllers/ActionController.php
Extended index() access to role 5; removed redundant get() before pluck(); fixed rol→role in export()/delete(); removed progress_history building from chart(); updated docblocks.
Attributes controller PHPDoc
app/Http/Controllers/AttributeController.php
Aligned PHPDoc return and param types with actual behavior; no signature changes.
Documents check flow
app/Http/Controllers/DocumentController.php, resources/views/documents/check.blade.php
check(): switched from with('control')->get() to all(); view now shows control_id link text and centers the cell; potential lazy-load of control.
Action progress history refactor
app/Models/Action.php, resources/views/radar/actions.blade.php
Added Action::history() to build per-day progress from AuditLog; view updated to iterate $action->history() instead of $action->progress_history.
Formatting only
app/Models/Document.php
Whitespace change before class declaration; no functional impact.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant UI as Radar Actions View
  participant AC as ActionController
  participant AM as Action Model
  participant AL as AuditLog

  User->>UI: Open actions radar
  UI->>AC: GET /radar/actions
  AC-->>UI: Render view with actions
  loop For each action in view
    UI->>AM: history()
    AM->>AL: Query logs by subject (Action, id)
    AL-->>AM: Logs ordered by created_at
    AM-->>UI: [{date, progress}, ...]
    UI->>UI: Plot progress over time
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~18 minutes

Possibly related PRs

  • Dev #497 — Similar controller cleanups (rol→role fix, pluck without get) and touches DocumentController, indicating overlapping refactor patterns.

Poem

A rabbit taps code with a gentle thrum,
History hops to models—controller goes numb.
Charts now nibble logs, day by day,
Documents peek without a preload buffet.
Roles aligned, typos take flight—
Carrots of clarity, deployed tonight. 🥕✨


📜 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 2f9b419 and daf1280.

📒 Files selected for processing (7)
  • app/Http/Controllers/ActionController.php (12 hunks)
  • app/Http/Controllers/AttributeController.php (7 hunks)
  • app/Http/Controllers/DocumentController.php (1 hunks)
  • app/Models/Action.php (1 hunks)
  • app/Models/Document.php (1 hunks)
  • resources/views/documents/check.blade.php (1 hunks)
  • resources/views/radar/actions.blade.php (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev

🪧 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.
    • Explain this complex logic.
    • 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 explain this code block.
  • 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 explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests 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.

@dbarzin dbarzin merged commit a0997a5 into main Aug 11, 2025
1 check was pending
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