Skip to content

Commit

Permalink
Merge pull request #35 from ontoportal-lirmm/fix/ecoportal-reported-bugs
Browse files Browse the repository at this point in the history
Fix: ecoportal reported bugs
  • Loading branch information
syphax-bouazzouni authored Nov 21, 2023
2 parents c89a5c4 + fff3e64 commit cac0e20
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
12 changes: 6 additions & 6 deletions app/controllers/concerns/doi_request_administration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,23 +83,23 @@ def process_identifier_requests(success_keyword, error_keyword, action)
def process_doi(doi_request)
doi_req_submission = LinkedData::Client::Models::OntologySubmission.find(doi_request.submission.id, include: 'all')
ont_submission_id = doi_req_submission.submissionId
ontology_id = doi_req_submission.ontology.id
ontology_acronym = ontology_id.split('/').last
hash_metadata = data_cite_metadata_json(ontology_acronym, ont_submission_id)
hash_metadata = data_cite_metadata_json(doi_req_submission.ontology, ont_submission_id)
if doi_request.requestType == 'DOI_CREATE'
satisfy_doi_creation_request(doi_request, hash_metadata, doi_req_submission)
elsif doi_request.requestType == 'DOI_UPDATE'
#satisfy_doi_update_request(doi_request, hash_metadata)
end
end

def data_cite_metadata_json(ontology_acronym, ont_submission_id)
def data_cite_metadata_json( ontology, ont_submission_id)
ontology_acronym = ontology.acronym
ontology_name = ontology.name
sub_metadata_url = SUB_DATA_CITE_METADATA_URL.call(ontology_acronym, ont_submission_id)
hash_metadata = LinkedData::Client::HTTP.get(sub_metadata_url, {}, raw: true)
json = JSON.parse(hash_metadata, symbolize_names: true)

json[:title] = json[:titles]&.first ? json[:titles].first[:title] : ontology_acronym
json[:url] = helpers.ontologies_url + '/' +ontology_acronym
json[:title] = ontology_name
json[:url] = json[:url] || (helpers.ontologies_url + '/' +ontology_acronym)
json
end

Expand Down
2 changes: 1 addition & 1 deletion app/helpers/agent_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def display_identifiers(identifiers, link: true)
end

def display_agent(agent, link: true)
out = agent.name.to_s.humanize
out = agent.name.to_s.titleize
identifiers = display_identifiers(agent.identifiers, link: link)
out = "#{out} (#{identifiers})" unless identifiers.empty?
affiliations = agent.affiliations.map { |a| display_agent(a, link: link) }.join(', ')
Expand Down
6 changes: 5 additions & 1 deletion app/helpers/fair_score_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ def get_fairness_service_url(apikey = user_apikey)
end
def get_fairness_json(ontologies_acronyms, apikey = user_apikey)
begin
MultiJson.load(Faraday.get(get_fairness_service_url(apikey) + "&ontologies=#{ontologies_acronyms}&combined").body.force_encoding('ISO-8859-1').encode('UTF-8'))
conn = Faraday.new do |conn|
conn.options.timeout = 1
end
response = conn.get(get_fairness_service_url(apikey) + "&ontologies=#{ontologies_acronyms}&combined")
MultiJson.load(response.body.force_encoding('ISO-8859-1').encode('UTF-8'))
rescue
Rails.logger.warn "FAIRness service issue unreachable"
{}
Expand Down
3 changes: 1 addition & 2 deletions app/views/layouts/_topnav.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,14 @@
= link_to("Annotator", annotator_index_path(), class: "dropdown-item")
- if $NCBO_ANNOTATORPLUS_ENABLED == true
= link_to("NCBO Annotator+", '/ncbo_annotatorplus', class: "dropdown-item")
= link_to("VocBench", "http://vocbench.lifewatchitaly.eu", class: "dropdown-item", target: "_blank")
%li.nav-item
= link_to("Projects", projects_path(), class: "nav-link")
%li.nav-item
= link_to("Landscape", '/landscape', class: "nav-link")
-if (!session[:user].nil? && session[:user].admin?)
%li.nav-item
= link_to("Admin", admin_index_path, class: "nav-link")
%li.nav-item
= link_to("VocBench", "http://vocbench.lifewatchitaly.eu", target: "_blank", class: "nav-link")
-# Support menu
%li.nav-item.dropdown
= link_to("#", id: "supportMenuDropdownLink", class: "nav-link dropdown-toggle", role: "button", data: {toggle: "dropdown"}, aria: {haspopup: "true", expanded: "false"}) do
Expand Down

0 comments on commit cac0e20

Please sign in to comment.