diff --git a/frontend/app/components/Client/PreferencesMenu/PreferencesMenu.tsx b/frontend/app/components/Client/PreferencesMenu/PreferencesMenu.tsx deleted file mode 100644 index 6a24eacf7..000000000 --- a/frontend/app/components/Client/PreferencesMenu/PreferencesMenu.tsx +++ /dev/null @@ -1,100 +0,0 @@ -import React from 'react'; -import { connect, ConnectedProps } from 'react-redux'; -import { withRouter, RouteComponentProps } from 'react-router-dom'; -import cn from 'classnames'; -import { SideMenuitem } from 'UI'; -import stl from './preferencesMenu.module.css'; -import { CLIENT_TABS, client as clientRoute } from 'App/routes'; - -const mapStateToProps = (state: any) => ({ - isEnterprise: state.getIn(['user', 'account', 'edition']) === 'ee', - account: state.getIn(['user', 'account']) -}); - -const connector = connect(mapStateToProps); - -type PropsFromRedux = ConnectedProps; - -type Props = PropsFromRedux & RouteComponentProps & { - activeTab: string; -}; - -function PreferencesMenu({ account, activeTab, history, isEnterprise }: Props) { - const isAdmin = account.admin || account.superAdmin; - - const setTab = (tab: string) => { - history.push(clientRoute(tab)); - }; - - const AdminOnlyBadge = () => ( -
- Admin Only -
- ); - - const menuItems = React.useMemo(() => { - return [ - { title: 'Account', iconName: 'user-circle', tab: CLIENT_TABS.PROFILE }, - { title: 'Sessions Listing', iconName: 'play', tab: CLIENT_TABS.SESSIONS_LISTING }, - { title: 'Integrations', iconName: 'puzzle-piece', tab: CLIENT_TABS.INTEGRATIONS }, - { title: 'Metadata', iconName: 'tags', tab: CLIENT_TABS.CUSTOM_FIELDS }, - { title: 'Webhooks', iconName: 'anchor', tab: CLIENT_TABS.WEBHOOKS }, - { title: 'Projects', iconName: 'window-restore', tab: CLIENT_TABS.SITES }, - { - title: 'Roles & Access', - iconName: 'diagram-3', - tab: CLIENT_TABS.MANAGE_ROLES, - isAdminOnly: true, - isEnterpriseOnly: true - }, - { - title: 'Audit', - iconName: 'list-ul', - tab: CLIENT_TABS.AUDIT, - isAdminOnly: true, - isEnterpriseOnly: true - }, - { title: 'Team', iconName: 'users', tab: CLIENT_TABS.MANAGE_USERS, isAdminOnly: true }, - { title: 'Notifications', iconName: 'bell', tab: CLIENT_TABS.NOTIFICATIONS } - ].reduce((acc, item) => { - if (item.isAdminOnly && !isAdmin) { - return acc; - } - - if (item.isEnterpriseOnly && !isEnterprise) { - return acc; - } - - return [...acc, item]; - }, []); - }, [isAdmin, isEnterprise]); - - // @ts-ignore - return ( -
-
-
- Preferences -
-
- - {menuItems.map((menuItem) => ( -
- setTab(menuItem.tab)} - leading={menuItem.isAdminOnly ? : undefined} - /> -
- ))} -
- ); -} - -export default connector(withRouter(PreferencesMenu)); diff --git a/frontend/app/components/Client/PreferencesMenu/index.js b/frontend/app/components/Client/PreferencesMenu/index.js deleted file mode 100644 index ecd18ce72..000000000 --- a/frontend/app/components/Client/PreferencesMenu/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './PreferencesMenu'; \ No newline at end of file diff --git a/frontend/app/components/Client/PreferencesMenu/preferencesMenu.module.css b/frontend/app/components/Client/PreferencesMenu/preferencesMenu.module.css deleted file mode 100644 index c129c5cb8..000000000 --- a/frontend/app/components/Client/PreferencesMenu/preferencesMenu.module.css +++ /dev/null @@ -1,35 +0,0 @@ -.wrapper { - position: fixed; - top: 81px; - width: 210px; -} - -.header { - margin-bottom: 15px; - & .label { - text-transform: uppercase; - color: gray; - letter-spacing: 0.2em; - } - - & .manageButton { - margin-left: 5px; - font-size: 12px; - color: $teal; - cursor: pointer; - padding: 2px 5px; - border: solid thin transparent; - border-radius: 3px; - margin-bottom: -3px; - &:hover { - background-color: $gray-light; - color: $gray-darkest; - } - } -} - -.divider { - height: 1px; - width: 100%; - background-color: $gray-light; -} \ No newline at end of file diff --git a/frontend/app/layout/data.ts b/frontend/app/layout/data.ts index abab2c904..e90cad50b 100644 --- a/frontend/app/layout/data.ts +++ b/frontend/app/layout/data.ts @@ -119,7 +119,7 @@ export const preferences: Category[] = [ key: 'preferences', items: [ { label: 'Account', key: PREFERENCES_MENU.ACCOUNT, icon: 'person' }, - { label: 'Session Listing', key: PREFERENCES_MENU.SESSION_LISTING, icon: 'card-list' }, + { label: 'Sessions Listing', key: PREFERENCES_MENU.SESSION_LISTING, icon: 'card-list' }, { label: 'Integrations', key: PREFERENCES_MENU.INTEGRATIONS, icon: 'plug' }, { label: 'Metadata', key: PREFERENCES_MENU.METADATA, icon: 'tags' }, { label: 'Webhooks', key: PREFERENCES_MENU.WEBHOOKS, icon: 'link-45deg' },