-
Notifications
You must be signed in to change notification settings - Fork 52
Updated NeLS Integration #2167
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
Updated NeLS Integration #2167
Conversation
Waiting on create dataset, upload metadata API support
waiting for info before finishing off
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 47 out of 50 changed files in this pull request and generated 1 comment.
Files not reviewed (3)
- app/assets/javascripts/templates/nels/project.hbs: Language not supported
- app/assets/stylesheets/application.css: Language not supported
- app/assets/stylesheets/nels.css: Language not supported
Comments suppressed due to low confidence (1)
app/assets/javascripts/nels.js.erb:386
- The file extension check compares an array (returned by slice(-1)) to a string, which will always fail. Use .pop() or index [0] (e.g. filepath.split('.').pop() == extension) to correctly compare the extension.
if (filepath.split('.').slice(-1) == extension) {
app/controllers/nels_controller.rb
Outdated
rescue RuntimeError => e | ||
flash[:error] = "Something went wrong interacting with NeLS, please try again later (#{e.class.name})" | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could end up rescuing a real SEEK exception, maybe better to create a nels exception superclass and rescue that.
…red api url instead
…being raised for other cases.
exceptions related to Nels interaction are handled by before_resuce and respond with a relevant message to the user. Unexpected seek errors will raise an error and trigger an exception notifier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the NeLS integration by refactoring the views, controllers, and JavaScript to improve file uploads, downloads, and tree navigation. Key changes include updating the NeLS UI views (adding icons, modals, and better layout), revising REST client error handling and response logic in the controller, and enhancing the JavaScript tree navigation and file operations.
Reviewed Changes
Copilot reviewed 51 out of 52 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
app/views/nels/index.html.erb | Updated layout and button tags with new JS asset usage |
app/views/nels/datasets.json.jbuilder | Added icon and metadata fields for datasets |
app/views/nels/_upload*.html.erb | Introduced modals for file and metadata uploading |
app/controllers/nels_controller.rb | Refactored action methods and error handling |
app/assets/javascripts/nels.js.erb | Revised NeLS tree navigation and file download/upload logic |
Files not reviewed (1)
- app/assets/javascripts/templates/nels/project.hbs: Language not supported
app/views/nels/index.html.erb
Outdated
|
||
<div id="nels-browser"> | ||
<div class="row"> | ||
<%= button_link_to('Open in NeLS', 'nels_logo_small', Seek::Config.nels_sbi_url, options = {target: 'blank'}) %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The target attribute for external links should be '_blank' (with an underscore) rather than 'blank' to work correctly. Please update the target to '_blank'.
<%= button_link_to('Open in NeLS', 'nels_logo_small', Seek::Config.nels_sbi_url, options = {target: 'blank'}) %> | |
<%= button_link_to('Open in NeLS', 'nels_logo_small', Seek::Config.nels_sbi_url, options = {target: '_blank'}) %> |
Copilot uses AI. Check for mistakes.
No description provided.