Skip to content

Commit

Permalink
touchups for readability and usability (#1501)
Browse files Browse the repository at this point in the history
* ApplicationHelper: fix method name typo

* Rakefile: default task rake task invokes rubocop, then rspec
  • Loading branch information
jmartin-sul authored Oct 15, 2024
1 parent 73258c3 commit 5bd5e63
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
11 changes: 10 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ require 'sneakers/tasks'
Rails.application.load_tasks

unless Rails.env.production?
require 'rspec/core/rake_task'
desc 'Run RSpec'
RSpec::Core::RakeTask.new(:spec)

require 'rubocop/rake_task'
desc 'Run rubocop'
RuboCop::RakeTask.new

desc 'Run erblint against ERB files'
Expand All @@ -25,5 +30,9 @@ unless Rails.env.production?
desc 'Run all configured linters'
task lint: %i[rubocop erblint eslint]

task default: [:lint, 'test:prepare', :spec]
end
# clear the default task injected by rspec
task(:default).clear

# and replace it with our own
task default: [:rubocop, :spec]
2 changes: 1 addition & 1 deletion app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def processing_configuration
]
end

def avalaible_ocr_languages
def available_ocr_languages
ABBYY_LANGUAGES.map { |lang| [lang, lang.gsub(/[ ()]/, '')] }
end
end
4 changes: 2 additions & 2 deletions app/views/batch_contexts/_new_bc_form.erb
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@
<button aria-label="toggle dropdown" class="btn btn-link text-secondary bg-white" data-action="click->caption#languageDropdown" aria-label="">
<i class="fas fa-search"></i>
</button>
<input data-action="input->caption#search focus->caption#languageDropdown" aria-label="Search avalaible Abbyy languages" />
<input data-action="input->caption#search focus->caption#languageDropdown" aria-label="Search available Abbyy languages" />
<button aria-label="toggle dropdown" class="btn btn-link text-secondary bg-white" data-action="click->caption#languageDropdown" id="caret">
<i class="fa-solid fa-caret-down"></i>
</button>
</div>
</div>
<div id="ocr-languages" data-caption-target="dropdownContent" class="dropdown-content d-none languages-group border rounded bg-white">
<% avalaible_ocr_languages.each do |language| %>
<% available_ocr_languages.each do |language| %>
<label class="d-block">
<%= form.check_box 'ocr_languages', { multiple: true, data: { 'caption-target': 'ocrLanguages', 'ocr-label': language[0], 'ocr-value': language[1], action: 'change->caption#languageUpdate' } }, language[1], nil %>
<%= language[0] %>
Expand Down

0 comments on commit 5bd5e63

Please sign in to comment.