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

[i777] - collection metadata clean up #2328

Merged
merged 6 commits into from
Sep 19, 2024
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
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
Loading