change(api): module settings - new modules

This commit is contained in:
Shekar Siri 2023-11-03 15:18:35 +01:00
parent f99e70dee0
commit 5f18d7a719
4 changed files with 36 additions and 10 deletions

View file

@ -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]);

View file

@ -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
},
];

View file

@ -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)),

View file

@ -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' }
]