From 19384cd9ac126fbf707c145981e11eebee772bba Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Mon, 6 Nov 2023 10:10:32 +0100 Subject: [PATCH] change(ui): pref modules text and ee check --- .../app/components/Client/Modules/Modules.tsx | 8 +++-- .../app/components/Client/Modules/index.ts | 30 ++++++++++--------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/frontend/app/components/Client/Modules/Modules.tsx b/frontend/app/components/Client/Modules/Modules.tsx index d2424798e..146036e0d 100644 --- a/frontend/app/components/Client/Modules/Modules.tsx +++ b/frontend/app/components/Client/Modules/Modules.tsx @@ -10,11 +10,12 @@ import { updateModule } from 'Duck/user'; interface Props { modules: string[]; updateModule: (moduleKey: string) => void; + isEnterprise: boolean; } function Modules(props: Props) { const { modules } = props; - const [modulesState, setModulesState] = React.useState([]); + const [modulesState, setModulesState, isEnterprise = false] = React.useState([]); const onToggle = async (module: any) => { try { @@ -39,7 +40,7 @@ function Modules(props: Props) { list.forEach((module) => { module.isEnabled = modules.includes(module.key); }); - setModulesState(list.filter((module) => !module.hidden)); + setModulesState(list.filter((module) => !module.hidden && (!module.enterprise || isEnterprise))); }, [modules]); @@ -66,5 +67,6 @@ function Modules(props: Props) { export default withPageTitle('Modules - OpenReplay Preferences')(connect((state: any) => ({ - modules: state.getIn(['user', 'account', 'settings', 'modules']) || [] + modules: state.getIn(['user', 'account', 'settings', 'modules']) || [], + isEnterprise: state.getIn(['user', 'account', 'edition']) === 'ee' }), { updateModule })(Modules)); \ No newline at end of file diff --git a/frontend/app/components/Client/Modules/index.ts b/frontend/app/components/Client/Modules/index.ts index 777152b51..93a78896c 100644 --- a/frontend/app/components/Client/Modules/index.ts +++ b/frontend/app/components/Client/Modules/index.ts @@ -18,6 +18,7 @@ export interface Module { icon?: string; isEnabled?: boolean; hidden?: boolean; + enterprise?: boolean; } export const modules = [ @@ -27,6 +28,19 @@ export const modules = [ key: MODULES.ASSIST, icon: 'broadcast' }, + { + 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: 'Cobrowsing Reports', + description: 'Keep an eye on cobrowsing metrics across your team and generate reports.', + key: MODULES.ASSIST_STATS, + icon: 'file-bar-graph', + enterprise: true + }, { label: 'Notes', description: 'Add notes to sessions and share with your team.', @@ -40,33 +54,21 @@ export const modules = [ key: MODULES.BUG_REPORTS, icon: 'filetype-pdf' }, - { - 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: '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.', + description: 'Make gradual releases and A/B test all of your new features without redeploying your app.', key: MODULES.FEATURE_FLAGS, icon: 'toggles' }, { label: 'Recommendations', - description: 'Recommendations based on user behavior.', + description: 'Get personalized recommendations for sessions to watch, based on your replay history and search preferences.', key: MODULES.RECOMMENDATIONS, icon: 'magic', hidden: true