Skip to content

Commit 040b9cc

Browse files
authored
ECHO-708 Join Slack community option addition (#472)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added a "Join the Slack community" header menu item for one-click access to the community workspace. * **Chores** * Added a configurable Slack invite URL environment setting. * Instrumented analytics for the Slack join action. * Added translations for the new UI strings across German, Spanish, French, Italian, and Dutch. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 9f1dcbd commit 040b9cc

16 files changed

Lines changed: 377 additions & 281 deletions

File tree

echo/frontend/.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ VITE_ENABLE_WEBHOOKS=0
1111
# Set to "1" to enable the Agentic chat mode in the chat interface
1212
VITE_ENABLE_AGENTIC_CHAT=0
1313

14+
# Community Slack invite URL (override if the link expires)
15+
# VITE_COMMUNITY_SLACK_URL=https://join.slack.com/t/dembranecommunity/shared_invite/...
16+
1417
# Other environment variables can be found in src/config.ts
1518
# Examples:
1619
# VITE_USE_PARTICIPANT_ROUTER=1

echo/frontend/src/components/layout/Header.tsx

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
import { t } from "@lingui/core/macro";
22
import { Trans } from "@lingui/react/macro";
3-
import { ActionIcon, Group, Menu, Paper, Stack, Text } from "@mantine/core";
3+
import {
4+
ActionIcon,
5+
Box,
6+
Group,
7+
Menu,
8+
Paper,
9+
Stack,
10+
Text,
11+
} from "@mantine/core";
412
import { GearSixIcon } from "@phosphor-icons/react";
513
import * as Sentry from "@sentry/react";
614
import {
715
IconBug,
816
IconLogout,
917
IconNotes,
1018
IconShieldLock,
19+
IconUsers,
1120
IconWorld,
1221
} from "@tabler/icons-react";
1322
import { useEffect } from "react";
@@ -18,9 +27,15 @@ import {
1827
useLogoutMutation,
1928
} from "@/components/auth/hooks";
2029
import { I18nLink } from "@/components/common/i18nLink";
21-
import { DIRECTUS_PUBLIC_URL, ENABLE_ANNOUNCEMENTS } from "@/config";
30+
import {
31+
COMMUNITY_SLACK_URL,
32+
DIRECTUS_PUBLIC_URL,
33+
ENABLE_ANNOUNCEMENTS,
34+
} from "@/config";
2235
import { useI18nNavigate } from "@/hooks/useI18nNavigate";
2336
import { useWhitelabelLogo } from "@/hooks/useWhitelabelLogo";
37+
import { analytics } from "@/lib/analytics";
38+
import { AnalyticsEvents as events } from "@/lib/analyticsEvents";
2439
import { testId } from "@/lib/testUtils";
2540
import { AnnouncementIcon } from "../announcement/AnnouncementIcon";
2641
import { Announcements } from "../announcement/Announcements";
@@ -221,6 +236,29 @@ const HeaderView = ({ isAuthenticated, loading }: HeaderViewProps) => {
221236
<Trans>Help us translate</Trans>
222237
</Menu.Item>
223238

239+
<Menu.Item
240+
rightSection={<IconUsers />}
241+
component="a"
242+
href={COMMUNITY_SLACK_URL}
243+
target="_blank"
244+
onClick={() => {
245+
try {
246+
analytics.trackEvent(events.JOIN_SLACK_COMMUNITY);
247+
} catch (error) {
248+
console.warn("Analytics tracking failed:", error);
249+
}
250+
}}
251+
{...testId("header-join-community-menu-item")}
252+
className="items-start gap-2"
253+
>
254+
<Box>
255+
<Trans>Join the Slack community</Trans>
256+
<Text size="xs" c="dimmed">
257+
<Trans>10+ members have joined</Trans>
258+
</Text>
259+
</Box>
260+
</Menu.Item>
261+
224262
<Menu.Item
225263
rightSection={<IconLogout />}
226264
onClick={handleLogout}

echo/frontend/src/config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ export const PRIVACY_POLICY_URL =
3838
export const PLAUSIBLE_API_HOST =
3939
import.meta.env.VITE_PLAUSIBLE_API_HOST ?? "https://plausible.io";
4040

41+
export const COMMUNITY_SLACK_URL =
42+
import.meta.env.VITE_COMMUNITY_SLACK_URL ??
43+
"https://join.slack.com/t/dembranecommunity/shared_invite/zt-3qzvryh8l-M6w3u5BvuM8LssOhMbJGgQ";
44+
4145
export const DEBUG_MODE = import.meta.env.VITE_DEBUG_MODE === "1";
4246

4347
export const ENABLE_CHAT_AUTO_SELECT = false;

echo/frontend/src/lib/analyticsEvents.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ export const AnalyticsEvents = {
1818
// Dynamic Templates
1919
DYNAMIC_TEMPLATE_USED: "Dynamic Template Used",
2020
EDIT_REPORT: "Edit Report",
21+
22+
// Community
23+
JOIN_SLACK_COMMUNITY: "Join Slack Community",
2124
LIBRARY_CONTACT_SALES: "Library Contact Sales Click",
2225
MOVE_TO_ANOTHER_PROJECT: "Move to Another Project",
2326

@@ -27,13 +30,13 @@ export const AnalyticsEvents = {
2730
// Summary & Report
2831
REGENERATE_SUMMARY: "Regenerate Summary",
2932

33+
// Transcription
34+
RETRANSCRIBE_CONVERSATION: "Retranscribe Conversation",
35+
3036
// Select All
3137
SELECT_ALL_CLICK: "Select All Click",
3238
SELECT_ALL_CONFIRM: "Select All Confirm",
3339
SELECT_ALL_ERROR: "Select All Error",
3440
SELECT_ALL_SUCCESS: "Select All Success",
35-
36-
// Transcription
37-
RETRANSCRIBE_CONVERSATION: "Retranscribe Conversation",
3841
UPDATE_REPORT: "Update Report",
3942
};

0 commit comments

Comments
 (0)