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

企業個別ページ傘下のユーザー一覧をVueからRailsに変更 #7956

Merged
merged 17 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
8b6cba0
Vueから既存のslimを利用する形に変更
Judeeeee Jul 11, 2024
770c6f9
コンフリクトの解消&変更によりページネーションが表示されなくなっていたので修正
Judeeeee Jul 16, 2024
9921264
ユーザー数を正しく表示できていなかったため、他の表記に合わせてtotal_countを使う
Judeeeee Jul 16, 2024
610c50a
変更の前後で、ブラウザでの表示が異なっていたため修正
Judeeeee Jul 25, 2024
73da165
CIで落ちていたRuboCop指摘の修正
Judeeeee Jul 25, 2024
87811c8
余白を変更前に合わせる
Judeeeee Aug 15, 2024
d3fcf59
最初のページではページネーション先頭の矢印(<<)表示を非リンクにする
Judeeeee Aug 15, 2024
7a08baa
可読性を考慮し、文字数が少ないcollectionオプションを指定
Judeeeee Aug 26, 2024
dcc961f
RuboCopのStyle/UnlessElseとSQLの発行回数を考慮し、present?を採用
Judeeeee Aug 26, 2024
8f3c4ce
ページネーション先頭の矢印(<<)表示を非リンク化で統一する
Judeeeee Nov 12, 2024
c613f4e
不必要な記述を削除
Judeeeee Nov 16, 2024
2e5d7b6
ユーザー一覧のslimを使い回せるので、企業ユーザー用に作成していたslimを削除した
Judeeeee Nov 16, 2024
38c956f
コンフリクトしたため、最新mainを取り込んでmergeコミットを積む
Judeeeee Nov 16, 2024
ba73ddb
nav.pagenationはkaminariのpagenatorで定義してあるので、重複する記述を削除
Judeeeee Nov 16, 2024
2156705
可読性のために、ブロックを使った書き方へ変更
Judeeeee Nov 20, 2024
e3e42fd
mergeコミットを詰んだ際に修正し忘れた変更を削除
Judeeeee Nov 20, 2024
3cf557c
CI実行時に、slim-lintで指摘された箇所を修正
Judeeeee Nov 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions app/javascript/stylesheets/shared/blocks/_pagination.sass
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@
.pagination__item.is-active &
background-color: var(--main)
color: var(--reversal-text)
&.is-disabled
opacity: .4
pointer-events: none
6 changes: 2 additions & 4 deletions app/views/companies/users/_company_users.html.slim
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.page-body
nav.pagination
= paginate users
= paginate users
.container
.users
- if users.empty?
Expand All @@ -13,5 +12,4 @@
- else
.row
= render users
nav.pagination
= paginate users
= paginate users
9 changes: 6 additions & 3 deletions app/views/kaminari/_first_page.html.slim
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
- # rubocop:disable Rails/OutputSafety
li.pagination__item.is-first
= link_to_unless current_page.first?, raw('<i class="fas fa-angle-double-left"></i>'), url, remote:, class: 'pagination__item-link is-first'
- # rubocop:enable Rails/OutputSafety
- if current_page.first?
span.pagination__item-link.is-first.is-disabled
i.fas.fa-angle-double-left
- else
= link_to url, remote:, class: 'pagination__item-link is-first' do
i.fas.fa-angle-double-left
2 changes: 1 addition & 1 deletion app/views/kaminari/_paginator.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
nav.pagination
.container
ul.pagination__items
== first_page_tag unless current_page.first?
== first_page_tag
== prev_page_tag unless current_page.first?
- each_page do |page|
- if page.left_outer? || page.right_outer? || page.inside_window?
Expand Down
27 changes: 27 additions & 0 deletions test/system/company/users_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,31 @@ class Company::UsersTest < ApplicationSystemTestCase
click_link '現役 + 研修生'
assert_no_text 'Kensyu Owata'
end

test 'show pagination when over 25 users' do
25.times do |i|
user = User.create!(
login_name: "paginationtest#{i}",
email: "paginationtest#{i}@fjord.jp",
password: 'testtest',
name: "pagination#{i}",
name_kana: 'ページネーション テスト',
description: 'ページネーションテスト用に一時的なユーザーを作成しました',
course: courses(:course1),
job: 'student',
os: 'mac',
company: companies(:company1),
experience: 'ruby'
)

DiscordProfile.create!(
user_id: user.id,
times_url: 'https://discord.com/channels/715806612824260640/123456789000000014',
account_name: "paginationtest#{i}"
)
end
visit_with_auth "/companies/#{companies(:company1).id}/users?target=all", 'kimura'
assert companies(:company1).users.count >= 25
assert_selector 'nav.pagination', count: 2
end
end