Skip to content

Commit

Permalink
Merge pull request #2328 from samvera/i777-collection-resource-rework
Browse files Browse the repository at this point in the history
[i777] - collection metadata clean up
  • Loading branch information
ShanaLMoore committed Sep 19, 2024
2 parents ec66971 + 6fda7fd commit 1ebf983
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
5 changes: 5 additions & 0 deletions app/assets/stylesheets/hyrax.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,8 @@
background: #ffff00;
font-weight: 700;
}

// to make collection form labels bold
#collection-edit-controls label.control-label {
font-weight: bold !important;
}
4 changes: 2 additions & 2 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ def hint_for(term:, record_class: nil)
def locale_for(type:, term:, record_class:)
term = term.to_s
record_class = record_class.to_s.downcase
work_or_collection = record_class == 'collection' ? 'collection' : 'defaults'
work_or_collection = record_class == Hyrax.config.collection_model.downcase ? 'collection' : 'defaults'
locale = t("hyrax.#{record_class}.#{type}.#{term}")

if missing_translation(locale)
(t("simple_form.#{type}.#{work_or_collection}.#{term}") || term.titleize) .html_safe
(t("simple_form.#{type}.#{work_or_collection}.#{term}")).try(:html_safe)
else
locale.html_safe
end
Expand Down
13 changes: 5 additions & 8 deletions spec/features/create_etd_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,17 @@
fill_in('Keyword', with: 'testing')
select('In Copyright', from: 'Rights')
fill_in('Date', with: '01/27/2021')
fill_in('Degree Name', with: 'Bachelor of Science')
fill_in('Degree Level', with: 'Undergraduate')
fill_in('Degree Discipline', with: 'Computer Science')
fill_in('Degree Grantor', with: 'University of Technology')
fill_in('Level', with: 'High')
fill_in('Discipline', with: 'Com Sci')
fill_in('Grantor', with: 'PALNI/PALCI')
fill_in('Degree name', with: 'Bachelor of Science')
fill_in('Degree level', with: 'Undergraduate')
fill_in('Degree discipline', with: 'Computer Science')
fill_in('Degree grantor', with: 'University of Technology')
select('Article', from: 'Resource type')

page.choose('etd_visibility_open')
expect(page).to have_content('Please note, making something visible to the world (i.e. marking this as Public) may be viewed as publishing which could impact your ability to')
find('#agreement').click

click_on('Save')
click_button('with_files_submit')
expect(page).to have_content('My Test Work')
expect(page).to have_content("Your files are being processed by Hyku in the background.")
end
Expand Down
7 changes: 4 additions & 3 deletions spec/helpers/application_helper_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

RSpec.describe ApplicationHelper do
RSpec.describe ApplicationHelper, type: :helper do
describe "#markdown" do
let(:header) { '# header' }
let(:bold) { '*bold*' }
Expand All @@ -13,8 +13,9 @@

describe '#local_for' do
context 'when term is missing' do
subject { helper.locale_for(type: 'labels', record_class: "account", term: :very_much_missing) }
it { is_expected.to be_a(String) }
it 'returns nil' do
expect(helper.locale_for(type: 'labels', record_class: "account", term: :very_much_missing)).to be_nil
end
end
end
end

0 comments on commit 1ebf983

Please sign in to comment.