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

Add i18n labels for exhibit tags which are automatically added #2842

Open
jeremyf opened this issue Sep 16, 2022 · 0 comments · May be fixed by #2843
Open

Add i18n labels for exhibit tags which are automatically added #2842

jeremyf opened this issue Sep 16, 2022 · 0 comments · May be fixed by #2843

Comments

@jeremyf
Copy link

jeremyf commented Sep 16, 2022

In the following code, we are not adding label options for exhibit tags.

def add_exhibit_tags_fields(config)
# rubocop:disable Style/GuardClause
unless config.show_fields.include? :exhibit_tags
config.add_show_field :exhibit_tags, field: config.document_model.solr_field_for_tagger(exhibit),
link_to_facet: true,
separator_options: { words_connector: nil, two_words_connector: nil, last_word_connector: nil }
end
unless config.facet_fields.include? :exhibit_tags
config.add_facet_field :exhibit_tags, field: config.document_model.solr_field_for_tagger(exhibit), limit: true
end
# rubocop:enable Style/GuardClause
end

It could be that the lack of labels is not a bug as folks could add to the catalog controller the show and facet fields.

Would the following change be appropriate?

  def add_exhibit_tags_fields(config)
      # rubocop:disable Style/GuardClause
      unless config.show_fields.include? :exhibit_tags
        config.add_show_field(
          :exhibit_tags,
          field: config.document_model.solr_field_for_tagger(exhibit),
          link_to_facet: true,
          separator_options: { words_connector: nil, two_words_connector: nil, last_word_connector: nil },
          label: I18n.t('spotlight.search.fields.facet.exhibit_tags')
        )
      end

      unless config.facet_fields.include? :exhibit_tags
        config.add_facet_field(
          :exhibit_tags,
          field: config.document_model.solr_field_for_tagger(exhibit),
          limit: true,
          label: I18n.t('spotlight.search.fields.facet.exhibit_tags')
        )
      end
      # rubocop:enable Style/GuardClause
    end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant