-
Notifications
You must be signed in to change notification settings - Fork 71
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
管理ページに、ユーザーのroleとjobの絞り込み機能追加 #7418
Merged
komagata
merged 13 commits into
main
from
feature/admin-can-sort-by-user-roles-and-jobs
May 28, 2024
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
08658e7
userのroleとjobで絞り込みできるように実装
reckyy 6a50161
ヘルパーメソッド作成
reckyy 175d024
休会+会社員の絞り込みの正常系テスト追加
reckyy 86b3622
ユーザー絞り込みにデザイン
machida b1ac533
職業でも全員検索できるように追加
reckyy 6960b37
空行を削除
reckyy cbd4433
ヘルパーメソッドのテスト追加
reckyy 62c8958
定数をfreeze
reckyy d654776
コードの意図を説明するコメント追加
reckyy 20af5b9
正常にテストできていなかったため、修正
reckyy d82379b
jobの検索ロジックをcontrollerからmodelに移行
reckyy 768eb2c
testの命名を変更
reckyy d7fe6a0
渡しそびれていたインスタンス変数を追記
reckyy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
app/javascript/stylesheets/application/blocks/page/_page-main-filter.sass
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.page-main-filter__inner | ||
display: block | ||
padding-block: .75rem | ||
|
||
.page-main-filter__row | ||
display: flex | ||
gap: 1rem | ||
align-items: center | ||
flex-wrap: wrap | ||
.page-main-filter__row | ||
gap: .5rem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
.page-main-filter | ||
.container | ||
= form_with url: admin_users_path(target: @target, job: @job), local: true, method: 'get', class: 'page-main-filter__inner' do | ||
.page-main-filter__row | ||
.page-main-filter__column | ||
.page-main-filter__row | ||
.page-main-filter__column | ||
label.a-form-label.is-sm | ||
| ロール | ||
.page-main-filter__column | ||
.a-button.is-sm.is-secondary.is-select.is-block | ||
= select_tag 'target', options_for_select(roles_for_select, params[:target]) | ||
.page-main-filter__column | ||
.page-main-filter__row | ||
.page-main-filter__column | ||
label.a-form-label.is-sm | ||
| 職業 | ||
.page-main-filter__column | ||
.a-button.is-sm.is-secondary.is-select.is-block | ||
= select_tag 'job', options_for_select(jobs_for_select, params[:job]) | ||
.page-main-filter__column | ||
button.a-button.is-sm.is-primary.is-block | ||
span | ||
| この条件で絞り込む |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@job
はviewで使っていますか?もし使っていなければインスタンス変数である必要はないかもです。
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.
こちら、渡しそびれていました。
気づいていただきありがとうございます!
下記でsortするときに渡すクエリパラメータのために、用意していたインスタンス変数になります。
渡しそびれていたインスタンス変数を追記
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.
@reckyy なるほどです~