Skip to content

Conversation

@jazairi
Copy link
Contributor

@jazairi jazairi commented Oct 22, 2025

Why these changes are being introduced:

GeoData and USE UI currently share search form input and submit fields.
These fields should be isolated for UXWS to easily make tweaks to the
form for USE UI that won't affect GeoData.

Relevant ticket(s):

How this addresses that need:

This creates separate form partials for USE and GeoData to faciliate
changes to the USE form without affecting GeoData. It also moves the
USE search form to the header, which is where UXWS' designs have it.

Side effects of this change:

It's possible we may want to move the GeoData form to the header as
well, but given the tight timeline for USE UI beta, it makes sense to
focus on the USE side of things for now.

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

Please check both GeoData and USE. There should be no changes to the GeoData form. The USE form won't look right, but that's okay as Dave will be working on it shortly.

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.

@mitlib mitlib temporarily deployed to timdex-ui-pi-use-127-re-oaivhw October 22, 2025 13:42 Inactive
@jazairi jazairi force-pushed the use-127-refactor-search-form branch from 85237f3 to b9dee49 Compare October 22, 2025 15:52
@jazairi jazairi temporarily deployed to timdex-ui-pi-use-127-re-oaivhw October 22, 2025 15:53 Inactive
@jazairi jazairi changed the title Refactor search form for visual design changes Isolate search forms for visual design changes Oct 22, 2025
@coveralls
Copy link

coveralls commented Oct 22, 2025

Pull Request Test Coverage Report for Build 18750569038

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 98.301%

Totals Coverage Status
Change from base Build 18749214369: 0.0%
Covered Lines: 810
Relevant Lines: 824

💛 - Coveralls

@matt-bernhardt matt-bernhardt self-assigned this Oct 22, 2025
Copy link
Member

@matt-bernhardt matt-bernhardt left a comment

Choose a reason for hiding this comment

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

This all looks fine, my only non-blocking question is about whether we need some additional assertions in the test suite to confirm we don't leak some extra templates as logic changes down the line.

If there's an aspect of the longer term strategy that makes these assertions unnecessary, or this doesn't seem necessary, no worries.

:shipit:

assert_response :success

# Should show basic form without geo elements
assert_select 'form#search-form', { count: 1 }
Copy link
Member

Choose a reason for hiding this comment

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

Is it worth having an assertion to confirm #search-form-geo isn't present, to keep the reverse pattern from below?

assert_select 'form#search-form-geo', { count: 0 }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call!

mock_timdex_search_success
get '/results?q=test'
assert_response :success
assert_select 'form#search-form-geo', { count: 1 }
Copy link
Member

Choose a reason for hiding this comment

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

Same basic question as above - should there be an assertion that form#search-form doesn't exist in this test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed -- and it just occurred to me that the GeoData tests should go in the search_controller_geo_test file instead.

@jazairi jazairi temporarily deployed to timdex-ui-pi-use-127-re-oaivhw October 22, 2025 20:23 Inactive
@jazairi
Copy link
Contributor Author

jazairi commented Oct 22, 2025

@matt-bernhardt Thanks for the review! I think the latest commit addresses your feedback -- could you confirm? I also moved the GeoData-specific tests to the search_controller_geo_test file. (Forgot that we use separate files for GeoData and non-GeoData controller tests.)

Copy link
Member

@matt-bernhardt matt-bernhardt left a comment

Choose a reason for hiding this comment

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

Thanks! - moving the geo tests is a good call too.

:shipit:

Why these changes are being introduced:

GeoData and USE UI currently share search form input and submit fields.
These fields should be isolated for UXWS to easily make tweaks to the
form for USE UI that won't affect GeoData.

Relevant ticket(s):

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

How this addresses that need:

This creates separate form partials for USE and GeoData to faciliate
changes to the USE form without affecting GeoData. It also moves the
USE search form to the header, which is where UXWS' designs have it.

Side effects of this change:

It's possible we may want to move the GeoData form to the header as
well, but given the tight timeline for USE UI beta, it makes sense to
focus on the USE side of things for now.
@jazairi jazairi force-pushed the use-127-refactor-search-form branch from e46054a to 6b3056b Compare October 23, 2025 13:48
@jazairi jazairi temporarily deployed to timdex-ui-pi-use-127-re-oaivhw October 23, 2025 13:48 Inactive
@jazairi jazairi merged commit 01dec65 into main Oct 23, 2025
5 checks passed
@jazairi jazairi deleted the use-127-refactor-search-form branch October 23, 2025 13:49
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.

5 participants