Re-enables nav-tabs for hydra apps #836
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
//= require bulkrax/application)
above the require statements for the dataTables javascript (//= require dataTables/jquery.dataTables //= require dataTables/bootstrap/3/jquery.dataTables.bootstrap
) in their localapplication.js
. This has since been updated in the generator for bulkrax so it will be in the correct place for future installations.Summary
Bootstrap's javascript files were not included by default and bulkrax was relying on the parent application for some of its js to work.
this PR includes bootstrap (and jquery dependency), makes sure they all load in the same order, and activates the nav tabs on the importer/show page.
likely reason the tabs need to be initialized separately in this case
Bootstrap's JavaScript components, including the tabs functionality, require manual initialization in certain cases. This is because the default behavior of Bootstrap's JavaScript is to automatically initialize the components on page load. However, when using frameworks like Turbolinks or loading content dynamically, the JavaScript initialization may not occur automatically.In your case, since you mentioned that you are working within a Rails gem, which is inside another Rails project, it's possible that the application's JavaScript files are not being loaded or initialized correctly due to the structure of the project or the usage of Turbolinks.
By explicitly adding the JavaScript initialization code, you ensure that the tab functionality is properly triggered when the page is loaded or when the tab links are clicked. This approach bypasses any potential conflicts or issues that may be preventing the automatic initialization.
So, while Bootstrap's tabs.js file is present in your app, adding the initialization code manually guarantees that the tab functionality is consistently applied, regardless of the project's structure or other factors that may affect the automatic initialization.
It's worth noting that Bootstrap's JavaScript components are designed to be flexible and work with different frameworks and setups. This means that manual initialization may be necessary in certain scenarios to ensure proper functionality.
Related
scientist-softserv/west-virginia-university#82
Acceptance Criteria
Videos
Before: https://share.getcloudapp.com/E0uLgQL9
After: https://share.getcloudapp.com/E0uLgQR9