Skip to content

Commit

Permalink
Merge pull request #18 from ncbo/master
Browse files Browse the repository at this point in the history
A remerge of Sync: bring OntoPortal up-to-date with BioPortal releases 6.13.2 and onward
  • Loading branch information
syphax-bouazzouni authored Jan 18, 2024
2 parents 58f038e + d4732bb commit c5b46be
Show file tree
Hide file tree
Showing 63 changed files with 1,236 additions and 1,099 deletions.
7 changes: 5 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ source 'https://rubygems.org'
gem 'rails', '6.1.7.3'

gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.0.3'
gem 'terser'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# gem 'duktape'

gem 'bootstrap', '~> 4.1.0'
gem 'bootstrap', '~> 5.2.3'
gem 'chart-js-rails'
gem 'jquery-rails'
gem 'jquery-ui-rails'
Expand All @@ -26,9 +26,12 @@ gem 'select2-rails'
# To use debugger
# gem 'debugger'

gem 'base64', '0.1.0'
gem 'cube-ruby', require: 'cube'
gem 'dalli'
gem 'flamegraph'
# Version 2.1 breaks graphql-client. See: https://github.com/github/graphql-client/issues/310.
gem 'graphql', '~> 2.0.27'
gem 'graphql-client'
gem 'haml', '~> 5.1'
gem 'i18n'
Expand Down
119 changes: 61 additions & 58 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,20 @@ GEM
zeitwerk (~> 2.3)
addressable (2.8.5)
public_suffix (>= 2.0.2, < 6.0)
airbrussh (1.4.2)
airbrussh (1.5.0)
sshkit (>= 1.6.1, != 1.7.0)
ast (2.4.2)
autoprefixer-rails (10.4.13.0)
autoprefixer-rails (10.4.15.0)
execjs (~> 2)
base64 (0.1.1)
base64 (0.1.0)
bcrypt_pbkdf (1.1.0)
bootstrap (4.1.3)
autoprefixer-rails (>= 6.0.3)
popper_js (>= 1.12.9, < 2)
sass (>= 3.5.2)
bootstrap (5.2.3)
autoprefixer-rails (>= 9.1.0)
popper_js (>= 2.11.6, < 3)
sassc-rails (>= 2.0.0)
brakeman (6.0.1)
builder (3.2.4)
capistrano (3.17.3)
capistrano (3.18.0)
airbrussh (>= 1.0.0)
i18n
rake (>= 10.0.0)
Expand Down Expand Up @@ -127,18 +127,18 @@ GEM
crass (1.0.6)
cube-ruby (0.0.3)
daemons (1.4.1)
dalli (3.2.5)
date (3.3.3)
dalli (3.2.6)
date (3.3.4)
diff-lcs (1.5.0)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
domain_name (0.6.20231109)
ed25519 (1.3.0)
erubi (1.12.0)
erubis (2.7.0)
eventmachine (1.2.7)
excon (0.102.0)
execjs (2.8.1)
faraday (2.7.10)
excon (0.104.0)
execjs (2.9.1)
faraday (2.7.11)
base64
faraday-net_http (>= 2.0, < 3.1)
ruby2_keywords (>= 0.0.4)
faraday-excon (2.1.0)
Expand All @@ -147,11 +147,11 @@ GEM
faraday-multipart (1.0.4)
multipart-post (~> 2)
faraday-net_http (3.0.2)
ffi (1.15.5)
ffi (1.16.3)
flamegraph (0.9.5)
globalid (1.1.0)
activesupport (>= 5.0)
graphql (2.0.26)
globalid (1.2.1)
activesupport (>= 6.1)
graphql (2.0.27)
graphql-client (0.18.0)
activesupport (>= 3.0)
graphql
Expand Down Expand Up @@ -180,7 +180,7 @@ GEM
listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
loofah (2.21.3)
loofah (2.22.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
lz4-ruby (0.3.3)
Expand All @@ -194,46 +194,43 @@ GEM
method_source (1.0.0)
mime-types (3.5.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2023.0808)
mime-types-data (3.2023.1003)
mini_mime (1.1.5)
minitest (5.19.0)
minitest (5.20.0)
multi_json (1.15.0)
multipart-post (2.3.0)
mysql2 (0.5.5)
net-imap (0.3.7)
net-imap (0.4.5)
date
net-protocol
net-pop (0.1.2)
net-protocol
net-protocol (0.2.1)
net-protocol (0.2.2)
timeout
net-scp (4.0.0)
net-ssh (>= 2.6.5, < 8.0.0)
net-smtp (0.3.3)
net-smtp (0.4.0)
net-protocol
net-ssh (7.2.0)
netrc (0.11.0)
newrelic_rpm (9.4.2)
nio4r (2.5.9)
nokogiri (1.15.4-arm64-darwin)
racc (~> 1.4)
nokogiri (1.15.4-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.15.4-x86_64-linux)
newrelic_rpm (9.6.0)
base64
nio4r (2.6.0)
nokogiri (1.15.5-x86_64-darwin)
racc (~> 1.4)
oj (3.16.0)
oj (3.16.1)
open_uri_redirections (0.2.1)
parallel (1.23.0)
parser (3.2.2.3)
parser (3.2.2.4)
ast (~> 2.4.1)
racc
popper_js (1.16.1)
popper_js (2.11.8)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
psych (3.3.4)
public_suffix (5.0.3)
racc (1.7.1)
public_suffix (5.0.4)
racc (1.7.3)
rack (2.2.8)
rack-mini-profiler (3.1.1)
rack (>= 1.2.0)
Expand Down Expand Up @@ -272,14 +269,14 @@ GEM
rake (>= 12.2)
thor (~> 1.0)
rainbow (3.1.1)
rake (13.0.6)
rake (13.1.0)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rdoc (6.3.3)
recaptcha (5.9.0)
json
regexp_parser (2.8.1)
regexp_parser (2.8.2)
rest-client (2.1.0)
http-accept (>= 1.7.0, < 2.0)
http-cookie (>= 1.0.2, < 2.0)
Expand All @@ -303,19 +300,18 @@ GEM
rspec-mocks (~> 3.12)
rspec-support (~> 3.12)
rspec-support (3.12.1)
rubocop (1.56.2)
base64 (~> 0.1.1)
rubocop (1.57.2)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.2.3)
parser (>= 3.2.2.4)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.28.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.29.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
Expand All @@ -332,6 +328,14 @@ GEM
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
sassc (2.4.0)
ffi (~> 1.9)
sassc-rails (2.1.2)
railties (>= 4.0.0)
sassc (>= 2.0)
sprockets (> 3.0)
sprockets-rails
tilt
select2-rails (4.0.13)
sexp_processor (4.17.0)
spawnling (2.1.5)
Expand All @@ -342,42 +346,40 @@ GEM
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
sshkit (1.21.5)
sshkit (1.21.6)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
stackprof (0.2.25)
temple (0.10.2)
temple (0.10.3)
terser (1.1.19)
execjs (>= 0.3.0, < 3)
thin (1.8.2)
daemons (~> 1.0, >= 1.0.9)
eventmachine (~> 1.0, >= 1.0.4)
rack (>= 1, < 3)
thor (1.2.2)
tilt (2.2.0)
timeout (0.4.0)
thor (1.3.0)
tilt (2.3.0)
timeout (0.4.1)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
unf (0.1.4)
unf_ext
unf_ext (0.0.8.2)
unicode-display_width (2.4.2)
unicode-display_width (2.5.0)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
will_paginate (3.3.1)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.6.11)
zeitwerk (2.6.12)

PLATFORMS
arm64-darwin-22
x86_64-darwin-21
x86_64-linux

DEPENDENCIES
base64 (= 0.1.0)
bcrypt_pbkdf (>= 1.0, < 2.0)
bootstrap (~> 4.1.0)
bootstrap (~> 5.2.3)
brakeman
capistrano (~> 3.17)
capistrano-bundler
Expand All @@ -392,6 +394,7 @@ DEPENDENCIES
dalli
ed25519 (>= 1.2, < 2.0)
flamegraph
graphql (~> 2.0.27)
graphql-client
haml (~> 5.1)
html2haml
Expand Down Expand Up @@ -420,9 +423,9 @@ DEPENDENCIES
sass-rails (~> 5.0)
select2-rails
stackprof
terser
thin
uglifier (>= 1.0.3)
will_paginate (~> 3.0)

BUNDLED WITH
2.4.18
2.4.19
8 changes: 4 additions & 4 deletions app/assets/javascripts/admin/licenses.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
jQuery(".admin.index").ready(function() {

jQuery('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
var href = jQuery(e.target).data('href');
if (typeof href !== 'undefined' && href === '/admin/licenses') {
jQuery('button[data-bs-toggle="tab"]').on('shown.bs.tab', function (e) {
const target = jQuery(e.target).data('bsTarget');
if (typeof target !== 'undefined' && target === '#licensing') {
jQuery.ajax({
method: 'GET',
url: href,
url: 'admin/licenses',
success: function(data){},
error: function(data){}
});
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/bioportal.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ function bpPopWindow(e) {
newWindow.focus()
};
}
jQuery("div.footer-support, div.dropdown-menu.dropdown-menu-right").on("click", "a.pop_window", { w: "800", h: "600" }, bpPopWindow)
jQuery("div.footer-support, ul.dropdown-menu.dropdown-menu-end").on("click", "a.pop_window", { w: "800", h: "600" }, bpPopWindow)

/**************************************************************
* Standardized BP modal popups
Expand Down
6 changes: 3 additions & 3 deletions app/assets/javascripts/bp_annotatorplus.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function get_annotations() {
}

jQuery("#annotations_container").hide();
jQuery(".annotator_spinner").show();
jQuery(".annotator_spinner").css('display', 'inline-block');
ajax_process_halt();

var params = {},
Expand Down Expand Up @@ -148,12 +148,12 @@ function get_annotations() {
success: function(data) {
set_last_params(params);
display_annotations(data, bp_last_params);
jQuery(".annotator_spinner").hide(200);
jQuery(".annotator_spinner").hide();
jQuery("#annotations_container").show(300);
},
error: function(data) {
set_last_params(params);
jQuery(".annotator_spinner").hide(200);
jQuery(".annotator_spinner").hide();
jQuery("#annotations_container").hide();
jQuery("#annotator_error").html(" Problem getting annotations, please try again");
}
Expand Down
18 changes: 13 additions & 5 deletions app/assets/javascripts/bp_notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,13 +341,14 @@ function subscribeToNotes(button) {
var ontologyId = jQuery(button).attr("data-bp_ontology_id");
var isSubbed = jQuery(button).attr("data-bp_is_subbed");
var userId = jQuery(button).attr("data-bp_user_id");
let encodedUserId = encodeURIComponent(userId);

jQuery(".notes_sub_error").html("");
jQuery(".notes_subscribe_spinner").show();

jQuery.ajax({
type: "POST",
url: "/subscriptions?user_id="+userId+"&ontology_id="+ontologyId+"&subbed="+isSubbed,
url: `/subscriptions?user_id=${encodedUserId}&ontology_id=${ontologyId}&subbed=${isSubbed}`,
dataType: "json",
success: function(data) {
jQuery(".notes_subscribe_spinner").hide();
Expand All @@ -356,10 +357,17 @@ function subscribeToNotes(button) {
var subbedVal = (isSubbed == "true") ? "false" : "true";
jQuery("a.subscribe_to_notes").attr("data-bp_is_subbed", subbedVal);

// Change button text
var txt = jQuery("a.subscribe_to_notes span.ui-button-text").html();
var newButtonText = txt.match("Unsubscribe") ? txt.replace("Unsubscribe", "Subscribe") : txt.replace("Subscribe", "Unsubscribe");
jQuery("a.subscribe_to_notes span.ui-button-text").html(newButtonText);
/*
* Update link text.
* Note that there are two links that allow users to subscribe/unsubscribe from notes emails. Given any ontology,
* one link is located on the top-level Notes tab, and the other link is located on the Notes sub-tab on the
* right-hand side of the Classes tab. Both links are handled by the subscriptions controller, and the text of
* both should be updated on success.
*/
const matches = document.querySelectorAll('a.subscribe_to_notes');
matches.forEach(match => {
match.textContent = (subbedVal === 'true') ? 'Unsubscribe from notes emails' : 'Subscribe to notes emails';
});
},
error: function(data) {
jQuery(".notes_subscribe_spinner").hide();
Expand Down
4 changes: 3 additions & 1 deletion app/assets/javascripts/bp_ontology_viewer.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,9 @@ jQuery(document).ready(function() {
if (typeof jQuery.bioportal.ont_pages[content_section].init === 'function') {
jQuery.bioportal.ont_pages[content_section].init(jQuery.bioportal.ont_pages[content_section]);
}
jQuery("#ont-" + content_section + "-tab").tab("show");
const triggerEl = document.querySelector(`#navbar-ontology a[data-bs-target="#ont_${content_section}_content"]`);
const tabTrigger = new bootstrap.Tab(triggerEl);
bootstrap.Tab.getInstance(triggerEl).show();

// Retrieve AJAX content if not already displayed
if ($.QueryString["skip_ajax_tabs"] != 'true') {
Expand Down
Loading

0 comments on commit c5b46be

Please sign in to comment.