Skip to content

日報の個別ページにそのユーザーの未チェックの日報数を表示をstaffからmentorに変更した#8995

Merged
komagata merged 1 commit intomainfrom
bug/hide-user-unchecked-report-count-on-advisor-page
Jul 30, 2025
Merged

日報の個別ページにそのユーザーの未チェックの日報数を表示をstaffからmentorに変更した#8995
komagata merged 1 commit intomainfrom
bug/hide-user-unchecked-report-count-on-advisor-page

Conversation

@hirokiej
Copy link
Copy Markdown
Contributor

@hirokiej hirokiej commented Jul 30, 2025

Issue

概要

アドバイザーでログインした際、日報の個別ページにそのユーザーの未チェックの日報数が表示されてしまうのを非表示にし、adminとmentorのみに公開範囲を変更した

変更確認方法

  1. bug/hide-user-unchecked-report-count-on-advisor-pageをローカルに取り込む
  2. senpaiでログイン
    ID: senpai
    PASS: testest
  3. 任意の日報を表示し、本文下に未チェックの日報数の表示がないことを確認

Screenshot

変更前

image

変更後

image

Summary by CodeRabbit

  • バグ修正
    • 未チェックレポート数の表示条件が「スタッフログイン時」から「メンターログイン時」に変更されました。

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jul 30, 2025

Walkthrough

staff_login? から mentor_login? への条件分岐の変更により、レポート本文部分で未チェックレポート数および関連UI要素の表示対象がスタッフからメンターに変更されました。他のロジックや制御フローの変更はありません。

Changes

Cohort / File(s) Change Summary
レポート本文の表示条件変更
app/views/reports/_report_body.html.slim
未チェックレポート数と関連UI表示の条件を staff_login? から mentor_login? に変更。CSSクラスの割り当ても同様に修正。

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Suggested reviewers

  • komagata

Poem

🐰
メンターだけが見る数字、
レポート未チェック、今ここに。
スタッフの役目は一歩後ろ、
ロールの切り替え、軽やかに。
コードの森で踊るウサギ、
今日もレビューでぴょんぴょん!

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3668dcb and c3f44e3.

📒 Files selected for processing (1)
  • app/views/reports/_report_body.html.slim (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: jun-kondo
PR: fjordllc/bootcamp#8977
File: app/controllers/reports_controller.rb:63-63
Timestamp: 2025-07-23T20:31:13.856Z
Learning: fjordllc/bootcampプロジェクトの`app/controllers/reports_controller.rb`において、`create`と`update`アクションは両方とも`@report.save_uniquely`を使用し、同じ`:report_save`イベントと`'report.save'`イベントを発行する。これは両方とも本質的に「レポートの保存」操作であり、作成と更新を区別する必要がないためである。
app/views/reports/_report_body.html.slim (1)

Learnt from: jun-kondo
PR: #8977
File: app/controllers/reports_controller.rb:63-63
Timestamp: 2025-07-23T20:31:13.856Z
Learning: fjordllc/bootcampプロジェクトのapp/controllers/reports_controller.rbにおいて、createupdateアクションは両方とも@report.save_uniquelyを使用し、同じ:report_saveイベントと'report.save'イベントを発行する。これは両方とも本質的に「レポートの保存」操作であり、作成と更新を区別する必要がないためである。

🔇 Additional comments (1)
app/views/reports/_report_body.html.slim (1)

9-9: LGTM! アクセス制御の変更が適切に実装されています。

staff_login? から mentor_login? への変更により、未チェック日報数の表示がスタッフ(アドバイザー)から制限され、メンターと管理者のみに表示されるようになりました。これはPRの目的と一致しており、適切な実装です。

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bug/hide-user-unchecked-report-count-on-advisor-page

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.
    • 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.
    • @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 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.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

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 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.

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.

@hirokiej hirokiej self-assigned this Jul 30, 2025
@hirokiej hirokiej requested a review from komagata July 30, 2025 02:49
@hirokiej
Copy link
Copy Markdown
Contributor Author

@komagata さん
お疲れ様です。
こちらレビューよろしくお願いいたします🙇

@hirokiej hirokiej marked this pull request as ready for review July 30, 2025 02:56
Copy link
Copy Markdown
Member

@komagata komagata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

確認させて頂きました。OKです〜🙆‍♂️

@komagata komagata merged commit 8573250 into main Jul 30, 2025
8 checks passed
@komagata komagata deleted the bug/hide-user-unchecked-report-count-on-advisor-page branch July 30, 2025 05:40
@github-actions github-actions bot mentioned this pull request Jul 30, 2025
87 tasks
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.

2 participants