Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisHuynh333 committed Jun 6, 2024
1 parent 9a9bebb commit 946f63f
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions app/controllers/projects/samples_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def destroy # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
def new_destroy_multiple
authorize! @project, to: :destroy_sample?
render turbo_stream: turbo_stream.update('samples_dialog',
partial: 'delete_samples_dialog',
partial: 'delete_multiple_samples_dialog',
locals: {
open: true
}), status: :ok
Expand Down Expand Up @@ -157,7 +157,7 @@ def destroy_multiple # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
render status: :multi_status, locals: { messages: }
# All samples deleted successfully
else
render status: :ok, locals: { type: :success, message: t('.success'), not_deleted_samples: nil }
render status: :ok, locals: { type: :success, message: t('.success') }
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
} %>
</div>
</div>

<% end %>
</div>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= turbo_stream.update "samples_dialog",
partial: "delete_samples_dialog",
partial: "delete_multiple_samples_dialog",
locals: {
open: false,
} %>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<%= turbo_stream.update(
"samples_dialog",
partial: "delete_samples_dialog",
partial: "delete_multiple_samples_dialog",
locals: {
open: false,
},
Expand Down
2 changes: 1 addition & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1298,7 +1298,7 @@ en:
description: 'Paste a list of <kbd>,</kbd> seperated sample names or identifiers'
apply: Apply filter
remove_tag: Remove
delete_samples_dialog:
delete_multiple_samples_dialog:
description: "Samples selected for deletion:"
id: ID
name: Name
Expand Down
2 changes: 1 addition & 1 deletion config/routes/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
resource :clone, only: %i[create new]
resource :transfer, only: %i[create new]
resource :file_import, module: :metadata, only: %i[create new]
resource :deletion, only: %i[new destroy]
end
end
collection do
Expand Down Expand Up @@ -70,6 +69,7 @@
end
end
end

get :view_history_version
end

Expand Down
6 changes: 3 additions & 3 deletions test/system/projects/samples_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2039,12 +2039,12 @@ def retrieve_puids
end
click_link I18n.t('projects.samples.index.delete_samples_button'), match: :first
within('span[data-controller-connected="true"] dialog') do
assert_text I18n.t('projects.samples.delete_samples_dialog.title')
assert_text I18n.t('projects.samples.delete_samples_dialog.description')
assert_text I18n.t('projects.samples.delete_multiple_samples_dialog.title')
assert_text I18n.t('projects.samples.delete_multiple_samples_dialog.description')
assert_text @sample1.name
assert_text @sample2.name
assert_text @sample3.name
click_on I18n.t('projects.samples.delete_samples_dialog.submit_button')
click_on I18n.t('projects.samples.delete_multiple_samples_dialog.submit_button')
end
assert_text I18n.t('projects.samples.destroy_multiple.success')

Expand Down

0 comments on commit 946f63f

Please sign in to comment.