Skip to content

Commit

Permalink
Merge pull request #26 from nfdi4health/merge-seek-main
Browse files Browse the repository at this point in the history
Merge seek main
  • Loading branch information
ReneHaensel authored Jan 23, 2024
2 parents 2f382cc + f3e1724 commit 3352bf4
Show file tree
Hide file tree
Showing 498 changed files with 21,267 additions and 7,833 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public/javascripts/i18n.js
public/javascripts/translations.js
public/stylesheets/*_cached.css
public/system/
public/sitemaps/*

public/assets/
public/assets_dev/
Expand Down
11 changes: 8 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ gem 'RedCloth', '>=4.3.0'
gem 'simple-spreadsheet-extractor', '~> 0.18.0'
gem 'open4'
gem 'sample-template-generator', '~>0.7'
gem 'rmagick', '4.2.5'
gem 'rmagick', '5.3.0'
gem 'rest-client', '~>2.0'
gem 'factory_bot', '~> 6.2.1'
gem 'bio', '~> 1.5.1'
Expand Down Expand Up @@ -111,6 +111,7 @@ gem 'ransack'

gem 'terser', '~> 1.1', '>= 1.1.1'


# Rails 4 upgrade
gem 'activerecord-session_store'
gem 'rails-observers'
Expand Down Expand Up @@ -155,7 +156,7 @@ gem 'remotipart', '~> 1.4.4' # Allows file upload in AJAX forms

gem 'rails-static-router'

gem 'caxlsx', '>= 3.0' # Write content to an xlsx file
gem 'caxlsx', '>= 4.0' # Write content to an xlsx file
gem 'caxlsx_rails', '~> 0.6.2'

gem 'net-ftp'
Expand All @@ -179,11 +180,13 @@ group :development do

gem 'web-console', '>= 4.1.0'
gem 'rack-mini-profiler', '~> 2.0'
gem "flamegraph", "~> 0.9.5"
gem "stackprof", "~> 0.2.25"
gem 'listen', '~> 3.3'
gem 'ruby-prof'
end

group :test do
gem 'ruby-prof'
gem 'test-prof'
gem 'rails-perftest'
gem 'minitest', '~> 5.14'
Expand All @@ -204,3 +207,5 @@ group :test, :development do
gem 'teaspoon'
gem 'teaspoon-mocha'
end

gem "sitemap_generator", "~> 6.3"
23 changes: 16 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ GIT
GEM
remote: https://rubygems.org/
specs:
RedCloth (4.3.2)
RedCloth (4.3.3)
actioncable (6.1.7.6)
actionpack (= 6.1.7.6)
activesupport (= 6.1.7.6)
Expand Down Expand Up @@ -168,7 +168,7 @@ GEM
builder (3.2.4)
case_transform (0.2)
activesupport
caxlsx (3.3.0)
caxlsx (4.0.0)
htmlentities (~> 4.3, >= 4.3.4)
marcel (~> 1.0)
nokogiri (~> 1.10, >= 1.10.4)
Expand Down Expand Up @@ -286,6 +286,7 @@ GEM
loofah (>= 2.3.1)
sax-machine (>= 1.0)
ffi (1.15.5)
flamegraph (0.9.5)
fssm (0.2.10)
gem-licenses (0.2.2)
gitlab_omniauth-ldap (2.2.0)
Expand Down Expand Up @@ -490,7 +491,7 @@ GEM
net-smtp (0.3.3)
net-protocol
netrc (0.11.0)
nio4r (2.5.9)
nio4r (2.7.0)
nokogiri (1.14.5)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
Expand Down Expand Up @@ -543,6 +544,7 @@ GEM
rack
rake (>= 0.8.1)
pg (1.3.1)
pkg-config (1.5.5)
pothoven-attachment_fu (3.3.2)
pr_geohash (1.0.0)
private_address_check (0.5.0)
Expand All @@ -561,7 +563,7 @@ GEM
psych (5.1.0)
stringio
public_suffix (5.0.0)
puma (5.6.7)
puma (5.6.8)
nio4r (~> 2.0)
pyu-ruby-sasl (0.0.3.3)
racc (1.7.1)
Expand Down Expand Up @@ -728,7 +730,8 @@ GEM
nokogiri
rexml (3.2.5)
rfc-822 (0.4.1)
rmagick (4.2.5)
rmagick (5.3.0)
pkg-config (~> 1.4)
ro-bundle (0.3.0)
addressable (~> 2.8.0)
json (~> 2.3.0)
Expand Down Expand Up @@ -830,6 +833,8 @@ GEM
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.3)
sitemap_generator (6.3.0)
builder (~> 3.0)
slop (3.6.0)
snaky_hash (2.0.0)
hashie
Expand All @@ -854,6 +859,7 @@ GEM
activesupport (>= 5.2)
sprockets (>= 3.0.0)
sqlite3 (1.4.2)
stackprof (0.2.25)
stringio (3.0.1)
sunspot (2.6.0)
pr_geohash (~> 1.0)
Expand Down Expand Up @@ -973,7 +979,7 @@ DEPENDENCIES
bootsnap (>= 1.4.4)
bootstrap-sass (>= 3.4.1)
bundler (>= 1.8.4)
caxlsx (>= 3.0)
caxlsx (>= 4.0)
caxlsx_rails (~> 0.6.2)
cff (~> 0.9.0)
citeproc-ruby (~> 2.0.0)
Expand All @@ -992,6 +998,7 @@ DEPENDENCIES
exception_notification
factory_bot (~> 6.2.1)
feedjira
flamegraph (~> 0.9.5)
fleximage!
fssm
gem-licenses
Expand Down Expand Up @@ -1063,7 +1070,7 @@ DEPENDENCIES
responders
rest-client (~> 2.0)
rfc-822
rmagick (= 4.2.5)
rmagick (= 5.3.0)
ro-bundle (~> 0.3.0)
ro-crate (~> 0.5.1)
rspec-rails (~> 5.1)
Expand All @@ -1077,8 +1084,10 @@ DEPENDENCIES
seedbank
simple-spreadsheet-extractor (~> 0.18.0)
simplecov
sitemap_generator (~> 6.3)
sprockets-rails
sqlite3 (~> 1.4)
stackprof (~> 0.2.25)
stringio (= 3.0.1)
sunspot_matchers
sunspot_rails
Expand Down
4 changes: 3 additions & 1 deletion app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
//= require calendar
//= require inplace
//= require strain
//= require checkbox
//= require batch_asset_selection
//= require cytoscape.js-2.5.0/cytoscape
//= require cytoscape_isa_graph
//= require bives
Expand All @@ -75,3 +75,5 @@
//= require git
//= require jquery.splitter/jquery.splitter.min
//= require select2.full.min
//= require licenses
//= require svg-pan-zoom-3.6.1/svg-pan-zoom.min
20 changes: 20 additions & 0 deletions app/assets/javascripts/application_shared.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ function digValue(object, path) {
elements.removeClass(cssClass)
}, 1100);
};

// Fixes select2 in modals: https://github.com/select2/select2/issues/1436
$j.fn.modal.Constructor.prototype.enforceFocus = function () {};
}(jQuery));

$j(document).ready(function () {
Expand Down Expand Up @@ -399,6 +402,23 @@ $j(document).ready(function () {
$j('#sidebar-toggle').click(Sidebar.toggle);
$j('#sidebar-close').click(Sidebar.toggle);
$j(document).on('click', '.sidebar-backdrop', Sidebar.toggle);

Licenses.init();

$j('.svg-pan-zoom').each(function () {
// Does not seem to work using jQuery load event, so doing it vanilla way
this.addEventListener('load', function () {
svgPanZoom(this, {
zoomEnabled: true,
dblClickZoomEnabled: true,
mouseWheelZoomEnabled: false,
controlIconsEnabled: true,
contain: false,
fit: true
});
});
});
});


var URL_ROOT = '<%= Rails.application.config.relative_url_root %>';
121 changes: 121 additions & 0 deletions app/assets/javascripts/batch_asset_selection.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
$j(document).ready(function () {
$j('.batch-selection-select-children').click(BatchAssetSelection.selectChildren);
$j('.batch-selection-deselect-children').click(BatchAssetSelection.deselectChildren);
$j('.batch-selection-collapse-children').click(BatchAssetSelection.collapseRecursively);
$j('.batch-selection-expand-children').click(BatchAssetSelection.expandRecursively);
$j('.batch-selection-show-permissions').click(function (event) {
event.preventDefault();
$j('.batch-selection-permission-list', $j(this).closest('.batch-selection-scope')).show();
})
$j('.batch-selection-hide-permissions').click(function (event) {
event.preventDefault();
$j('.batch-selection-permission-list', $j(this).closest('.batch-selection-scope')).hide();
})
$j('.batch-selection-hide-blocked').click(BatchAssetSelection.hideBlocked).click(); // Trigger on page load
$j('.batch-selection-show-blocked').click(BatchAssetSelection.showBlocked);
$j('.batch-selection-collapse-toggle').click(function () {
BatchAssetSelection.toggleCollapse(this);
return false;
});
$j('.batch-selection-check-btn').click(function (event) {
if (event.target.nodeName.includes('BUTTON')) {
$j(this).find(':checkbox').click();
}
});
$j('.batch-selection-check-btn :checkbox').click(function () {
BatchAssetSelection.checkRepeatedItems(this.className, this.checked);
});
$j('.batch-selection-managed-by-toggle').click(function (event) {
event.preventDefault();
$j('.batch-selection-managed-by-list:first', $j(this).closest('.batch-selection-scope')).toggle();
});
$j('.batch-selection-permissions-toggle').click(function (event) {
event.preventDefault();
$j('.batch-selection-permission-list:first', $j(this).closest('.batch-selection-scope')).toggle();
});
});

const BatchAssetSelection = {
blockedSelectors: '.not-visible, .not-manageable, .already-published',
selectChildren: function (event) {
event.preventDefault();
BatchAssetSelection.setChildren($j(this).closest('.batch-selection-scope'), true);
},

deselectChildren: function (event) {
event.preventDefault();
BatchAssetSelection.setChildren($j(this).closest('.batch-selection-scope'), false);
},

setChildren: function (scope, value) {
const children = $j(':checkbox', scope);
const classes = new Set();
for (let child of children) {
classes.add(child.className);
}

classes.forEach(c => BatchAssetSelection.checkRepeatedItems(c, value));
},

checkRepeatedItems: function (className, check) {
document.getElementById('batch-asset-selection')
.querySelectorAll('.' + className).forEach(e => e.checked = check);
},

toggleManagers: function () {
$j('.batch-selection-managed-by-list', $j(this).closest('.batch-selection-asset')).toggle();

return false;
},

toggleCollapse: function (element, state) {
if (state === undefined) {
state = !element.classList.contains('open');
}
element.classList.toggle('open', state);
$j(element).closest('.batch-selection-scope').children('.batch-selection-collapse').toggle(state);
},

collapseRecursively: function () {
const scope = $j(this).closest('.batch-selection-scope').children('.batch-selection-collapse');
const toggles = $j('.batch-selection-collapse-toggle', scope);
for (let toggle of toggles) {
BatchAssetSelection.toggleCollapse(toggle, false);
}

return false;
},

expandRecursively: function () {
const scope = $j(this).closest('.batch-selection-scope').children('.batch-selection-collapse');
const toggles = $j('.batch-selection-collapse-toggle', scope);
for (let toggle of toggles) {
BatchAssetSelection.toggleCollapse(toggle, true);
}

return false;
},

hideBlocked: function () {
const children = $j(this).closest('.batch-selection-scope')
.find(BatchAssetSelection.blockedSelectors)
.closest('.batch-selection-asset');
for (let child of children) {
const element = $j(child);
// Don't hide if any non-blocked children
if (!$j(':checkbox', element).length) {
element.hide();
}
}

return false;
},

showBlocked: function () {
$j(this).closest('.batch-selection-scope')
.find(BatchAssetSelection.blockedSelectors)
.closest('.batch-selection-asset').show();

return false;
}
}
42 changes: 0 additions & 42 deletions app/assets/javascripts/checkbox.js

This file was deleted.

Loading

0 comments on commit 3352bf4

Please sign in to comment.