Skip to content

Feature: Add skos features UIs#49

Merged
alexskr merged 9 commits intomasterfrom
feature/add-skos
Jul 25, 2025
Merged

Feature: Add skos features UIs#49
alexskr merged 9 commits intomasterfrom
feature/add-skos

Conversation

@syphax-bouazzouni
Copy link
Contributor

@syphax-bouazzouni syphax-bouazzouni commented Jul 21, 2025

Changes

  • Removed simple tree dependency (ac54662)
  • Added schemes tab
image
  • Added collections tab
image
  • Updated concept tab with new Tree
image
  • Added the concept collection browser
image
  • Added the date history for the concepts
image

Copy link

Copilot AI left a 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 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
Copy link

Copilot AI Jul 21, 2025

Choose a reason for hiding this comment

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

Missing space after dash. Should be '- else' to match HAML syntax convention.

Suggested change
-else
- else

Copilot uses AI. Check for mistakes.
}

connect() {
console.log(this.element, "connect")
Copy link

Copilot AI Jul 21, 2025

Choose a reason for hiding this comment

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

Console.log statement should be removed from production code or replaced with proper logging.

Copilot uses AI. Check for mistakes.
ontology.explore.schemes({ include: 'all', language: request_lang}, scheme_uri)
end

def get_scheme_label(scheme)
Copy link

Copilot AI Jul 21, 2025

Choose a reason for hiding this comment

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

Missing null check for scheme parameter. Should add 'return '' if scheme.nil?' at the beginning of the method.

Copilot uses AI. Check for mistakes.
Comment on lines +11 to 12
config.federated_portals = $PORTALS_INSTANCES ? $PORTALS_INSTANCES.map{|x| x[:api] && x[:apikey] ? [x[:name].downcase.to_sym, x] : nil }.compact.to_h : {}
end
Copy link

Copilot AI Jul 21, 2025

Choose a reason for hiding this comment

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

Complex ternary operation with nested conditions is hard to read. Consider breaking this into multiple lines or a separate method for better maintainability.

Suggested change
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

Copilot uses AI. Check for mistakes.
@delete_mapping_permission = check_delete_mapping_permission(@mappings)
update_tab(@ontology, @concept.id)
def concepts_to_years_months(concepts)
return unless concepts || concepts.nil?
Copy link

Copilot AI Jul 21, 2025

Choose a reason for hiding this comment

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

The condition 'unless concepts || concepts.nil?' is logically incorrect. It should be 'return {} if concepts.nil? || concepts.empty?' to properly handle empty/nil cases.

Suggested change
return unless concepts || concepts.nil?
return {} if concepts.nil? || concepts.empty?

Copilot uses AI. Check for mistakes.
'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
Copy link

Copilot AI Jul 21, 2025

Choose a reason for hiding this comment

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

Dead code with hardcoded 'false' condition. Either remove this code block or implement proper feature flagging.

Copilot uses AI. Check for mistakes.
}

#onClickTooManyChildrenInit () {
jQuery('.too_many_children_override').live('click', (event) => {
Copy link

Copilot AI Jul 21, 2025

Choose a reason for hiding this comment

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

jQuery .live() method is deprecated and has been removed in jQuery 3.0. Should use .on() with event delegation instead.

Suggested change
jQuery('.too_many_children_override').live('click', (event) => {
jQuery(this.element).on('click', '.too_many_children_override', (event) => {

Copilot uses AI. Check for mistakes.
@alexskr alexskr merged commit a97079b into master Jul 25, 2025
2 checks passed
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.

2 participants