Cap analytics timeframe label
This commit is contained in:
@@ -2883,6 +2883,7 @@
|
|||||||
"kpiLikes": "Likes",
|
"kpiLikes": "Likes",
|
||||||
"activityTitle": "Aktivitäts-Zeitachse",
|
"activityTitle": "Aktivitäts-Zeitachse",
|
||||||
"timeframe": "Letzte {{hours}} Stunden",
|
"timeframe": "Letzte {{hours}} Stunden",
|
||||||
|
"timeframeHint": "Ältere Aktivität ausgeblendet",
|
||||||
"uploadsPerHour": "Uploads pro Stunde",
|
"uploadsPerHour": "Uploads pro Stunde",
|
||||||
"noActivity": "Noch keine Uploads",
|
"noActivity": "Noch keine Uploads",
|
||||||
"emptyActionShareQr": "QR-Code teilen",
|
"emptyActionShareQr": "QR-Code teilen",
|
||||||
|
|||||||
@@ -2887,6 +2887,7 @@
|
|||||||
"kpiLikes": "Likes",
|
"kpiLikes": "Likes",
|
||||||
"activityTitle": "Activity Timeline",
|
"activityTitle": "Activity Timeline",
|
||||||
"timeframe": "Last {{hours}} hours",
|
"timeframe": "Last {{hours}} hours",
|
||||||
|
"timeframeHint": "Older activity hidden",
|
||||||
"uploadsPerHour": "Uploads per hour",
|
"uploadsPerHour": "Uploads per hour",
|
||||||
"noActivity": "No uploads yet",
|
"noActivity": "No uploads yet",
|
||||||
"emptyActionShareQr": "Share your QR code",
|
"emptyActionShareQr": "Share your QR code",
|
||||||
|
|||||||
@@ -98,7 +98,10 @@ export default function MobileEventAnalyticsPage() {
|
|||||||
const hasTimeline = timeline.length > 0;
|
const hasTimeline = timeline.length > 0;
|
||||||
const hasContributors = contributors.length > 0;
|
const hasContributors = contributors.length > 0;
|
||||||
const hasTasks = tasks.length > 0;
|
const hasTasks = tasks.length > 0;
|
||||||
const timeframeHours = resolveTimelineHours(timeline.map((point) => point.timestamp), 12);
|
const fallbackHours = 12;
|
||||||
|
const rawTimelineHours = resolveTimelineHours(timeline.map((point) => point.timestamp), fallbackHours);
|
||||||
|
const timeframeHours = Math.min(rawTimelineHours, fallbackHours);
|
||||||
|
const isTimeframeCapped = rawTimelineHours > fallbackHours;
|
||||||
|
|
||||||
// Prepare chart data
|
// Prepare chart data
|
||||||
const maxTimelineCount = resolveMaxCount(timeline.map((point) => point.count));
|
const maxTimelineCount = resolveMaxCount(timeline.map((point) => point.count));
|
||||||
@@ -144,9 +147,16 @@ export default function MobileEventAnalyticsPage() {
|
|||||||
{t('analytics.activityTitle', 'Activity Timeline')}
|
{t('analytics.activityTitle', 'Activity Timeline')}
|
||||||
</Text>
|
</Text>
|
||||||
</XStack>
|
</XStack>
|
||||||
|
<YStack space="$0.5">
|
||||||
<Text fontSize="$xs" color={muted}>
|
<Text fontSize="$xs" color={muted}>
|
||||||
{t('analytics.timeframe', 'Last {{hours}} hours', { hours: timeframeHours })}
|
{t('analytics.timeframe', 'Last {{hours}} hours', { hours: timeframeHours })}
|
||||||
</Text>
|
</Text>
|
||||||
|
{isTimeframeCapped ? (
|
||||||
|
<Text fontSize="$xs" color={muted}>
|
||||||
|
{t('analytics.timeframeHint', 'Older activity hidden')}
|
||||||
|
</Text>
|
||||||
|
) : null}
|
||||||
|
</YStack>
|
||||||
|
|
||||||
{hasTimeline ? (
|
{hasTimeline ? (
|
||||||
<YStack height={180} justifyContent="flex-end" space="$2">
|
<YStack height={180} justifyContent="flex-end" space="$2">
|
||||||
|
|||||||
Reference in New Issue
Block a user