Skip to content

Replace commas in author queries with U+2500 - #451

Open
jazairi wants to merge 1 commit into
mainfrom
use-681
Open

Replace commas in author queries with U+2500#451
jazairi wants to merge 1 commit into
mainfrom
use-681

Conversation

@jazairi

@jazairi jazairi commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Why these changes are being introduced:

Primo NDE internally replaces commas in advanced
search query terms with the box drawings light
horizontal character (U+2500). It then converts
that character back into a comma for the search
summary.

In order for our author searches to
look normal in the NDE search summary, we need
to replace them with this specific character
in the URL.

Relevant ticket(s):

How this addresses that need:

This replaces commas with U+2500 in author link
search terms.

Side effects of this change:

Ex Libris will probably change this again someday
without telling anyone.

Developer

Accessibility
  • ANDI or WAVE has been run in accordance to our guide.
  • This PR contains no changes to the view layer.
  • New issues flagged by ANDI or WAVE have been resolved.
  • New issues flagged by ANDI or WAVE have been ticketed (link in the Pull Request details above).
  • No new accessibility issues have been flagged.
New ENV
  • All new ENV is documented in README.
  • All new ENV has been added to Heroku Pipeline, Staging and Prod.
  • ENV has not changed.
Approval beyond code review
  • UXWS/stakeholder approval has been confirmed.
  • UXWS/stakeholder review will be completed retroactively.
  • UXWS/stakeholder review is not needed.
Additional context needed to review

When you follow a link to an author search in NDE, the search summary should show commas, not horizonal lines/emdashes or search-advanced.boolOperator.option..

Code Reviewer

Code
  • I have confirmed that the code works as intended.
  • Any CodeClimate issues have been fixed or confirmed as
    added technical debt.
Documentation
  • The commit message is clear and follows our guidelines
    (not just this pull request message).
  • The documentation has been updated or is unnecessary.
  • New dependencies are appropriate or there were no changes.
Testing
  • There are appropriate tests covering any new functionality.
  • No additional test coverage is required.

Why these changes are being introduced:

Primo NDE internally replaces commas in advanced
search query terms with the box drawings light
horizontal character (U+2500). It then converts
that character back into a comma for the search
summary.

In order for our author searches to
look normal in the NDE search summary, we need
to replace them with this specific character
in the URL.

Relevant ticket(s):

- [USE-681](https://mitlibraries.atlassian.net/browse/USE-681)

How this addresses that need:

This replaces commas with U+2500 in author link
search terms.

Side effects of this change:

Ex Libris will probably change this again someday
without telling anyone.
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 31513139623

Coverage increased (+0.003%) to 98.327%

Details

  • Coverage increased (+0.003%) from the base build.
  • Patch coverage: 3 of 3 lines across 1 file are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 1554
Covered Lines: 1528
Line Coverage: 98.33%
Coverage Strength: 85.97 hits per line

💛 - Coveralls

@qltysh

qltysh Bot commented Aug 11, 2026

Copy link
Copy Markdown

❌ 3 blocking issues (3 total)

Tool Category Rule Count
rubocop Lint Class has too many lines. [255/100] 1
rubocop Lint Method has too many lines. [11/10] 1
rubocop Style Line is too long. [152/120] 1

URI.encode_uri_component(author),
encode_author(author),
'&offset=0',
'&lang=en'].join

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method has too many lines. [11/10] [rubocop:Metrics/MethodLength]

normalized = NormalizePrimoRecord.new(full_record, 'test').normalize
creator_link = normalized[:creators].first[:link]
assert_match 'nde/search?vid=01MIT_INST:NDE&search_scope=all&mode=advanced&tab=all&query=creator,exact,Smith%2C%20John%20A.&offset=0&lang=en',
assert_match 'nde/search?vid=01MIT_INST:NDE&search_scope=all&mode=advanced&tab=all&query=creator,exact,Smith%E2%94%80%20John%20A.&offset=0&lang=en',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [152/120] [rubocop:Layout/LineLength]

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 this pull request may close these issues.

3 participants