Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

fix(featured): update missing i18n strings + add badge dot in pending feature tab

Gabe Kangas5322cb1ddd00
diff --git a/web/i18n/en/translation.json b/web/i18n/en/translation.json
index 1afb9b6a3d..d4a99df83f 100644
--- a/web/i18n/en/translation.json
+++ b/web/i18n/en/translation.json
@@ -49,9 +49,12 @@
"confirmYes": "Yes",
"enterStreamUrl": "Please enter a stream URL",
"enterValidUrl": "Please enter a valid URL",
- "failedToApprove": "<strong><em>Missing translation Admin.FeaturedStreams.failedToApprove: Please report</em></strong>",
+ "failedToApprove": "Failed to approve the feature request",
"failedToFeature": "Failed to feature stream",
- "failedToUnfeature": "<strong><em>Missing translation Admin.FeaturedStreams.failedToUnfeature: Please report</em></strong>",
+ "failedToReject": "Failed to reject the feature request",
+ "failedToUnfeature": "Failed to unfeature the stream",
+ "featureRequestApproved": "Feature request approved",
+ "featureRequestRejected": "Feature request rejected",
"featureRequestsDescription": "These Owncast servers have asked to show your stream in their featured streams directory. Approve a server to let it display your live status.",
"featureRequestsTitle": "Requests to feature your stream",
"streamsYouFeatureTab": "Streams you feature",
@@ -85,10 +88,10 @@
"socialFeaturesRequired": "Social features must be enabled",
"socialFeaturesRequiredDesc": "before you can feature other streams.",
"status": "Status",
- "streamFeaturedSuccess": "<strong><em>Missing translation Admin.FeaturedStreams.streamFeaturedSuccess: Please report</em></strong>",
+ "streamFeaturedSuccess": "Stream featured",
"streamName": "Stream Name",
"streamRequirements": "Stream Requirements",
- "streamUnfeaturedSuccess": "<strong><em>Missing translation Admin.FeaturedStreams.streamUnfeaturedSuccess: Please report</em></strong>",
+ "streamUnfeaturedSuccess": "Stream unfeatured",
"streamUrlHelp": "Enter the URL of an Owncast stream (e.g., stream.example.com)",
"streamUrlLabel": "Stream URL",
"streamUrlPlaceholder": "stream.example.com",
diff --git a/web/pages/admin/config-featured.tsx b/web/pages/admin/config-featured.tsx
index a1efd14d9c..d393c2b8a1 100644
--- a/web/pages/admin/config-featured.tsx
+++ b/web/pages/admin/config-featured.tsx
@@ -1,5 +1,5 @@
/* eslint-disable react/no-unescaped-entities */
-import { Typography, Alert, Button, Space, Tabs } from 'antd';
+import { Typography, Alert, Button, Space, Tabs, Badge } from 'antd';
import { PlusOutlined } from '@ant-design/icons';
import Link from 'next/link';
import React, { ReactElement, useContext, useState } from 'react';
@@ -48,6 +48,18 @@ const ConfigFeatured = () => {
setModalOpen(false);
};
+ // Counts shown in the tab labels so the operator can see the size of each
+ // list at a glance without opening it. "Featuring you" combines the pending
+ // requests and the directories already listing this server, since both live
+ // under that tab.
+ const featuredCount = federatedServers.length;
+ const pendingRequestCount = featureRequests.length;
+ const featuringYouCount = pendingRequestCount + directoryFollowers.length;
+
+ // Neutral count chip so it doesn't compete with the red attention dot used to
+ // flag pending requests below.
+ const countBadgeStyle = { backgroundColor: '#8c8c8c' };
+
return (
<div>
<Title>
@@ -77,10 +89,15 @@ const ConfigFeatured = () => {
{
key: 'featuring',
label: (
- <Translation
- translationKey={Localization.Admin.FeaturedStreams.streamsYouFeatureTab}
- defaultText="Streams you feature"
- />
+ <Space size={8}>
+ <Translation
+ translationKey={Localization.Admin.FeaturedStreams.streamsYouFeatureTab}
+ defaultText="Streams you feature"
+ />
+ {featuredCount > 0 && (
+ <Badge count={featuredCount} overflowCount={999} style={countBadgeStyle} />
+ )}
+ </Space>
),
children: (
<Space direction="vertical" size="large" style={{ width: '100%' }}>
@@ -107,10 +124,23 @@ const ConfigFeatured = () => {
{
key: 'featuring-you',
label: (
- <Translation
- translationKey={Localization.Admin.FeaturedStreams.featuringYouTab}
- defaultText="Featuring you"
- />
+ <Space size={8}>
+ {/* Red dot on the title draws the eye when requests are
+ waiting for approval; it clears once none are pending. */}
+ <Badge dot={pendingRequestCount > 0} offset={[2, 0]}>
+ <Translation
+ translationKey={Localization.Admin.FeaturedStreams.featuringYouTab}
+ defaultText="Featuring you"
+ />
+ </Badge>
+ {featuringYouCount > 0 && (
+ <Badge
+ count={featuringYouCount}
+ overflowCount={999}
+ style={countBadgeStyle}
+ />
+ )}
+ </Space>
),
children: (
<Space direction="vertical" size="large" style={{ width: '100%' }}>