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 @@
{{block.meta.description}}
-+ | {{column | toLocaleString | replace: " - Catalog", ""}} | {%- 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 @@|||||
{{metrics.orgDict[column]}} | - {%- else -%} -{{column}} | + {%- if block.meta.columnKeys contains block.data[0][forloop.index0] -%} + {%- if forloop.first -%} + {%- if cacheKey == "DATASETS_PER_ORG" or cacheKey == "HARVEST_SOURCES_PER_ORG" -%} +{{metrics.orgDict[column]}} | + {%- elsif cacheKey == "MOST_DOWNLOADED_DATASETS" or cacheKey == "MOST_CLICKED_OUTBOUND_LINKS" -%} +{{column}} | + {%- else -%} +{{column}} | + {%- endif -%} + {%- else -%} +{{column | toLocaleString}} | + {%- endif -%} {%- endif -%} - {%- else -%} -{{column | toLocaleString}} | - {%- endif -%} - {%- endif -%} {% endfor %}
{{column}} | {%- endif -%} {%- else -%} -{{column | toLocaleString}} | + + {%- 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" -%} ++ {{column | toLocaleString | replace: " - Catalog", ""}} + | + {%- else -%} +{{column | toLocaleString}} | + {%- 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 @@+ | {{column | toLocaleString | replace: " - Catalog", ""}} | {%- else -%} -{{column | toLocaleString}} | +{{column | toLocaleString}} | {%- 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 @@+ | {{column | toLocaleString | replace: " - Catalog", ""}} | {%- else -%} -{{column | toLocaleString}} | +{{column | toLocaleString}} | {%- 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%;