Skip to content
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

一般ユーザーは募金ページを閲覧不可にした #799

Merged
merged 4 commits into from
Jun 27, 2024

Conversation

Kubosaka
Copy link
Collaborator

resolve #798

概要

  • 一般ユーザー(role_id:1)を募金ページが見れないようにした
  • 一般ユーザー場合は購入申請ページへ飛ばされる
  • seedデータの[email protected]は財務局員権限でなかったため修正した

テスト項目

  • test1~test4でログインして募金ページにアクセスする
  • 今までの初期データはtest4は一般ユーザーであっため注意する(このブランチでは修正済み)

備考

@Kubosaka Kubosaka requested review from hikahana and TkymHrt June 26, 2024 15:18
@Kubosaka Kubosaka self-assigned this Jun 26, 2024
Copy link
Collaborator

@hikahana hikahana left a comment

Choose a reason for hiding this comment

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

動作は〇です!

微修正と一点気になったのでコメント付けました。
今の状態だとレンダリングされ、募金一覧が一瞬だけ見えてからページ遷移しています。user権限の人には見せたくないものだと思うのでレンダリング前にページ遷移するとかの対策が必要に思えます。私も調べたけどうまくできませんでした。

試したこと(失敗)→SSRにリダイレクトを組み込む、useLayoutEffectを使う

@@ -21,4 +21,4 @@ INSERT into users (name, bureau_id, role_id) values ('技大太郎2', 6, 2);
INSERT into users (name, bureau_id, role_id) values ('技大太郎3', 3, 3);

-- 一般ユーザー(財務局員)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
-- 一般ユーザー(財務局員
-- 財務局員

上の方で財務局長となっているので名称合わせてもいいかもですね

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

修正しました
[fix]コメントの修正

Copy link
Collaborator

@hikahana hikahana Jun 26, 2024

Choose a reason for hiding this comment

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

応急処置としてですが、
レンダリングされてからrouter.pushでページ遷移されるから一瞬だけ見えちゃうので
286行目にroleIDが1の時表示させない処理を追加した方よさげかも

              {fundInformationViews &&
                user.roleID !== 1 &&
                fundInformationViews.map((fundViewItem: FundInformationView, index) => (

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

@hikahana hikahana left a comment

Choose a reason for hiding this comment

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

LGTM

@Kubosaka Kubosaka merged commit 3250b73 into develop Jun 27, 2024
2 checks passed
@Kubosaka Kubosaka deleted the feat/kubosaka/798-fix-role_fund_info branch June 27, 2024 03:26
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