-
Notifications
You must be signed in to change notification settings - Fork 75
ユーザー個別配下の日報一覧に未チェックの一覧を追加した #8997
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
f06c701
8a34a9a
a0e176d
1634dd4
7885c68
d0b7f28
325744a
4ead1d8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,4 +4,13 @@ | |
| = render 'users/page_title', user: @user | ||
| = user_page_tabs(@user, active_tab: '日報') | ||
|
|
||
| = react_component('Reports', userId: @user.id, practices: @current_user_practice.sorted_practices) | ||
| - if admin_or_mentor_login? | ||
| nav.tab-nav(class="#{mentor_login? ? 'is-only-mentor' : ''}") | ||
| .container | ||
| ul.tab-nav__items | ||
| - targets = %w[all_reports unchecked_reports] | ||
| - targets.each do |target| | ||
| li.tab-nav__item | ||
| = link_to t("target.#{target}"), user_reports_path(@user, target:), class: (@target == target ? ['is-active'] : []) << 'tab-nav__item-link' | ||
|
|
||
| = react_component('Reports', userId: @user.id, practices: @current_user_practice.sorted_practices, unchecked: (@target == 'unchecked_reports')) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chain未チェック一覧のアクセス制御(メンター限定)を確認してください URL 直叩きで一般ユーザーが 以下スクリプトで関連箇所の有無とガード条件を確認できます(リポジトリルートで実行)。 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '== unchecked_reports を扱うコントローラ周辺の定義確認 =='
rg -n -C5 -g 'app/controllers/**/*.rb' -P '(unchecked_reports|target\s*=>?\s*[\'"]unchecked_reports[\'"]|params\[:target\]\s*==\s*[\'"]unchecked_reports[\'"])'
echo
echo '== メンター/管理者ガードらしきメソッドの出現箇所確認 =='
rg -n -C3 -g 'app/controllers/**/*.rb' -P '(admin_or_mentor\?|mentor_login\?|mentor_mode)'
echo
echo '== users/reports_controller.rb と api/reports_controller.rb の set_target / フィルタ分岐の確認 =='
fd -t f reports_controller.rb app/controllers | xargs -I{} sh -c 'echo "--- {} ---"; sed -n "1,200p" {} | nl -ba | sed -n "1,200p" | rg -n -C3 -P "(before_action|set_target|unchecked|params\\[:target\\])" || true'Length of output: 220 シェルスクリプト内の正規表現のクオート部分でパースエラーが発生しているようです。以下の修正版をリポジトリルートで再度実行し、結果をご共有ください。 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '== unchecked_reports を扱うコントローラ周辺の定義確認 =='
rg -n -C5 -g 'app/controllers/**/*.rb' -P "unchecked_reports|target\\s*=>?\\s*['\"]unchecked_reports['\"]|params\\[:target\\]\\s*==\\s*['\"]unchecked_reports['\"]"
echo
echo '== メンター/管理者ガードらしきメソッドの出現箇所確認 =='
rg -n -C3 -g 'app/controllers/**/*.rb' -P "admin_or_mentor\\?|mentor_login\\?|mentor_mode"
echo
echo '== users/reports_controller.rb と api/reports_controller.rb の set_target / フィルタ分岐の確認 =='
fd -t f reports_controller.rb app/controllers | while read file; do
echo "--- $file ---"
rg -n -C3 -e "before_action" -e "set_target" -e "params\\[:target\\]" -e "unchecked" "$file" || true
doneLength of output: 14405 以下のスクリプトで API 側と UI 側それぞれのベースコントローラにメンター制御(before_action 等)が仕込まれているか確認してください。 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '== app/controllers/api/base_controller.rb (1-200行) =='
sed -n '1,200p' app/controllers/api/base_controller.rb | nl -ba
echo
echo '== API::BaseController の before_action 一覧 =='
rg -n --color=never 'before_action' -g 'app/controllers/api/base_controller.rb' || echo 'no matches'
echo
echo '== app/controllers/application_controller.rb (1-200行) =='
sed -n '1,200p' app/controllers/application_controller.rb | nl -ba
echo
echo '== ApplicationController の before_action 一覧 =='
rg -n --color=never 'before_action' -g 'app/controllers/application_controller.rb' || echo 'no matches'Length of output: 293 以下のスクリプトで API 側と UI 側それぞれのベースコントローラにメンター権限制御が設定されているか確認し、結果を共有してください。 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '== API::BaseController (app/controllers/api/base_controller.rb lines 1-200) =='
if [[ -f app/controllers/api/base_controller.rb ]]; then
sed -n '1,200p' app/controllers/api/base_controller.rb
echo
echo '== before_action in API::BaseController =='
grep -n 'before_action' app/controllers/api/base_controller.rb || echo '== no before_action =='
echo
echo '== require_mentor_login_for_api in API::BaseController =='
grep -n 'require_mentor_login_for_api' app/controllers/api/base_controller.rb || echo '== no require_mentor_login_for_api =='
echo
echo '== require_admin_or_mentor_login in API::BaseController =='
grep -n 'require_admin_or_mentor_login' app/controllers/api/base_controller.rb || echo '== no require_admin_or_mentor_login =='
else
echo 'app/controllers/api/base_controller.rb not found'
fi
echo
echo '== ApplicationController (app/controllers/application_controller.rb lines 1-200) =='
if [[ -f app/controllers/application_controller.rb ]]; then
sed -n '1,200p' app/controllers/application_controller.rb
echo
echo '== before_action in ApplicationController =='
grep -n 'before_action' app/controllers/application_controller.rb || echo '== no before_action =='
echo
echo '== require_mentor_login in ApplicationController =='
grep -n 'require_mentor_login' app/controllers/application_controller.rb || echo '== no require_mentor_login =='
echo
echo '== require_admin_or_mentor_login in ApplicationController =='
grep -n 'require_admin_or_mentor_login' app/controllers/application_controller.rb || echo '== no require_admin_or_mentor_login =='
else
echo 'app/controllers/application_controller.rb not found'
fiLength of output: 4874 未チェック一覧へのアクセス制御を強化してください
これにより、パラメータ直接指定による情報漏洩を防止できます。 🤖 Prompt for AI Agents
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. それぞれ、 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @hirokiej |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
管理者・メンターユーザでメンターモードOFF時に、未チェック数バッチが表示されているようです。
管理者・メンターユーザでメンターモードOFF時は、未チェック数バッチが表示されない仕様だったと認識していますが、認識合っていますでしょうか?
ご確認いただけると幸いです。😌
(最初のレビューの際に気づけなくて失礼いたしました。)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
提出物の部分もメンタモードオフでバッヂが表示になっていたので、同様の対応をしました💦
勝手な推測になってしまうのですが、メンターモードオフだと確認が遅れてしまうということがあるのかな?と思いました。しかし、チームリーダーに確認すべきだと思ったので、komagataさんに確認してみます。
@komagata さん
お疲れ様です。
こちらの件ですが、提出物のタブではメンターモードオフの場合、バッヂが表示されていますが、未確認の日報数の場合は非表示にすべきでしょうか?
お手隙でご確認よろしくお願いいたします。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hirokiej
こちらどういった意味でしょうか?
質問に回答するのにこの情報が必要かもなので先に聞いておきたいと思いました。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@komagata さん
ユーザーとしては提出物や日報がチェックされていると安心感につながる部分だと感じています。
そのため、未チェックの日報数がadmin/mentorにはデフォルトで表示されている方が、未チェックに気づきやすく対応しやすいのではないか、という推測でした。
提出物のタブではメンターモードオフでも表示されているのに、日報では非表示にするのは統一感もないと感じ、提出物のタブに合わせる形で実装しています。
しかし、どちらが適切か判断がつかなかったため、改めて確認させていただきました🙇
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hirokiej 返信ありがとうございます。
すみません、ちょっと僕の聞き方がわかりづらかったです。
僕がわからなかった部分は、
という部分です。「確認が遅れてしまう」というのはどういう意味でしょうか。
(「誰が」、「何を」、「なぜ」、遅れてしまうと考えたのでしょうか)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@komagata さん
ご確認ありがとうございます。
「メンターモードをオフにしているメンター」が「未チェックの日報の確認」を「メンターモードをオフにしている結果、バッヂが非表示になり認識しづらくなる」ため確認が遅れやすくなってしまうかも、という仮説として示したつもりでした。
こちらこそ言葉足らずで申し訳ございませんでした🙇💦
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hirokiej なるほどですね。説明ありがとうございます。
メンターモードがオフでも未確認の日報数は非表示にしなくてOKです。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@komagata さん
ご回答ありがとうございます🙇
@sjabcdefin さん
確認したところ、表示した状態で大丈夫とのことでした🙇
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hirokiej
ご確認ありがとうございます。😌🙏
私の方での確認は以上ですので、approveさせていただきます。🙆♀️
ご対応ありがとうございました!🎉
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sjabcdefin さん
ご確認、ご対応ありがとうございました🙇!