From 81571c3e282e92640b4e8a944ecef1770b2055e1 Mon Sep 17 00:00:00 2001 From: Dhanur Sharma Date: Thu, 2 Jan 2025 12:06:19 -0600 Subject: [PATCH 01/35] Added column for TDAMM tags --- .../static/css/delta_url_list.css | 13 +++++++++++++ sde_indexing_helper/static/js/delta_url_list.js | 17 +++++++++++++++++ .../sde_collections/delta_urls_list.html | 4 ++++ 3 files changed, 34 insertions(+) diff --git a/sde_indexing_helper/static/css/delta_url_list.css b/sde_indexing_helper/static/css/delta_url_list.css index 06689207..8fed929a 100644 --- a/sde_indexing_helper/static/css/delta_url_list.css +++ b/sde_indexing_helper/static/css/delta_url_list.css @@ -451,3 +451,16 @@ div.dt-container div.dt-paging ul.pagination { max-width: 100%; min-width: 100%; } + +.table_filter_row_input { + width: 100%; +} + +.tdamm-tags { + color: white; + background-color: #3F4A58; + padding: 2px 6px; + border-radius: 4px; + margin: 2px; + display: inline-block; +} diff --git a/sde_indexing_helper/static/js/delta_url_list.js b/sde_indexing_helper/static/js/delta_url_list.js index e27ed72f..b6347ac2 100644 --- a/sde_indexing_helper/static/js/delta_url_list.js +++ b/sde_indexing_helper/static/js/delta_url_list.js @@ -257,6 +257,7 @@ function initializeDataTable() { getScrapedTitleColumn(), getGeneratedTitleColumn(), getDocumentTypeColumn(), + getTdammTagColumn(), getDivisionColumn(), { data: "id", visible: false, searchable: false }, { data: "generated_title_id", visible: false, searchable: false }, @@ -472,6 +473,7 @@ function initializeDataTable() { getCuratedScrapedTitleColumn(), getCuratedGeneratedTitleColumn(), getCuratedDocumentTypeColumn(), + getTdammTagColumn(), getCuratedDivisionColumn(), { data: "id", visible: false, searchable: false }, { data: "generated_title_id", visible: false, searchable: false }, @@ -787,6 +789,10 @@ function initializeDataTable() { title_patterns_table.columns(2).search(this.value).draw(); }); + $("#deltaTdammTagFilter").on("beforeinput", DataTable.util.debounce(function (val) { + delta_urls_table.column('tdamm_tag:name').search(this.value).draw(); + }, 1000)); + var document_type_patterns_table = $( "#document_type_patterns_table" ).DataTable({ @@ -1304,6 +1310,17 @@ function getCuratedExcludedColumn(true_icon, false_icon) { }; } +function getTdammTagColumn() { + return { + data: "tdamm_tag", + width: "10%", + className: "text-center whiteText", // Changed from class to className + render: function (data, type, row) { + return data && data.length ? data.join(", ") : "None"; + } + }; +} + function getDocumentTypeColumn() { return { data: "document_type", diff --git a/sde_indexing_helper/templates/sde_collections/delta_urls_list.html b/sde_indexing_helper/templates/sde_collections/delta_urls_list.html index 20bfc6e5..9df45049 100644 --- a/sde_indexing_helper/templates/sde_collections/delta_urls_list.html +++ b/sde_indexing_helper/templates/sde_collections/delta_urls_list.html @@ -112,6 +112,7 @@

Scraped Title
New Title
Document Type
+
TDAMM Tags
Division
ID
@@ -145,6 +146,7 @@

+ + - + + + - + + + + + + + + + + + + + + @@ -440,6 +487,7 @@

  • Create Title Pattern
  • Create Document Type Pattern
  • Create Division Pattern
  • +
  • Create TDAMM Tag Pattern
  • - +