From 528f10876238a9438e5e7760ebae0ff3e3fbb482 Mon Sep 17 00:00:00 2001 From: Ashish Acharya Date: Tue, 17 Oct 2023 11:04:14 -0500 Subject: [PATCH 01/10] Remove the push to github button since it's broken --- .../static/js/collection_list.js | 28 ------------------- 1 file changed, 28 deletions(-) diff --git a/sde_indexing_helper/static/js/collection_list.js b/sde_indexing_helper/static/js/collection_list.js index cd2f127b..ad3273c6 100644 --- a/sde_indexing_helper/static/js/collection_list.js +++ b/sde_indexing_helper/static/js/collection_list.js @@ -16,34 +16,6 @@ let table = $('#collection_table').DataTable({ 'collections.json' ); } - }, - { - text: 'Push selected collections to GitHub', - action: function (e, dt, node, config) { - var collection_ids = []; - $('#collection_table').DataTable().rows({ selected: true }).every(function (rowIdx, tableLoop, rowLoop) { - var data = this.data(); - var collection_name = $(data[1]).text().slice(0, -14); // remove " chevron_right" from end of string - var collection_id = $(data[1]).attr('href').slice(1, -1); // we get /932/ from href="/932/" - var curation_status = $(data[6]).find('button').text(); - var workflow_status = $(data[7]).find('button').text(); - - if (workflow_status !== "Curated") { - toastr.error(`Can't push ${collection_name} because workflow status is not "Curated".`); - } else { - collection_ids.push(collection_id); - toastr.success(`Started pushing ${collection_name} to GitHub...`); - } - }); - $.ajax({ - url: '/api/collections/push_to_github/', - type: "POST", - data: { - collection_ids: collection_ids, - csrfmiddlewaretoken: csrftoken - }, - }); - } } ], "columnDefs": [ From 61c625431cd27a0a8ea317984959299fc72c64e6 Mon Sep 17 00:00:00 2001 From: Ashish Acharya Date: Tue, 17 Oct 2023 11:18:44 -0500 Subject: [PATCH 02/10] Get rid of extraneous columns and filters for collections --- .../static/js/collection_list.js | 19 ++--------- .../sde_collections/collection_list.html | 33 ------------------- 2 files changed, 2 insertions(+), 50 deletions(-) diff --git a/sde_indexing_helper/static/js/collection_list.js b/sde_indexing_helper/static/js/collection_list.js index ad3273c6..844da442 100644 --- a/sde_indexing_helper/static/js/collection_list.js +++ b/sde_indexing_helper/static/js/collection_list.js @@ -1,5 +1,4 @@ let table = $('#collection_table').DataTable({ - "order": [[0, 'asc']], "paging": false, "stateSave": true, "dom": 'BPfritip', @@ -19,14 +18,6 @@ let table = $('#collection_table').DataTable({ } ], "columnDefs": [ - { - target: -1, - visible: false, - }, - { - target: 3, - sortable: false, - }, { searchPanes: { options: [ @@ -74,14 +65,8 @@ let table = $('#collection_table').DataTable({ } ] }, - targets: [4] - }, - { - searchPanes: { - show: true - }, - targets: [-2] - }, + targets: [3] + } ] }); diff --git a/sde_indexing_helper/templates/sde_collections/collection_list.html b/sde_indexing_helper/templates/sde_collections/collection_list.html index 74036b77..2c5a8e7a 100644 --- a/sde_indexing_helper/templates/sde_collections/collection_list.html +++ b/sde_indexing_helper/templates/sde_collections/collection_list.html @@ -15,16 +15,12 @@

SDE Collections

- - - - @@ -32,7 +28,6 @@

SDE Collections

{% for collection in collections %} - @@ -47,33 +42,6 @@

SDE Collections

class="btn btn-sm {% if collection.num_candidate_urls > 0 %}btn-primary {% else %}disabled{% endif %}" role="button">{{ collection.num_candidate_urls }} - - - From d15080af6c02378e112cc03878c147ea911e1c22 Mon Sep 17 00:00:00 2001 From: Ashish Acharya Date: Tue, 17 Oct 2023 11:19:18 -0500 Subject: [PATCH 03/10] Turn off select for collections --- sde_indexing_helper/static/js/collection_list.js | 1 - 1 file changed, 1 deletion(-) diff --git a/sde_indexing_helper/static/js/collection_list.js b/sde_indexing_helper/static/js/collection_list.js index 844da442..5898a3b4 100644 --- a/sde_indexing_helper/static/js/collection_list.js +++ b/sde_indexing_helper/static/js/collection_list.js @@ -2,7 +2,6 @@ let table = $('#collection_table').DataTable({ "paging": false, "stateSave": true, "dom": 'BPfritip', - "select": true, "buttons": [ 'csv', { From 690b76d4dc8b05130e563759cd595fcb35de4a5a Mon Sep 17 00:00:00 2001 From: Ashish Acharya Date: Tue, 17 Oct 2023 11:45:22 -0500 Subject: [PATCH 04/10] Revert frontend changes from recent merges --- .../static/js/candidate_url_list.js | 63 ++++--------------- .../sde_collections/candidate_urls_list.html | 21 ------- 2 files changed, 13 insertions(+), 71 deletions(-) diff --git a/sde_indexing_helper/static/js/candidate_url_list.js b/sde_indexing_helper/static/js/candidate_url_list.js index 5295e22e..4f574069 100644 --- a/sde_indexing_helper/static/js/candidate_url_list.js +++ b/sde_indexing_helper/static/js/candidate_url_list.js @@ -4,8 +4,7 @@ var collection_id = getCollectionId(); var selected_text = ""; var INDIVIDUAL_URL = 1 var MULTI_URL_PATTERN = 2 -var candidate_urls_table; -var url_lists=null; + $(document).ready(function () { handleAjaxStartAndStop(); initializeDataTable(); @@ -20,7 +19,7 @@ function initializeDataTable() { var true_icon = 'check'; var false_icon = 'close'; - candidate_urls_table = $('#candidate_urls_table').DataTable({ + var candidate_urls_table = $('#candidate_urls_table').DataTable({ "scrollY": true, "serverSide": true, "stateSave": true, @@ -50,9 +49,6 @@ function initializeDataTable() { { "data": "generated_title_id", "visible": false, "searchable": false }, { "data": "match_pattern_type", "visible": false, "searchable": false }, { "data": "candidate_urls_count", "visible": false, "searchable": false }, - { "data": "inferenced_by", "visible": false, "searchable": false }, - { "data": "is_pdf", "visible": false, "searchable": false } - ], "createdRow": function (row, data, dataIndex) { if (data['excluded']) { @@ -60,7 +56,7 @@ function initializeDataTable() { } } }); -} + var exclude_patterns_table = $('#exclude_patterns_table').DataTable({ "scrollY": true, "serverSide": true, @@ -123,9 +119,9 @@ function initializeDataTable() { { "data": "id", "visible": false, "searchable": false }, ] }); +} function setupClickHandlers() { - handleInferenceButton(); handleAddNewPatternClick(); handleCreateDocumentTypePatternButton(); @@ -136,7 +132,7 @@ function setupClickHandlers() { handleDeleteExcludePatternButtonClick(); handleDeleteTitlePatternButtonClick(); - handleDocumentTypeSelect(); + handleDocumentTypeSelect() handleExcludeIndividualUrlClick(); handleNewTitleChange(); @@ -193,11 +189,10 @@ function getDocumentTypeColumn() { 3: 'Documentation', 4: 'Software and Tools', 5: 'Missions and Instruments', - 6: 'Training and Education' + 6: 'Training and Education', }; - var inferenceValue = row['inferenced_by']; button_text = data ? dict[data] : 'Select'; - button_color = inferenceValue === 'user' ? 'btn-success' : (inferenceValue === 'model' ? 'btn-primary' : 'btn-secondary'); + button_color = data ? 'btn-success' : 'btn-secondary'; return ` - -
@@ -41,20 +34,7 @@


-
Priority Name URL Division Candidate URLsNew?Status Workflow Status CuratorHas Config? Connector Type Config Folder
{{ collection.cleaning_order }} {{ collection.name }} chevron_right - {% if collection.new_collection %} - check - {% else %} - close - {% endif %} - - - {{ collection.has_sinequa_config }} {{ collection.get_connector_display }} {{ collection.config_folder }}
-
-

Document Type Inference

-
-
- User Inference:Press here for -
-
- Model's Inference:
@@ -285,7 +265,6 @@
URL