mirror of
				https://github.com/lingble/chatwoot.git
				synced 2025-10-31 19:17:48 +00:00 
			
		
		
		
	 cc4851b19d
			
		
	
	cc4851b19d
	
	
	
		
			
			We previously relied on user roles to determine whether to render specific routes in our frontend components. A permissions-based model is replacing this approach. Follow up: #9695 Co-authored-by: Pranav <pranavrajs@gmail.com>
		
			
				
	
	
		
			63 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			63 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| import { FEATURE_FLAGS } from '../../../../featureFlags';
 | |
| import { frontendURL } from '../../../../helper/URLHelper';
 | |
| 
 | |
| const primaryMenuItems = accountId => [
 | |
|   {
 | |
|     icon: 'mail-inbox',
 | |
|     key: 'inboxView',
 | |
|     label: 'INBOX_VIEW',
 | |
|     featureFlag: FEATURE_FLAGS.INBOX_VIEW,
 | |
|     toState: frontendURL(`accounts/${accountId}/inbox-view`),
 | |
|     toStateName: 'inbox_view',
 | |
|   },
 | |
|   {
 | |
|     icon: 'chat',
 | |
|     key: 'conversations',
 | |
|     label: 'CONVERSATIONS',
 | |
|     toState: frontendURL(`accounts/${accountId}/dashboard`),
 | |
|     toStateName: 'home',
 | |
|   },
 | |
|   {
 | |
|     icon: 'book-contacts',
 | |
|     key: 'contacts',
 | |
|     label: 'CONTACTS',
 | |
|     featureFlag: FEATURE_FLAGS.CRM,
 | |
|     toState: frontendURL(`accounts/${accountId}/contacts`),
 | |
|     toStateName: 'contacts_dashboard',
 | |
|   },
 | |
|   {
 | |
|     icon: 'arrow-trending-lines',
 | |
|     key: 'reports',
 | |
|     label: 'REPORTS',
 | |
|     featureFlag: FEATURE_FLAGS.REPORTS,
 | |
|     toState: frontendURL(`accounts/${accountId}/reports`),
 | |
|     toStateName: 'account_overview_reports',
 | |
|   },
 | |
|   {
 | |
|     icon: 'megaphone',
 | |
|     key: 'campaigns',
 | |
|     label: 'CAMPAIGNS',
 | |
|     featureFlag: FEATURE_FLAGS.CAMPAIGNS,
 | |
|     toState: frontendURL(`accounts/${accountId}/campaigns`),
 | |
|     toStateName: 'ongoing_campaigns',
 | |
|   },
 | |
|   {
 | |
|     icon: 'library',
 | |
|     key: 'helpcenter',
 | |
|     label: 'HELP_CENTER.TITLE',
 | |
|     featureFlag: FEATURE_FLAGS.HELP_CENTER,
 | |
|     alwaysVisibleOnChatwootInstances: true,
 | |
|     toState: frontendURL(`accounts/${accountId}/portals`),
 | |
|     toStateName: 'default_portal_articles',
 | |
|   },
 | |
|   {
 | |
|     icon: 'settings',
 | |
|     key: 'settings',
 | |
|     label: 'SETTINGS',
 | |
|     toState: frontendURL(`accounts/${accountId}/settings`),
 | |
|     toStateName: 'settings_home',
 | |
|   },
 | |
| ];
 | |
| 
 | |
| export default primaryMenuItems;
 |