From f8777ebe6befe9da25fef40bb118a52eafe6b1ea Mon Sep 17 00:00:00 2001 From: Juan M Date: Sat, 6 Jan 2024 00:08:46 -0300 Subject: [PATCH 1/2] Add collections metric --- src/loaders/api.js | 5 +++++ src/loaders/event.js | 1 + src/pages/Event.js | 3 +++ 3 files changed, 9 insertions(+) diff --git a/src/loaders/api.js b/src/loaders/api.js index 4aa5217..cfa4981 100644 --- a/src/loaders/api.js +++ b/src/loaders/api.js @@ -56,6 +56,7 @@ async function getEventAndOwners(eventId, includeMetrics = true) { !('emailClaimsMinted' in body.metrics) || typeof body.metrics.emailClaimsMinted !== 'number' || !('emailClaims' in body.metrics) || typeof body.metrics.emailClaims !== 'number' || !('momentsUploaded' in body.metrics) || typeof body.metrics.momentsUploaded !== 'number' || + !('collectionsIncludes' in body.metrics) || typeof body.metrics.collectionsIncludes !== 'number' || !('ts' in body.metrics) || (typeof body.metrics.ts !== 'number' && body.metrics.ts !== null) ) { return { @@ -67,6 +68,7 @@ async function getEventAndOwners(eventId, includeMetrics = true) { emailClaimsMinted: 0, emailClaims: 0, momentsUploaded: 0, + collectionsIncludes: 0, ts: null, }, } @@ -80,6 +82,7 @@ async function getEventAndOwners(eventId, includeMetrics = true) { emailClaimsMinted: body.metrics.emailClaimsMinted, emailClaims: body.metrics.emailClaims, momentsUploaded: body.metrics.momentsUploaded, + collectionsIncludes: body.metrics.collectionsIncludes, ts: body.metrics.ts, }, } @@ -340,6 +343,7 @@ async function getEventMetrics(eventId, abortSignal, refresh = false) { !('emailClaimsMinted' in metrics) || typeof metrics.emailClaimsMinted !== 'number' || !('emailClaims' in metrics) || typeof metrics.emailClaims !== 'number' || !('momentsUploaded' in metrics) || typeof metrics.momentsUploaded !== 'number' || + !('collectionsIncludes' in metrics) || typeof metrics.collectionsIncludes !== 'number' || !('ts' in metrics) || (typeof metrics.ts !== 'number' && metrics.ts !== null) ) { return null @@ -349,6 +353,7 @@ async function getEventMetrics(eventId, abortSignal, refresh = false) { emailClaimsMinted: metrics.emailClaimsMinted, emailClaims: metrics.emailClaims, momentsUploaded: metrics.momentsUploaded, + collectionsIncludes: metrics.collectionsIncludes, ts: metrics.ts, } } diff --git a/src/loaders/event.js b/src/loaders/event.js index d0552a9..e008908 100644 --- a/src/loaders/event.js +++ b/src/loaders/event.js @@ -179,6 +179,7 @@ async function eventLoader({ params, request }) { emailClaimsMinted: 0, emailClaims: 0, momentsUploaded: 0, + collectionsIncludes: 0, ts: null, }, } diff --git a/src/pages/Event.js b/src/pages/Event.js index 0c8a279..ea182df 100644 --- a/src/pages/Event.js +++ b/src/pages/Event.js @@ -274,6 +274,9 @@ function Event() { title: `${Math.trunc(metrics.emailClaimsMinted * 100 / metrics.emailClaims)}% of ${metrics.emailClaims} email claims`, } : undefined, + 'collections': metrics && metrics.collectionsIncludes > 1 + ? formatStat(metrics.collectionsIncludes) + : undefined, 'moments': metrics && metrics.momentsUploaded > 0 ? { text: formatStat(metrics.momentsUploaded), From 026b044b08e49eebc7360ca25a689492e2269fd9 Mon Sep 17 00:00:00 2001 From: Juan M Date: Sat, 6 Jan 2024 00:18:38 -0300 Subject: [PATCH 2/2] Version 1.6.15 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 86c3fda..f13dbcb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@poap-xyz/poap-family", - "version": "1.6.14", + "version": "1.6.15", "author": { "name": "POAP", "url": "https://poap.xyz"