From 5f18d7a7194422d68300072ee24fff7145f50dfd Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Fri, 3 Nov 2023 15:18:35 +0100 Subject: [PATCH] change(api): module settings - new modules --- .../app/components/Client/Modules/Modules.tsx | 2 +- .../app/components/Client/Modules/index.ts | 37 +++++++++++++++---- frontend/app/layout/SideMenu.tsx | 3 ++ frontend/app/layout/data.ts | 4 +- 4 files changed, 36 insertions(+), 10 deletions(-) diff --git a/frontend/app/components/Client/Modules/Modules.tsx b/frontend/app/components/Client/Modules/Modules.tsx index c2ef11c9c..d2424798e 100644 --- a/frontend/app/components/Client/Modules/Modules.tsx +++ b/frontend/app/components/Client/Modules/Modules.tsx @@ -39,7 +39,7 @@ function Modules(props: Props) { list.forEach((module) => { module.isEnabled = modules.includes(module.key); }); - setModulesState(list); + setModulesState(list.filter((module) => !module.hidden)); }, [modules]); diff --git a/frontend/app/components/Client/Modules/index.ts b/frontend/app/components/Client/Modules/index.ts index 291affc45..777152b51 100644 --- a/frontend/app/components/Client/Modules/index.ts +++ b/frontend/app/components/Client/Modules/index.ts @@ -6,6 +6,9 @@ export const enum MODULES { BUG_REPORTS = 'bug-reports', OFFLINE_RECORDINGS = 'offline-recordings', ALERTS = 'alerts', + ASSIST_STATS = 'assist-stats', + FEATURE_FLAGS = 'feature-flags', + RECOMMENDATIONS = 'recommendations', } export interface Module { @@ -14,38 +17,58 @@ export interface Module { key: string; icon?: string; isEnabled?: boolean; + hidden?: boolean; } export const modules = [ { label: 'Cobrowse', - description: 'Enable live session playing, interaction, screen sharing, and annotations over video call.', + description: 'Enable live session replay, remote control, annotations and webRTC call/video.', key: MODULES.ASSIST, icon: 'broadcast' }, { label: 'Notes', - description: 'Add notes to sessions and recordings to share with your team.', + description: 'Add notes to sessions and share with your team.', key: MODULES.NOTES, icon: 'stickies', isEnabled: true }, { label: 'Bug Reports', - description: 'Allow users to report bugs and issues on your website.', + description: 'Make PDF reports bugs and issues while replaying sessions.', key: MODULES.BUG_REPORTS, icon: 'filetype-pdf' }, { - label: 'Offline Recordings', - description: 'Record user sessions even when they are offline.', + label: 'Recordings', + description: 'Record live sessions while co-browsing with users and share it with your team for training purposes.', key: MODULES.OFFLINE_RECORDINGS, icon: 'record2' }, { label: 'Alerts', - description: 'Get notified when users encounter errors on your website.', + description: 'Create alerts on cards and get notified when a metric hits a certain threshold.', key: MODULES.ALERTS, icon: 'bell' - } + }, + { + label: 'Cobrowsing Reports', + description: 'Get detailed analytics on your users and their sessions.', + key: MODULES.ASSIST_STATS, + icon: 'file-bar-graph' + }, + { + label: 'Feature Flags', + description: 'Create feature flags and enable/disable them on the fly.', + key: MODULES.FEATURE_FLAGS, + icon: 'toggles' + }, + { + label: 'Recommendations', + description: 'Recommendations based on user behavior.', + key: MODULES.RECOMMENDATIONS, + icon: 'magic', + hidden: true + }, ]; \ No newline at end of file diff --git a/frontend/app/layout/SideMenu.tsx b/frontend/app/layout/SideMenu.tsx index 87710ca05..48b078bf1 100644 --- a/frontend/app/layout/SideMenu.tsx +++ b/frontend/app/layout/SideMenu.tsx @@ -48,6 +48,9 @@ function SideMenu(props: Props) { if (item.hidden) return item; const isHidden = [ + (item.key === MENU.STATS && modules.includes(MODULES.ASSIST_STATS)), + (item.key === MENU.RECOMMENDATIONS && modules.includes(MODULES.RECOMMENDATIONS)), + (item.key === MENU.FEATURE_FLAGS && modules.includes(MODULES.FEATURE_FLAGS)), (item.key === MENU.NOTES && modules.includes(MODULES.NOTES)), (item.key === MENU.LIVE_SESSIONS || item.key === MENU.RECORDINGS || item.key === MENU.STATS) && modules.includes(MODULES.ASSIST), (item.key === MENU.SESSIONS && modules.includes(MODULES.OFFLINE_RECORDINGS)), diff --git a/frontend/app/layout/data.ts b/frontend/app/layout/data.ts index e90cad50b..f7dc15c0d 100644 --- a/frontend/app/layout/data.ts +++ b/frontend/app/layout/data.ts @@ -63,8 +63,8 @@ export const categories: Category[] = [ key: 'replays', items: [ { label: 'Sessions', key: MENU.SESSIONS, icon: 'collection-play' }, - // { label: 'Recommendations', key: MENU.RECOMMENDATIONS, icon: 'magic' }, - // { label: 'Vault', key: MENU.VAULT, icon: 'safe' }, + { label: 'Recommendations', key: MENU.RECOMMENDATIONS, icon: 'magic', hidden: true }, + { label: 'Vault', key: MENU.VAULT, icon: 'safe', hidden: true }, { label: 'Bookmarks', key: MENU.BOOKMARKS, icon: 'bookmark' }, { label: 'Notes', key: MENU.NOTES, icon: 'stickies' } ]