Skip to content

Commit

Permalink
Merge pull request #375 from GSA/two-global-reports
Browse files Browse the repository at this point in the history
add two more global reports
  • Loading branch information
FuhuXia authored Dec 9, 2024
2 parents ef644c8 + 82cf865 commit f39bf0a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
13 changes: 13 additions & 0 deletions _data/metrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -36,6 +48,7 @@ const REPORTS = {
url: "global__harvest_sources.[end_date].csv",
columnKeys: ["organization", "count"]
}

},
// ORG is a meta constructor for orgs
ORG: {
Expand Down
22 changes: 12 additions & 10 deletions pages/metrics/metrics.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,19 @@ <h4>{{block.meta.title}}</h4>
{% for row in block.data offset:1 %}
<tr>
{% 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" -%}
<td><a href="{{helpers.baseUrl}}/metrics/organization/{{column}}/index.html">{{metrics.orgDict[column]}}</a></td>
{%- else -%}
<td>{{column}}</td>
{%- if block.meta.columnKeys contains block.data[0][forloop.index0] -%}
{%- if forloop.first -%}
{%- if cacheKey == "DATASETS_PER_ORG" or cacheKey == "HARVEST_SOURCES_PER_ORG" -%}
<td><a href="{{helpers.baseUrl}}/metrics/organization/{{column}}/index.html">{{metrics.orgDict[column]}}</a></td>
{%- elsif cacheKey == "MOST_DOWNLOADED_DATASETS" or cacheKey == "MOST_CLICKED_OUTBOUND_LINKS" -%}
<td><a href="{{column}}">{{column}}</a></td>
{%- else -%}
<td>{{column}}</td>
{%- endif -%}
{%- else -%}
<td align="right">{{column | toLocaleString}}</td>
{%- endif -%}
{%- endif -%}
{%- else -%}
<td align="right">{{column | toLocaleString}}</td>
{%- endif -%}
{%- endif -%}
{% endfor %}
</tr>
{% endfor %}
Expand Down

0 comments on commit f39bf0a

Please sign in to comment.