Skip to content

Commit

Permalink
Add ID as secondary sort order
Browse files Browse the repository at this point in the history
This ads ID as a secondary sort order
for the import details table.

Connected to https://github.com/curationexperts/in-house/issues/432
  • Loading branch information
little9 committed Nov 21, 2019
1 parent 3aab10f commit 7083ec1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/controllers/zizia/csv_import_details_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ class CsvImportDetailsController < ApplicationController
def index
@csv_import_details = if csv_import_detail_params[:user] && user_id
Zizia::CsvImportDetail
.order(sort_column + ' ' + sort_direction)
.order("#{sort_column} #{sort_direction}, id DESC")
.where(depositor_id: user_id).page csv_import_detail_params[:page]
else
Zizia::CsvImportDetail
.order(sort_column + ' ' + sort_direction).page csv_import_detail_params[:page]
.order("#{sort_column} #{sort_direction}, id DESC").page csv_import_detail_params[:page]
end
end

Expand Down
5 changes: 3 additions & 2 deletions spec/dummy/spec/system/csv_import_details_page_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
it 'displays the metadata when you visit the page' do
visit ('/csv_import_details/index')
expect(page).to have_content('ID')
click_on '1'
click_on '13'
expect(page).to have_content('Total Size')
expect(page).to have_content('Deduplication Key')
end
Expand Down Expand Up @@ -73,7 +73,7 @@
it 'displays the metadata when you visit the page' do
visit ('/csv_import_details/index')
expect(page).to have_content('ID')
click_on '1'
click_on '13'
expect(page).to have_content('Total Size')
end

Expand Down Expand Up @@ -117,6 +117,7 @@

it 'has pagination for PreIngestWorks at 10' do
visit('/csv_import_details/index')
click_on 'Next'
click_on '4'
expect(page).to have_content 'Next'
click_on 'Next'
Expand Down

0 comments on commit 7083ec1

Please sign in to comment.