Skip to content

Commit

Permalink
Merge branch 'development' of github.com:ontoportal-lirmm/bioportal_w…
Browse files Browse the repository at this point in the history
…eb_ui into development
  • Loading branch information
syphax-bouazzouni committed Dec 5, 2023
2 parents 0d7e29b + 814180d commit df03606
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/components/concept_details_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def initialize(id:, acronym:, properties:, top_keys:, bottom_keys:, exclude_keys
end

def add_sections(keys, &block)
scheme_set = properties_set_by_keys(keys, concept_properties)
scheme_set = properties_set_by_keys(keys, prefix_properties(concept_properties))
rows = row_hash_properties(scheme_set, concept_properties, &block)

rows.each do |row|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
%div.raw-table
- if @bottom_keys.present?
= render DropdownContainerComponent.new(title: 'Raw data', id: "accordion-#{@id}") do
- top_set, leftover_set, bottom_set = filter_properties(@top_keys, @bottom_keys, @exclude_keys, @concept_properties)
- top_set, leftover_set, bottom_set = filter_properties(@top_keys, @bottom_keys, @exclude_keys, prefix_properties(@concept_properties))
= render TableComponent.new(stripped: true) do |t|

- row_hash_properties(top_set, @acronym).each do |row|
Expand Down
25 changes: 25 additions & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -713,4 +713,29 @@ def portal_language_selector(id: 'language-select')
def attribute_enforced_values(attr)
submission_metadata.select {|x| x['@id'][attr]}.first['enforcedValues']
end

def prefix_properties(concept_properties)
modified_properties = {}

concept_properties.each do |key, value|
modified_key = key
if value.is_a?(Hash) && value.key?(:key)
key_string = value[:key].to_s
modified_key = prefix_prorperty_url(key_string, key)
modified_properties[modified_key] = value unless modified_key.nil?
end
end

return modified_properties
end

def prefix_prorperty_url(key_string, key)
return nil if key_string.include?('metadata')

namespace_key, namespace_value = RESOLVE_NAMESPACE.find { |_, value| key_string.include?(value) }
return "#{namespace_key}:#{key}" if namespace_key

key_string.split(/[#\/]/).last

end
end
2 changes: 2 additions & 0 deletions config/bioportal_config_env.rb.sample
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ $FOOTER_LINKS = {
}
}

$NOT_DOWNLOADABLE = {}

$UI_THEME = ENV['UI_THEME'] || 'ontoportal'

$HOSTNAME = ENV['API_URL']
Expand Down

0 comments on commit df03606

Please sign in to comment.