Skip to content

Commit

Permalink
Merge branch 'main' into record-make-a-copy-1396
Browse files Browse the repository at this point in the history
  • Loading branch information
stuzart committed Oct 21, 2024
2 parents 117edc1 + d9ba580 commit ffb7086
Show file tree
Hide file tree
Showing 136 changed files with 6,048 additions and 938 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ jobs:
- rake db:migrate
- rake seek:upgrade
include:
- database: postgres
suite: rails test test/unit
- database: sqlite3
suite: rails test test/unit
steps:
Expand Down
136 changes: 68 additions & 68 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -51,40 +51,40 @@ GEM
remote: https://rubygems.org/
specs:
RedCloth (4.3.3)
actioncable (6.1.7.8)
actionpack (= 6.1.7.8)
activesupport (= 6.1.7.8)
actioncable (6.1.7.9)
actionpack (= 6.1.7.9)
activesupport (= 6.1.7.9)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.1.7.8)
actionpack (= 6.1.7.8)
activejob (= 6.1.7.8)
activerecord (= 6.1.7.8)
activestorage (= 6.1.7.8)
activesupport (= 6.1.7.8)
actionmailbox (6.1.7.9)
actionpack (= 6.1.7.9)
activejob (= 6.1.7.9)
activerecord (= 6.1.7.9)
activestorage (= 6.1.7.9)
activesupport (= 6.1.7.9)
mail (>= 2.7.1)
actionmailer (6.1.7.8)
actionpack (= 6.1.7.8)
actionview (= 6.1.7.8)
activejob (= 6.1.7.8)
activesupport (= 6.1.7.8)
actionmailer (6.1.7.9)
actionpack (= 6.1.7.9)
actionview (= 6.1.7.9)
activejob (= 6.1.7.9)
activesupport (= 6.1.7.9)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (6.1.7.8)
actionview (= 6.1.7.8)
activesupport (= 6.1.7.8)
actionpack (6.1.7.9)
actionview (= 6.1.7.9)
activesupport (= 6.1.7.9)
rack (~> 2.0, >= 2.0.9)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (6.1.7.8)
actionpack (= 6.1.7.8)
activerecord (= 6.1.7.8)
activestorage (= 6.1.7.8)
activesupport (= 6.1.7.8)
actiontext (6.1.7.9)
actionpack (= 6.1.7.9)
activerecord (= 6.1.7.9)
activestorage (= 6.1.7.9)
activesupport (= 6.1.7.9)
nokogiri (>= 1.8.5)
actionview (6.1.7.8)
activesupport (= 6.1.7.8)
actionview (6.1.7.9)
activesupport (= 6.1.7.9)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
Expand All @@ -94,14 +94,14 @@ GEM
activemodel (>= 4.1, < 7.1)
case_transform (>= 0.2)
jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
activejob (6.1.7.8)
activesupport (= 6.1.7.8)
activejob (6.1.7.9)
activesupport (= 6.1.7.9)
globalid (>= 0.3.6)
activemodel (6.1.7.8)
activesupport (= 6.1.7.8)
activerecord (6.1.7.8)
activemodel (= 6.1.7.8)
activesupport (= 6.1.7.8)
activemodel (6.1.7.9)
activesupport (= 6.1.7.9)
activerecord (6.1.7.9)
activemodel (= 6.1.7.9)
activesupport (= 6.1.7.9)
activerecord-import (1.3.0)
activerecord (>= 4.2)
activerecord-session_store (2.0.0)
Expand All @@ -110,14 +110,14 @@ GEM
multi_json (~> 1.11, >= 1.11.2)
rack (>= 2.0.8, < 3)
railties (>= 5.2.4.1)
activestorage (6.1.7.8)
actionpack (= 6.1.7.8)
activejob (= 6.1.7.8)
activerecord (= 6.1.7.8)
activesupport (= 6.1.7.8)
activestorage (6.1.7.9)
actionpack (= 6.1.7.9)
activejob (= 6.1.7.9)
activerecord (= 6.1.7.9)
activesupport (= 6.1.7.9)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (6.1.7.8)
activesupport (6.1.7.9)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
Expand Down Expand Up @@ -198,7 +198,7 @@ GEM
execjs
coffee-script-source (1.12.2)
commonmarker (0.23.10)
concurrent-ruby (1.3.3)
concurrent-ruby (1.3.4)
connection_pool (2.3.0)
countries (5.2.0)
unaccent (~> 0.3)
Expand Down Expand Up @@ -322,7 +322,7 @@ GEM
httpclient (2.8.3)
httpi (1.1.1)
rack
i18n (1.14.5)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
i18n-js (3.9.0)
i18n (>= 0.6.6)
Expand Down Expand Up @@ -415,7 +415,7 @@ GEM
activesupport (>= 4)
railties (>= 4)
request_store (~> 1.0)
loofah (2.21.3)
loofah (2.22.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
macaddr (1.7.2)
Expand All @@ -429,7 +429,7 @@ GEM
net-imap
net-pop
net-smtp
marcel (1.0.2)
marcel (1.0.4)
matrix (0.4.2)
mechanize (2.8.5)
addressable (~> 2.8)
Expand Down Expand Up @@ -461,7 +461,7 @@ GEM
rake
mini_mime (1.1.5)
mini_portile2 (2.8.7)
minitest (5.20.0)
minitest (5.25.1)
minitest-reporters (1.5.0)
ansi
builder
Expand All @@ -480,19 +480,19 @@ GEM
net-http-digest_auth (1.4.1)
net-http-persistent (4.0.1)
connection_pool (~> 2.2)
net-imap (0.4.10)
net-imap (0.4.17)
date
net-protocol
net-ldap (0.17.1)
net-pop (0.1.2)
net-protocol
net-protocol (0.2.2)
timeout
net-smtp (0.4.0.1)
net-smtp (0.5.0)
net-protocol
netrc (0.11.0)
nio4r (2.7.3)
nokogiri (1.16.5)
nokogiri (1.16.7)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nori (1.1.5)
Expand Down Expand Up @@ -566,8 +566,8 @@ GEM
puma (5.6.9)
nio4r (~> 2.0)
pyu-ruby-sasl (0.0.3.3)
racc (1.8.0)
rack (2.2.9)
racc (1.8.1)
rack (2.2.10)
rack-attack (6.6.0)
rack (>= 1.0, < 3)
rack-cors (1.1.1)
Expand All @@ -584,20 +584,20 @@ GEM
rack
rack-test (2.1.0)
rack (>= 1.3)
rails (6.1.7.8)
actioncable (= 6.1.7.8)
actionmailbox (= 6.1.7.8)
actionmailer (= 6.1.7.8)
actionpack (= 6.1.7.8)
actiontext (= 6.1.7.8)
actionview (= 6.1.7.8)
activejob (= 6.1.7.8)
activemodel (= 6.1.7.8)
activerecord (= 6.1.7.8)
activestorage (= 6.1.7.8)
activesupport (= 6.1.7.8)
rails (6.1.7.9)
actioncable (= 6.1.7.9)
actionmailbox (= 6.1.7.9)
actionmailer (= 6.1.7.9)
actionpack (= 6.1.7.9)
actiontext (= 6.1.7.9)
actionview (= 6.1.7.9)
activejob (= 6.1.7.9)
activemodel (= 6.1.7.9)
activerecord (= 6.1.7.9)
activestorage (= 6.1.7.9)
activesupport (= 6.1.7.9)
bundler (>= 1.15.0)
railties (= 6.1.7.8)
railties (= 6.1.7.9)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
Expand Down Expand Up @@ -625,9 +625,9 @@ GEM
json
require_all (~> 3.0)
ruby-progressbar
railties (6.1.7.8)
actionpack (= 6.1.7.8)
activesupport (= 6.1.7.8)
railties (6.1.7.9)
actionpack (= 6.1.7.9)
activesupport (= 6.1.7.9)
method_source
rake (>= 12.2)
thor (~> 1.0)
Expand Down Expand Up @@ -855,9 +855,9 @@ GEM
sprockets (4.2.1)
concurrent-ruby (~> 1.0)
rack (>= 2.2.4, < 4)
sprockets-rails (3.4.2)
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets-rails (3.5.2)
actionpack (>= 6.1)
activesupport (>= 6.1)
sprockets (>= 3.0.0)
sqlite3 (1.4.2)
stackprof (0.2.25)
Expand Down Expand Up @@ -888,7 +888,7 @@ GEM
terser (1.1.8)
execjs (>= 0.3.0, < 3)
test-prof (1.0.7)
thor (1.3.1)
thor (1.3.2)
tilt (2.0.10)
time (0.2.2)
date
Expand Down Expand Up @@ -952,7 +952,7 @@ GEM
rails (>= 3.0)
rake (>= 0.8.7)
yard (0.9.36)
zeitwerk (2.6.16)
zeitwerk (2.6.18)
zip-container (4.0.2)
rubyzip (~> 2.0.0)

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,9 @@
//= require select2.full.min
//= require licenses
//= require svg-pan-zoom-3.6.1/svg-pan-zoom.min
//= require copasi/copasi
//= require copasi/copasijs
//= require copasi/copasi_simulation
//= require plotly-2.27.0.min
//= require extended_metadata_type

79 changes: 79 additions & 0 deletions app/assets/javascripts/copasi/copasi_simulation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
// app/assets/javascripts/copasi_simulation.js

var copasi = null;

function automaticChanged() {
var autoStepSize = document.getElementById("autoStepSize").checked;
document.getElementById("numPoints").disabled = autoStepSize;
}

function loadIntoCOPASI() {
var info = copasi.loadModel(document.getElementById("cps").value);
document.getElementById("model_name").innerHTML = "none";
if (info['status'] != "success") {
document.getElementById("simulation_error").innerHTML = "Error loading model: " + info['messages'];
document.getElementById('simulation_error').hidden = false;
}
document.getElementById("model_name").innerHTML = 'Model name: ' + info['model']['name'];
document.getElementById("copasi_version").innerHTML = 'Copasi version: ' + copasi.version;
document.getElementById('simulation_info').hidden = false;
}

function simulate() {
if (copasi == null) {
alert('There is a problem to load Copasi simulator.');
return;
}
loadIntoCOPASI();
runSimulation();
}

function runSimulation() {
var autoStepSize = document.getElementById("autoStepSize").checked;
var timeStart = parseFloat(document.getElementById("startTime").value);
var timeEnd = parseFloat(document.getElementById("endTime").value);

if (autoStepSize) {
var result = copasi.simulateYaml({
"problem": {
"AutomaticStepSize": true,
"Duration": timeEnd,
"OutputStartTime": timeStart
}
});
loadPlotFromResult(result);
return;
}

var numPoints = parseInt(document.getElementById("numPoints").value);
var result = copasi.simulateEx(timeStart, timeEnd, numPoints);
loadPlotFromResult(result);
}

function loadPlotFromResult(result) {
if (typeof result === 'string') {
result = JSON.parse(result);
}

clearResults();
document.getElementById("data").innerHTML = JSON.stringify(result);

var data = [];
for (var i = 1; i < result.num_variables; i++) {
data.push({
name: result.columns[i][0],
x: result.columns[0],
y: result.columns[i],
type: "scatter",
name: result.titles[i]
});
}

Plotly.newPlot('chart', data);
}

function clearResults() {
document.getElementById("data").innerHTML = "";
document.getElementById("chart").innerHTML = "";
}

13 changes: 13 additions & 0 deletions app/assets/javascripts/extended_metadata_type.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
var ExtendedMetadataType = {

addNewMarker: function(new_id, type) {
var isNested = (type === "ExtendedMetadata");
$j("#nested-tab, #nested-tab").parent().toggleClass("active", isNested);
$j("#nested-metadata-table").toggleClass("active in", isNested);
$j("#top-level-tab, #top-level-tab").parent().toggleClass("active", !isNested);
$j("#top-level-metadata-table").toggleClass("active in", !isNested);

var table = isNested ? $j("#nested-metadata-table") : $j("#top-level-metadata-table");
table.find("tbody td#" + new_id).append(' <sup style="color:red; font-weight:bold; font-size: 12px">new</sup>');
}
};
3 changes: 3 additions & 0 deletions app/controllers/admin_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ def update_features_enabled
Seek::Config.events_enabled = string_to_boolean params[:events_enabled]
Seek::Config.isa_enabled = string_to_boolean params[:isa_enabled]
Seek::Config.observation_units_enabled = string_to_boolean params[:observation_units_enabled]
Seek::Config.fair_data_station_enabled = string_to_boolean params[:fair_data_station_enabled]
Seek::Config.models_enabled = string_to_boolean params[:models_enabled]
Seek::Config.organisms_enabled = string_to_boolean params[:organisms_enabled]
Seek::Config.programmes_enabled = string_to_boolean params[:programmes_enabled]
Expand Down Expand Up @@ -351,6 +352,8 @@ def update_settings
Seek::Config.metadata_license = params[:metadata_license]
Seek::Config.recommended_data_licenses = params[:recommended_data_licenses]&.compact_blank
Seek::Config.recommended_software_licenses = params[:recommended_software_licenses]&.compact_blank
Seek::Config.sandbox_instance_url = params[:sandbox_instance_url]
Seek::Config.sandbox_instance_name = params[:sandbox_instance_name]
update_flag = (pubmed_email == '' || pubmed_email_valid) && (crossref_email == '' || crossref_email_valid)
update_redirect_to update_flag, 'settings'
end
Expand Down
Loading

0 comments on commit ffb7086

Please sign in to comment.