change(ui): pref modules text and ee check

This commit is contained in:
Shekar Siri 2023-11-06 10:10:32 +01:00
parent 9b1d130be4
commit 19384cd9ac
2 changed files with 21 additions and 17 deletions

View file

@ -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<any[]>([]);
const [modulesState, setModulesState, isEnterprise = false] = React.useState<any[]>([]);
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));

View file

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