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

未アサインの提出物のページングを削除 #3441

Merged
merged 3 commits into from
Oct 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion app/controllers/api/products/unassigned_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ def index
.not_wip
.list
.order_for_not_wip_list
.page(params[:page])
@latest_product_submitted_just_5days = @products.find { |product| product.elapsed_days == 5 }
@latest_product_submitted_just_6days = @products.find { |product| product.elapsed_days == 6 }
@latest_product_submitted_over_7days = @products.find { |product| product.elapsed_days >= 7 }
Expand Down
2 changes: 1 addition & 1 deletion app/views/api/products/unassigned/index.json.jbuilder
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ json.products do
json.partial! "api/products/product", product: product
end
end
json.total_pages @products.page(1).total_pages
json.total_pages 1
json.latest_product_submitted_just_5days @latest_product_submitted_just_5days
json.latest_product_submitted_just_6days @latest_product_submitted_just_6days
json.latest_product_submitted_over_7days @latest_product_submitted_over_7days
4 changes: 0 additions & 4 deletions test/system/product/unassigned_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
require 'application_system_test_case'

class ProductsTest < ApplicationSystemTestCase
PAGINATES_PER = 50

test 'non-staff user can not see listing unassigned products' do
visit_with_auth '/products/unassigned', 'hatsuno'
assert_text '管理者・アドバイザー・メンターとしてログインしてください'
Expand Down Expand Up @@ -39,8 +37,6 @@ class ProductsTest < ApplicationSystemTestCase
test 'products order on unassigned tab' do
# id順で並べたときの最初と最後の提出物を、提出日順で見たときに最新と最古になるように入れ替える
Product.update_all(created_at: 1.day.ago, published_at: 1.day.ago) # rubocop:disable Rails/SkipsModelValidations
# 最古の提出物を画面上で判定するため、提出物を1ページ内に収める
Product.unassigned.unchecked.not_wip.limit(Product.count - PAGINATES_PER).delete_all
newest_product = Product.unassigned.unchecked.not_wip.reorder(:id).first
newest_product.update(published_at: Time.current)
oldest_product = Product.unassigned.unchecked.not_wip.reorder(:id).last
Expand Down