Skip to content
This repository was archived by the owner on Jun 6, 2025. It is now read-only.

Conversation

@Janell-Huyck
Copy link
Contributor

@Janell-Huyck Janell-Huyck commented May 7, 2025

Jira Issue: LIBTREATDB-131

What’s changed

  • Extracted modals into their own partials under app/views/conservation_records/modals/ (in-house, external, conservators/technicians).
  • Simplified each modal to use local: true and Bootstrap’s data attributes—removed duplicated markup in show.html.erb.

Why

  • Pulling out each modal into a dedicated partial makes it easier to maintain and reason about the markup.
  • Using local: true and data attributes exclusively ensures Rails 6 compatibility now and smooth upgrade paths to Rails 7.

Test refactor

  • Introduced shared contexts and examples in spec/support/conservation_records_shared_examples.rb.
  • Split the giant request spec into two focused files (index_all_conservation_records_spec.rb and show_specific_conservation_record_spec.rb) so each test's function is clearer.
  • Switched all link/button assertions in request specs to Nokogiri-based selectors (no more Capybara matchers).

All existing behaviors are preserved; this simply reorganizes the view code and tightens up our test coverage for both the index and show pages.

@github-actions github-actions bot changed the title Libtreatdb 131 pull modals out from views LIBTREATDB-131 Libtreatdb 131 pull modals out from views May 7, 2025
Copy link
Contributor Author

Choose a reason for hiding this comment

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

public/.well-known/appspecific/com.chrome.devtools.json is simply an empty file to quiet an error being generated by the web browser.

Identify and click the Rails UJS delete link via its  and  attributes instead of an outdated ID. Wrap the click in  with retries, and assert that the repair text is removed from the page.
@Janell-Huyck Janell-Huyck changed the title LIBTREATDB-131 Libtreatdb 131 pull modals out from views WIP - LIBTREATDB-131 Libtreatdb 131 pull modals out from views May 7, 2025
Extract the record ID from  instead of using a static factory ID when constructing the delete-link . This ensures the test targets the actual URL rendered in the browser and avoids mismatches between factory IDs and UI-created records.
@Janell-Huyck Janell-Huyck changed the title WIP - LIBTREATDB-131 Libtreatdb 131 pull modals out from views LIBTREATDB-131 Libtreatdb 131 pull modals out from views May 7, 2025
@Janell-Huyck Janell-Huyck changed the title LIBTREATDB-131 Libtreatdb 131 pull modals out from views LIBTREATDB-131 pull modals out from views May 7, 2025
@Janell-Huyck
Copy link
Contributor Author

When run locally with the updated package.json for Babel version 7.27, the new extracted modals open, save, and auto-close appropriately and the database is updated correctly. Updating to Babel 7.27 is beyond the scope of this PR, but this PR needs to be merged before the Babel PR can be.

@Janell-Huyck Janell-Huyck changed the title LIBTREATDB-131 pull modals out from views LIBTREATDB-131 Hold for LIBTREATDB-140 pull modals out from views May 28, 2025
@Janell-Huyck Janell-Huyck changed the title LIBTREATDB-131 Hold for LIBTREATDB-140 pull modals out from views LIBTREATDB-131 pull modals out from views May 30, 2025
@Janell-Huyck
Copy link
Contributor Author

PR relocated to git.uc.edu

@Janell-Huyck Janell-Huyck deleted the LIBTREATDB-131-pull-modals-out-from-views branch June 5, 2025 20:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants