import { __ } from '~/locale'; /** * Returns the attributes used for gl-empty-state in the Service Desk issues list. */ // eslint-disable-next-line import/prefer-default-export export function emptyStateHelper(emptyStateMeta) { const { isServiceDeskSupported, svgPath, serviceDeskHelpPage } = emptyStateMeta; if (isServiceDeskSupported) { const title = __( 'Use Service Desk to connect with your users (e.g. to offer customer support) through email right inside GitLab', ); const commonMessage = __( 'Those emails automatically become issues (with the comments becoming the email conversation) listed here.', ); const commonDescription = ` ${commonMessage} ${__('Read more')}`; if (emptyStateMeta.canEditProjectSettings && emptyStateMeta.isServiceDeskEnabled) { return { title, svgPath, description: `

${__('Have your users email')} ${ emptyStateMeta.serviceDeskAddress }

${commonDescription}`, }; } if (emptyStateMeta.canEditProjectSettings && !emptyStateMeta.isServiceDeskEnabled) { return { title, svgPath, description: commonDescription, primaryLink: emptyStateMeta.editProjectPage, primaryText: __('Turn on Service Desk'), }; } return { title, svgPath, description: commonDescription, }; } return { title: __('Service Desk is enabled but not yet active'), svgPath, description: __('You must set up incoming email before it becomes active.'), primaryLink: emptyStateMeta.incomingEmailHelpPage, primaryText: __('More information'), }; }