From 6378f8879c38e0337af6a9f4e2f423bf49c7befa Mon Sep 17 00:00:00 2001 From: Reid Hewitt <92057378+rshewitt@users.noreply.github.com> Date: Tue, 10 Dec 2024 11:43:38 -0700 Subject: [PATCH 1/4] update dataset page title column name; update syling for download and outbound tables; fix outbound dataset page links --- _data/metrics.js | 2 +- pages/metrics/metrics_per-org.html | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/_data/metrics.js b/_data/metrics.js index 2c144f86..c7f20478 100644 --- a/_data/metrics.js +++ b/_data/metrics.js @@ -64,7 +64,7 @@ const ENUMS = { "deviceCategory": "Device Category", "activeUsers": "Users", "searchTerm": "Search Term", - "pageTitle": "Title", + "pageTitle": "Page Title", "eventCount": "Count", "organization": "Organization", "count": "Count", diff --git a/pages/metrics/metrics_per-org.html b/pages/metrics/metrics_per-org.html index ba3e8912..ba1a086d 100644 --- a/pages/metrics/metrics_per-org.html +++ b/pages/metrics/metrics_per-org.html @@ -26,7 +26,11 @@
Report Date: {{ metrics.end_date}}

{{block.meta.title}}

{{block.meta.description}}

- + {%- if cacheKey == "MOST_VIEWED_DATASETS" -%} +
+ {%- else -%} +
+ {%- endif -%} {%- else -%} From b63e274b0d325fa8b5482a492c2666dab1356006 Mon Sep 17 00:00:00 2001 From: Reid Hewitt <92057378+rshewitt@users.noreply.github.com> Date: Tue, 10 Dec 2024 12:42:42 -0700 Subject: [PATCH 2/4] Merge branch 'main' into add-dataset-title --- _data/metrics.js | 13 +++++++++++++ pages/metrics/metrics.html | 22 ++++++++++++---------- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/_data/metrics.js b/_data/metrics.js index c7f20478..f765a3e5 100644 --- a/_data/metrics.js +++ b/_data/metrics.js @@ -24,6 +24,18 @@ const REPORTS = { url: "global__device_category__last30.[end_date].csv", columnKeys: ["deviceCategory", "activeUsers", "percentage"] }, + MOST_DOWNLOADED_DATASETS: { + title: "Most Downloaded Dataset Files", + description: "Top 10 downloaded files", + url: "global__download_requests__last30.[end_date].csv", + columnKeys: ["linkUrl", "eventCount"] + }, + MOST_CLICKED_OUTBOUND_LINKS: { + title: "Most Clicked Outbound Links", + description: "Top 10 external link clicks", + url: "global__link_requests__last30.[end_date].csv", + columnKeys: ["linkUrl", "eventCount"] + }, DATASETS_PER_ORG: { title: "Number of Datasets per Organization", description: "Count of datasets by organization", @@ -36,6 +48,7 @@ const REPORTS = { url: "global__harvest_sources.[end_date].csv", columnKeys: ["organization", "count"] } + }, // ORG is a meta constructor for orgs ORG: { diff --git a/pages/metrics/metrics.html b/pages/metrics/metrics.html index 467ff7e2..9a288428 100644 --- a/pages/metrics/metrics.html +++ b/pages/metrics/metrics.html @@ -84,17 +84,19 @@

{{block.meta.title}}

{% for row in block.data offset:1 %} {% for column in row %} - {%- if block.meta.columnKeys contains block.data[0][forloop.index0] -%} - {%- if forloop.first -%} - {%- if cacheKey == "DATASETS_PER_ORG" or cacheKey == "HARVEST_SOURCES_PER_ORG" -%} - - {%- else -%} - + {%- if block.meta.columnKeys contains block.data[0][forloop.index0] -%} + {%- if forloop.first -%} + {%- if cacheKey == "DATASETS_PER_ORG" or cacheKey == "HARVEST_SOURCES_PER_ORG" -%} + + {%- elsif cacheKey == "MOST_DOWNLOADED_DATASETS" or cacheKey == "MOST_CLICKED_OUTBOUND_LINKS" -%} + + {%- else -%} + + {%- endif -%} + {%- else -%} + + {%- endif -%} {%- endif -%} - {%- else -%} - - {%- endif -%} - {%- endif -%} {% endfor %} {% endfor %} From 2eadff87fc57df92b8e11881c1c071d777957115 Mon Sep 17 00:00:00 2001 From: Reid Hewitt <92057378+rshewitt@users.noreply.github.com> Date: Wed, 11 Dec 2024 12:05:59 -0700 Subject: [PATCH 3/4] add dataset page column to global download and outbound tables --- _data/metrics.js | 4 ++-- pages/metrics/metrics.html | 21 +++++++++++++++++++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/_data/metrics.js b/_data/metrics.js index f765a3e5..e23afe29 100644 --- a/_data/metrics.js +++ b/_data/metrics.js @@ -28,13 +28,13 @@ const REPORTS = { title: "Most Downloaded Dataset Files", description: "Top 10 downloaded files", url: "global__download_requests__last30.[end_date].csv", - columnKeys: ["linkUrl", "eventCount"] + columnKeys: ["linkUrl", "pageTitle", "eventCount"] }, MOST_CLICKED_OUTBOUND_LINKS: { title: "Most Clicked Outbound Links", description: "Top 10 external link clicks", url: "global__link_requests__last30.[end_date].csv", - columnKeys: ["linkUrl", "eventCount"] + columnKeys: ["linkUrl", "pageTitle", "eventCount"] }, DATASETS_PER_ORG: { title: "Number of Datasets per Organization", diff --git a/pages/metrics/metrics.html b/pages/metrics/metrics.html index 9a288428..e5931c4c 100644 --- a/pages/metrics/metrics.html +++ b/pages/metrics/metrics.html @@ -59,7 +59,11 @@

{{ block.data[1] | toLocaleString }}

{{block.meta.title}}

{{block.meta.description}}

-
{% usa_icon 'file_download' %} Download Full Report - {{block.meta.title}} @@ -60,9 +64,13 @@

{{block.meta.title}}

{%- endif -%} {%- else -%} - {%- assign pageURL = 5 -%} + {%- if cacheKey == "MOST_DOWNLOADED_DATASETS" -%} + {%- assign pageURL = 5 -%} + {%- else -%} + {%- assign pageURL = 4 -%} + {%- endif -%} {%- if block.data[0][forloop.index0] == "pageTitle" -%} -
+ {{column | toLocaleString | replace: " - Catalog", ""}}
{{metrics.orgDict[column]}}{{column}}{{metrics.orgDict[column]}}{{column}}{{column}}{{column | toLocaleString}}{{column | toLocaleString}}
+ {%- if cacheKey == "MOST_DOWNLOADED_DATASETS" or cacheKey == "MOST_CLICKED_OUTBOUND_LINKS"-%} +
+ {%- else -%} +
+ {%- endif -%} {%- endif -%} {%- else -%} - + + {%- if cacheKey == "MOST_DOWNLOADED_DATASETS" -%} + {%- assign pageURL = 5 -%} + {%- elsif cacheKey == "MOST_CLICKED_OUTBOUND_LINKS" -%} + {%- assign pageURL = 4 -%} {%- endif -%} + {%- if block.data[0][forloop.index0] == "pageTitle" -%} + + {%- else -%} + + {%- endif -%} + {%- endif -%} + {%- endif -%} {% endfor %} From 725dce86226b23ed51e4a69e984946041d16ab29 Mon Sep 17 00:00:00 2001 From: Reid Hewitt <92057378+rshewitt@users.noreply.github.com> Date: Wed, 11 Dec 2024 13:59:26 -0700 Subject: [PATCH 4/4] move td alignment to overrides css --- pages/metrics/metrics.html | 4 ++-- pages/metrics/metrics_per-org.html | 4 ++-- styles/partials/overrides.scss | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pages/metrics/metrics.html b/pages/metrics/metrics.html index e5931c4c..50c3e3cc 100644 --- a/pages/metrics/metrics.html +++ b/pages/metrics/metrics.html @@ -105,11 +105,11 @@

{{block.meta.title}}

{%- assign pageURL = 4 -%} {%- endif -%} {%- if block.data[0][forloop.index0] == "pageTitle" -%} - {%- else -%} - + {%- endif -%} {%- endif -%} diff --git a/pages/metrics/metrics_per-org.html b/pages/metrics/metrics_per-org.html index ba1a086d..0807991a 100644 --- a/pages/metrics/metrics_per-org.html +++ b/pages/metrics/metrics_per-org.html @@ -70,11 +70,11 @@

{{block.meta.title}}

{%- assign pageURL = 4 -%} {%- endif -%} {%- if block.data[0][forloop.index0] == "pageTitle" -%} - {%- else -%} - + {%- endif -%} {%- endif -%} {%- endif -%} diff --git a/styles/partials/overrides.scss b/styles/partials/overrides.scss index 7fc24e05..364219fa 100644 --- a/styles/partials/overrides.scss +++ b/styles/partials/overrides.scss @@ -124,6 +124,10 @@ button { background-color: #fff; } +.usa-table td { + text-align: left +} + .usa-table.full-width tr { td:first-child { width: 90%;
{% usa_icon 'file_download' %} Download Full Report - {{block.meta.title}} @@ -94,8 +98,21 @@

{{block.meta.title}}

{{column}}{{column | toLocaleString}} + {{column | toLocaleString | replace: " - Catalog", ""}} + {{column | toLocaleString}}
+ {{column | toLocaleString | replace: " - Catalog", ""}} {{column | toLocaleString}}{{column | toLocaleString}} + {{column | toLocaleString | replace: " - Catalog", ""}} {{column | toLocaleString}}{{column | toLocaleString}}