Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive SKOS (Simple Knowledge Organization System) feature UIs to the ontology portal, including new concept schemes and collections interfaces, updated tree visualization components, and refactored navigation.
- Removed simple tree dependency and replaced with custom tree components
- Added new schemes and collections tabs with dedicated controllers and views
- Updated concept visualization with enhanced tree browser functionality including collection filtering and date-based sorting
Reviewed Changes
Copilot reviewed 56 out of 88 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| mise.toml | Updated Ruby version from 2.7.8 to 3.2 and removed Node.js dependency |
| config/routes.rb | Added new routes for schemes, collections, instances, and properties with AJAX endpoints |
| config/locales/en.yml | Added localization strings for schemes, collections, and concept browsers |
| app/controllers/* | Added new SchemesController and CollectionsController with SKOS functionality |
| app/views/schemes/* | New HAML templates for schemes tree view and details display |
| app/views/collections/* | New HAML templates for collections list view and details display |
| app/views/concepts/* | New templates for concept lists and date-sorted views |
| app/components/* | New ViewComponent classes for tree visualization and infinite scroll |
| app/helpers/* | New helper modules for schemes, collections, and URL management |
| app/javascript/* | Updated JavaScript controllers replacing simple tree with custom implementation |
| @@ -0,0 +1,12 @@ | |||
| - if no_collections? | |||
| = no_collections_alert | |||
| -else | |||
There was a problem hiding this comment.
Missing space after dash. Should be '- else' to match HAML syntax convention.
| -else | |
| - else |
| } | ||
|
|
||
| connect() { | ||
| console.log(this.element, "connect") |
There was a problem hiding this comment.
Console.log statement should be removed from production code or replaced with proper logging.
| ontology.explore.schemes({ include: 'all', language: request_lang}, scheme_uri) | ||
| end | ||
|
|
||
| def get_scheme_label(scheme) |
There was a problem hiding this comment.
Missing null check for scheme parameter. Should add 'return '' if scheme.nil?' at the beginning of the method.
| config.federated_portals = $PORTALS_INSTANCES ? $PORTALS_INSTANCES.map{|x| x[:api] && x[:apikey] ? [x[:name].downcase.to_sym, x] : nil }.compact.to_h : {} | ||
| end |
There was a problem hiding this comment.
Complex ternary operation with nested conditions is hard to read. Consider breaking this into multiple lines or a separate method for better maintainability.
| config.federated_portals = $PORTALS_INSTANCES ? $PORTALS_INSTANCES.map{|x| x[:api] && x[:apikey] ? [x[:name].downcase.to_sym, x] : nil }.compact.to_h : {} | |
| end | |
| config.federated_portals = build_federated_portals | |
| end | |
| def build_federated_portals | |
| return {} unless $PORTALS_INSTANCES | |
| $PORTALS_INSTANCES.map do |x| | |
| if x[:api] && x[:apikey] | |
| [x[:name].downcase.to_sym, x] | |
| else | |
| nil | |
| end | |
| end.compact.to_h | |
| end |
| @delete_mapping_permission = check_delete_mapping_permission(@mappings) | ||
| update_tab(@ontology, @concept.id) | ||
| def concepts_to_years_months(concepts) | ||
| return unless concepts || concepts.nil? |
There was a problem hiding this comment.
The condition 'unless concepts || concepts.nil?' is logically incorrect. It should be 'return {} if concepts.nil? || concepts.empty?' to properly handle empty/nil cases.
| return unless concepts || concepts.nil? | |
| return {} if concepts.nil? || concepts.empty? |
| 'class-search-auto-complete-spinner-src-value': asset_path("spinner.gif")}) | ||
|
|
||
| = hidden_field_tag("jump_to_concept_id") | ||
| - if skos? && false # disabled for now as no time to test #TODO |
There was a problem hiding this comment.
Dead code with hardcoded 'false' condition. Either remove this code block or implement proper feature flagging.
| } | ||
|
|
||
| #onClickTooManyChildrenInit () { | ||
| jQuery('.too_many_children_override').live('click', (event) => { |
There was a problem hiding this comment.
jQuery .live() method is deprecated and has been removed in jQuery 3.0. Should use .on() with event delegation instead.
| jQuery('.too_many_children_override').live('click', (event) => { | |
| jQuery(this.element).on('click', '.too_many_children_override', (event) => { |
Changes