From 97b4a8324b93b07e7654de0e5bc7ed22cb806cdf Mon Sep 17 00:00:00 2001 From: David Waring Date: Fri, 13 Dec 2024 16:22:17 -0500 Subject: [PATCH 01/10] List Manager: add filter by type --- js/source/legacy/CXGN/List.js | 57 +++++-- mason/site/list.mas | 285 ++++++++++++++++------------------ 2 files changed, 175 insertions(+), 167 deletions(-) diff --git a/js/source/legacy/CXGN/List.js b/js/source/legacy/CXGN/List.js index ba864e01e5..55db3de07a 100644 --- a/js/source/legacy/CXGN/List.js +++ b/js/source/legacy/CXGN/List.js @@ -335,8 +335,10 @@ CXGN.List.prototype = { }); }, - renderLists: function(div) { + renderLists: function(div, { type, autocreated = true } = {}) { var lists = this.availableLists(); + var types = this.allListTypes(); + var html = ''; html = html + '
'; html = html + '
'; @@ -346,25 +348,40 @@ CXGN.List.prototype = { jQuery('#'+div+'_div').html(html); } - html += '
'; + // Add list type filter + html += "
"; + html += "
"; + html += "

Filter Lists by Type:

"; + html += ""; + html += "
"; + + html += '
'; html += ''; for (var i = 0; i < lists.length; i++) { - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - if (lists[i][6] == 0){ - html += ''; - } else if (lists[i][6] == 1){ - html += ''; + if ( !type || type === lists[i][5] ) { + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + if (lists[i][6] == 0){ + html += ''; + } else if (lists[i][6] == 1){ + html += ''; + } + html += ''; } - html += ''; } html = html + '
List NameDescriptionDate CreatedDate ModifiedCountTypeValidateViewDeleteDownloadShareGroup
'+lists[i][1]+''+lists[i][2]+''+lists[i][7]+''+lists[i][8]+''+lists[i][3]+''+lists[i][5]+'
'+lists[i][1]+''+lists[i][2]+''+lists[i][7]+''+lists[i][8]+''+lists[i][3]+''+lists[i][5]+'
'; html += '
'; @@ -413,6 +430,12 @@ CXGN.List.prototype = { } jQuery("#list_group_select_action").html(list_group_select_action_html); }); + + jQuery("#render_lists_type").on("change", function() { + var type = $(this).val(); + var lo = new CXGN.List(); + lo.renderLists('list_dialog', { type }); + }); }, renderPublicLists: function(div) { diff --git a/mason/site/list.mas b/mason/site/list.mas index ca16fe9b24..bdc389837a 100644 --- a/mason/site/list.mas +++ b/mason/site/list.mas @@ -10,8 +10,7 @@