From 924f7224d851f554a5240ad114d99b48c58b61cf Mon Sep 17 00:00:00 2001 From: pcarapic15 Date: Fri, 31 Oct 2025 16:05:54 +0100 Subject: [PATCH 1/3] Use last updated date for community stats sections --- .../community-stats/CommunityStatsContent.js | 18 ++++++++++++++++-- .../community-stats/SdvCoreSection.js | 5 ++++- .../community-stats/SdvInNumbersSection.js | 5 ++++- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/components/community-stats/CommunityStatsContent.js b/src/components/community-stats/CommunityStatsContent.js index be11f429..65dfcb00 100644 --- a/src/components/community-stats/CommunityStatsContent.js +++ b/src/components/community-stats/CommunityStatsContent.js @@ -13,6 +13,7 @@ import BannerSection from "./BannerSection"; export default function CommunityStatsContent() { const [data, setData] = useState([]); const [dependenciesData, setDependenciesData] = useState([]); + const [statsDate, setStatsDate] = useState(null); const fileUrl = "https://raw.githubusercontent.com/sdv-dev/sdv-dev.github.io/gatsby-home/assets/Downloads_Summary.xlsx"; @@ -33,11 +34,21 @@ export default function CommunityStatsContent() { const firstSheet = workbook.SheetNames[0]; const thirdSheet = workbook.SheetNames[2]; + const fifthSheet = workbook.SheetNames[4]; const worksheet = workbook.Sheets[firstSheet]; const dependenciesWorksheet = workbook.Sheets[thirdSheet]; + const metaInfoWorksheet = workbook.Sheets[fifthSheet]; const rawData = XLSX.utils.sheet_to_json(worksheet); const rawDependencies = XLSX.utils.sheet_to_json(dependenciesWorksheet); + const metaInfo = XLSX.utils.sheet_to_json(metaInfoWorksheet); + + const metaMap = {}; + metaInfo.forEach((row) => { + metaMap[row.index] = row.value; + }); + const dateValue = metaMap.date; + setStatsDate(dateValue); const filtered = rawData.filter( (item) => @@ -87,11 +98,14 @@ export default function CommunityStatsContent() {
- + {/* */} {/* */} - +
diff --git a/src/components/community-stats/SdvCoreSection.js b/src/components/community-stats/SdvCoreSection.js index 1d0bce6e..5b8470e3 100644 --- a/src/components/community-stats/SdvCoreSection.js +++ b/src/components/community-stats/SdvCoreSection.js @@ -7,7 +7,7 @@ import TableRow from "../common/table/TableRow"; import TableRowCell from "../common/table/TableRowCell"; import useWindowWidth from "../../hooks/useviewport"; -export default function SdvCoreSection({ dependenciesData }) { +export default function SdvCoreSection({ dependenciesData, lastUpdatedDate }) { const currentYear = new Date().getFullYear().toString(); const metricKeys = ["toDate", "yearToDate"]; const metricLabels = ["To date", currentYear]; @@ -52,6 +52,9 @@ export default function SdvCoreSection({ dependenciesData }) {

SDV Community downloads

+

+ Last Updated: {lastUpdatedDate} +

diff --git a/src/components/community-stats/SdvInNumbersSection.js b/src/components/community-stats/SdvInNumbersSection.js index 9b4c9b23..9809adad 100644 --- a/src/components/community-stats/SdvInNumbersSection.js +++ b/src/components/community-stats/SdvInNumbersSection.js @@ -9,7 +9,7 @@ import Tab from "../common/Tab"; import useWindowWidth from "../../hooks/useviewport"; import CustomPieChart from "./CustomPieChart"; -export default function SdvInNumbersSection({ data }) { +export default function SdvInNumbersSection({ data, lastUpdatedDate }) { const currentYear = new Date().getFullYear().toString(); const metricKeys = ["toDate", "yearToDate"]; const metricLabels = ["To date", currentYear]; @@ -81,6 +81,9 @@ export default function SdvInNumbersSection({ data }) { > Learn more +

+ Last Updated: {lastUpdatedDate} +

Date: Mon, 3 Nov 2025 09:10:02 +0100 Subject: [PATCH 2/3] Improve UI for last updated pills --- src/components/community-stats/SdvCoreSection.js | 2 +- src/components/community-stats/SdvInNumbersSection.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/community-stats/SdvCoreSection.js b/src/components/community-stats/SdvCoreSection.js index 5b8470e3..b8741d46 100644 --- a/src/components/community-stats/SdvCoreSection.js +++ b/src/components/community-stats/SdvCoreSection.js @@ -52,7 +52,7 @@ export default function SdvCoreSection({ dependenciesData, lastUpdatedDate }) {

SDV Community downloads

-

+

Last Updated: {lastUpdatedDate}

diff --git a/src/components/community-stats/SdvInNumbersSection.js b/src/components/community-stats/SdvInNumbersSection.js index 9809adad..aa39a995 100644 --- a/src/components/community-stats/SdvInNumbersSection.js +++ b/src/components/community-stats/SdvInNumbersSection.js @@ -72,7 +72,7 @@ export default function SdvInNumbersSection({ data, lastUpdatedDate }) {
in numbers -
+
Learn more -

+

Last Updated: {lastUpdatedDate} -

+
Date: Mon, 3 Nov 2025 15:38:27 +0100 Subject: [PATCH 3/3] Align UI with design for last updated --- src/components/community-stats/SdvCoreSection.js | 5 +++-- src/components/community-stats/SdvInNumbersSection.js | 9 +++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/components/community-stats/SdvCoreSection.js b/src/components/community-stats/SdvCoreSection.js index b8741d46..c18189da 100644 --- a/src/components/community-stats/SdvCoreSection.js +++ b/src/components/community-stats/SdvCoreSection.js @@ -52,8 +52,9 @@ export default function SdvCoreSection({ dependenciesData, lastUpdatedDate }) {

SDV Community downloads

-

- Last Updated: {lastUpdatedDate} +

+ Last Updated:{" "} + {lastUpdatedDate}

diff --git a/src/components/community-stats/SdvInNumbersSection.js b/src/components/community-stats/SdvInNumbersSection.js index aa39a995..56225707 100644 --- a/src/components/community-stats/SdvInNumbersSection.js +++ b/src/components/community-stats/SdvInNumbersSection.js @@ -81,13 +81,14 @@ export default function SdvInNumbersSection({ data, lastUpdatedDate }) { > Learn more -
- Last Updated: {lastUpdatedDate} -
+

+ Last Updated:{" "} + {lastUpdatedDate} +

{tabs.map((t) => (