Skip to content

Commit

Permalink
Merge branch 'master' of github.com:ELIXIR-Belgium/seek into issue_15…
Browse files Browse the repository at this point in the history
…79_delete_midway_assays
  • Loading branch information
Kevin De Pelseneer committed Oct 15, 2023
2 parents 2279c2c + 56a6f0f commit 3bfd738
Show file tree
Hide file tree
Showing 175 changed files with 4,645 additions and 2,896 deletions.
130 changes: 66 additions & 64 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.2)
actioncable (6.1.7.3)
actionpack (= 6.1.7.3)
activesupport (= 6.1.7.3)
actioncable (6.1.7.6)
actionpack (= 6.1.7.6)
activesupport (= 6.1.7.6)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.1.7.3)
actionpack (= 6.1.7.3)
activejob (= 6.1.7.3)
activerecord (= 6.1.7.3)
activestorage (= 6.1.7.3)
activesupport (= 6.1.7.3)
actionmailbox (6.1.7.6)
actionpack (= 6.1.7.6)
activejob (= 6.1.7.6)
activerecord (= 6.1.7.6)
activestorage (= 6.1.7.6)
activesupport (= 6.1.7.6)
mail (>= 2.7.1)
actionmailer (6.1.7.3)
actionpack (= 6.1.7.3)
actionview (= 6.1.7.3)
activejob (= 6.1.7.3)
activesupport (= 6.1.7.3)
actionmailer (6.1.7.6)
actionpack (= 6.1.7.6)
actionview (= 6.1.7.6)
activejob (= 6.1.7.6)
activesupport (= 6.1.7.6)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (6.1.7.3)
actionview (= 6.1.7.3)
activesupport (= 6.1.7.3)
actionpack (6.1.7.6)
actionview (= 6.1.7.6)
activesupport (= 6.1.7.6)
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.3)
actionpack (= 6.1.7.3)
activerecord (= 6.1.7.3)
activestorage (= 6.1.7.3)
activesupport (= 6.1.7.3)
actiontext (6.1.7.6)
actionpack (= 6.1.7.6)
activerecord (= 6.1.7.6)
activestorage (= 6.1.7.6)
activesupport (= 6.1.7.6)
nokogiri (>= 1.8.5)
actionview (6.1.7.3)
activesupport (= 6.1.7.3)
actionview (6.1.7.6)
activesupport (= 6.1.7.6)
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.3)
activesupport (= 6.1.7.3)
activejob (6.1.7.6)
activesupport (= 6.1.7.6)
globalid (>= 0.3.6)
activemodel (6.1.7.3)
activesupport (= 6.1.7.3)
activerecord (6.1.7.3)
activemodel (= 6.1.7.3)
activesupport (= 6.1.7.3)
activemodel (6.1.7.6)
activesupport (= 6.1.7.6)
activerecord (6.1.7.6)
activemodel (= 6.1.7.6)
activesupport (= 6.1.7.6)
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.3)
actionpack (= 6.1.7.3)
activejob (= 6.1.7.3)
activerecord (= 6.1.7.3)
activesupport (= 6.1.7.3)
activestorage (6.1.7.6)
actionpack (= 6.1.7.6)
activejob (= 6.1.7.6)
activerecord (= 6.1.7.6)
activesupport (= 6.1.7.6)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (6.1.7.3)
activesupport (6.1.7.6)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
Expand Down Expand Up @@ -294,8 +294,8 @@ GEM
omniauth (>= 1.3, < 3)
pyu-ruby-sasl (>= 0.0.3.3, < 0.1)
rubyntlm (~> 0.5)
globalid (1.1.0)
activesupport (>= 5.0)
globalid (1.2.1)
activesupport (>= 6.1)
google-analytics-rails (1.1.1)
gyoku (0.4.6)
builder (>= 2.1.2)
Expand Down Expand Up @@ -459,8 +459,9 @@ GEM
mimemagic (0.3.10)
nokogiri (~> 1)
rake
mini_mime (1.1.2)
minitest (5.18.0)
mini_mime (1.1.5)
mini_portile2 (2.8.4)
minitest (5.20.0)
minitest-reporters (1.5.0)
ansi
builder
Expand All @@ -479,7 +480,7 @@ GEM
net-http-digest_auth (1.4.1)
net-http-persistent (4.0.1)
connection_pool (~> 2.2)
net-imap (0.3.4)
net-imap (0.3.7)
date
net-protocol
net-ldap (0.17.1)
Expand All @@ -492,6 +493,7 @@ GEM
netrc (0.11.0)
nio4r (2.5.9)
nokogiri (1.14.5)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
nori (1.1.5)
oauth2 (2.0.9)
Expand Down Expand Up @@ -564,7 +566,7 @@ GEM
nio4r (~> 2.0)
pyu-ruby-sasl (0.0.3.3)
racc (1.7.1)
rack (2.2.7)
rack (2.2.8)
rack-attack (6.6.0)
rack (>= 1.0, < 3)
rack-cors (1.1.1)
Expand All @@ -581,26 +583,26 @@ GEM
rack
rack-test (2.1.0)
rack (>= 1.3)
rails (6.1.7.3)
actioncable (= 6.1.7.3)
actionmailbox (= 6.1.7.3)
actionmailer (= 6.1.7.3)
actionpack (= 6.1.7.3)
actiontext (= 6.1.7.3)
actionview (= 6.1.7.3)
activejob (= 6.1.7.3)
activemodel (= 6.1.7.3)
activerecord (= 6.1.7.3)
activestorage (= 6.1.7.3)
activesupport (= 6.1.7.3)
rails (6.1.7.6)
actioncable (= 6.1.7.6)
actionmailbox (= 6.1.7.6)
actionmailer (= 6.1.7.6)
actionpack (= 6.1.7.6)
actiontext (= 6.1.7.6)
actionview (= 6.1.7.6)
activejob (= 6.1.7.6)
activemodel (= 6.1.7.6)
activerecord (= 6.1.7.6)
activestorage (= 6.1.7.6)
activesupport (= 6.1.7.6)
bundler (>= 1.15.0)
railties (= 6.1.7.3)
railties (= 6.1.7.6)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
actionview (>= 5.0.1.rc1)
activesupport (>= 5.0.1.rc1)
rails-dom-testing (2.1.1)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
Expand All @@ -622,9 +624,9 @@ GEM
json
require_all (~> 3.0)
ruby-progressbar
railties (6.1.7.3)
actionpack (= 6.1.7.3)
activesupport (= 6.1.7.3)
railties (6.1.7.6)
actionpack (= 6.1.7.6)
activesupport (= 6.1.7.6)
method_source
rake (>= 12.2)
thor (~> 1.0)
Expand Down Expand Up @@ -847,7 +849,7 @@ GEM
sparql-client (3.2.0)
net-http-persistent (~> 4.0, >= 4.0.1)
rdf (~> 3.2)
sprockets (4.2.0)
sprockets (4.2.1)
concurrent-ruby (~> 1.0)
rack (>= 2.2.4, < 4)
sprockets-rails (3.4.2)
Expand Down Expand Up @@ -886,7 +888,7 @@ GEM
tilt (2.0.10)
time (0.2.2)
date
timeout (0.3.2)
timeout (0.4.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
ucf (2.0.2)
Expand Down Expand Up @@ -934,7 +936,7 @@ GEM
hashdiff (>= 0.4.0, < 2.0.0)
webrick (1.7.0)
webrobots (0.1.2)
websocket-driver (0.7.5)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
whenever (1.0.0)
Expand All @@ -947,7 +949,7 @@ GEM
rake (>= 0.8.7)
yard (0.9.27)
webrick (~> 1.7.0)
zeitwerk (2.6.8)
zeitwerk (2.6.11)
zip-container (4.0.2)
rubyzip (~> 2.0.0)

Expand Down
2 changes: 1 addition & 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 Down
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;
}
}
Loading

0 comments on commit 3bfd738

Please sign in to comment.