-
Notifications
You must be signed in to change notification settings - Fork 13k
feat: Team collab VoIP config modal #34957
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
e0cd2ea
voip config modal
yash-rajpal feef281
fix modal logic
yash-rajpal 9566f74
add cs
yash-rajpal 433be2d
change changeset type
yash-rajpal 0702ae5
add one more case for normal users
yash-rajpal 370a749
oops: translation
yash-rajpal 7f2f4b5
Merge branch 'develop' into teams-voip-feature-modal
yash-rajpal 69f2e46
use permissions to hide voip call option
yash-rajpal 18cf677
Modal imports
yash-rajpal 3372001
Merge branch 'develop' into teams-voip-feature-modal
kodiakhq[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| '@rocket.chat/i18n': minor | ||
| '@rocket.chat/meteor': minor | ||
| --- | ||
|
|
||
| Implements a modal to let users know about VoIP calls in direct messages and missing configurations. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import { useEffectEvent } from '@rocket.chat/fuselage-hooks'; | ||
| import { useRole, useRoute, useSetModal } from '@rocket.chat/ui-contexts'; | ||
| import { useMemo } from 'react'; | ||
|
|
||
| import { useHasLicenseModule } from './useHasLicenseModule'; | ||
| import TeamsVoipConfigModal from '../views/room/contextualBar/TeamsVoipConfigModal'; | ||
|
|
||
| export const useVoipWarningModal = (): (() => void) => { | ||
| const setModal = useSetModal(); | ||
| const isAdmin = useRole('admin'); | ||
| const hasModule = useHasLicenseModule('teams-voip') === true; | ||
| const teamsVoipSettingsRoute = useRoute('admin-settings'); | ||
|
|
||
| const handleClose = useEffectEvent(() => setModal(null)); | ||
|
|
||
| const handleRedirectToConfiguration = useEffectEvent(() => { | ||
| handleClose(); | ||
| teamsVoipSettingsRoute.push({ | ||
| group: 'VoIP_TeamCollab', | ||
| }); | ||
| }); | ||
|
|
||
| return useMemo( | ||
| () => (): void => | ||
| setModal( | ||
| <TeamsVoipConfigModal hasModule={hasModule} onClose={handleClose} onConfirm={handleRedirectToConfiguration} isAdmin={isAdmin} />, | ||
| ), | ||
| [handleClose, handleRedirectToConfiguration, isAdmin, setModal, hasModule], | ||
| ); | ||
| }; |
116 changes: 116 additions & 0 deletions
116
apps/meteor/client/views/room/contextualBar/TeamsVoipConfigModal.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,116 @@ | ||
| import { | ||
| Modal, | ||
| Button, | ||
| Box, | ||
| Callout, | ||
| Margins, | ||
| ModalHeader, | ||
| ModalHeaderText, | ||
| ModalTagline, | ||
| ModalTitle, | ||
| ModalClose, | ||
| ModalContent, | ||
| ModalHeroImage, | ||
| ModalFooter, | ||
| ModalFooterAnnotation, | ||
| ModalFooterControllers, | ||
| } from '@rocket.chat/fuselage'; | ||
| import type { ReactElement } from 'react'; | ||
| import { Trans, useTranslation } from 'react-i18next'; | ||
|
|
||
| import { useExternalLink } from '../../../hooks/useExternalLink'; | ||
| import { GET_ADDONS_LINK } from '../../admin/subscription/utils/links'; | ||
|
|
||
| type TeamsVoipConfigModalProps = { | ||
| onClose: () => void; | ||
| onConfirm?: () => void; | ||
| isAdmin: boolean; | ||
| hasModule: boolean; | ||
| }; | ||
|
|
||
| const TeamsVoipConfigModal = ({ onClose, onConfirm, isAdmin, hasModule }: TeamsVoipConfigModalProps): ReactElement => { | ||
| const { t } = useTranslation(); | ||
| const openExternalLink = useExternalLink(); | ||
|
|
||
| const getCalloutWarning = () => { | ||
| if (isAdmin && !hasModule) { | ||
| return t('Contact_sales_start_using_VoIP'); | ||
| } | ||
|
|
||
| if (!isAdmin && !hasModule) { | ||
| return t('Contact_your_workspace_admin_to_start_using_VoIP'); | ||
| } | ||
|
|
||
| return t('VoIP_available_setup_freeswitch_server_details'); | ||
| }; | ||
|
|
||
| return ( | ||
| <Modal> | ||
| <ModalHeader> | ||
| <ModalHeaderText> | ||
| <ModalTagline>{t('VoIP')}</ModalTagline> | ||
| <ModalTitle>{t('Team_voice_call')}</ModalTitle> | ||
| </ModalHeaderText> | ||
| <ModalClose title={t('Close')} onClick={onClose} /> | ||
| </ModalHeader> | ||
| <ModalContent> | ||
| <ModalHeroImage maxHeight='initial' src='/images/teams-voip-config.svg' /> | ||
| <Box paddingBlock={24}> | ||
| {t('Fully_integrated_voip_receive_internal_external_calls_without_switching_between_apps_external_systems')} | ||
| </Box> | ||
| <Box fontScale='h3'>{t('Features')}</Box> | ||
| <Margins block={24}> | ||
| <Box withRichContent> | ||
| <Box is='ul' pis={24}> | ||
| <li> | ||
| <Trans i18nKey='VoIP_TeamCollab_Feature1'> | ||
| <strong>Direct calling:</strong> Instantly start or receive calls with team members within your Rocket.Chat workspace. | ||
| </Trans> | ||
| </li> | ||
| <li> | ||
| <Trans i18nKey='VoIP_TeamCollab_Feature2'> | ||
| <strong>Extension management:</strong> Admins can assign unique extensions to users, enabling quick, direct dialing both | ||
| from inside and outside your organization. | ||
| </Trans> | ||
| </li> | ||
| <li> | ||
| <Trans i18nKey='VoIP_TeamCollab_Feature3'> | ||
| <strong>Call transfers:</strong> Seamlessly transfer active calls to ensure users reach the right team member. | ||
| </Trans> | ||
| </li> | ||
| <li> | ||
| <Trans i18nKey='VoIP_TeamCollab_Feature4'> | ||
| <strong>Availability settings:</strong> Users can control their availability to receive calls, enhancing flexibility. | ||
| </Trans> | ||
| </li> | ||
| </Box> | ||
| </Box> | ||
| </Margins> | ||
| <Box fontScale='h3' mbs={24}> | ||
| {t('Required_action')} | ||
| </Box> | ||
| <Callout mbs={12} mbe={24} title={!hasModule ? t('Subscription_add-on_required') : t('FreeSwitch_setup_required')} type='warning'> | ||
| {getCalloutWarning()} | ||
| </Callout> | ||
| </ModalContent> | ||
| <ModalFooter justifyContent={!isAdmin && hasModule ? 'space-between' : 'end'}> | ||
| {!isAdmin && hasModule && <ModalFooterAnnotation>{t('Only_admins_can_perform_this_setup')}</ModalFooterAnnotation>} | ||
| <ModalFooterControllers> | ||
| <Button onClick={onClose}>{t('Cancel')}</Button> | ||
| {onConfirm && isAdmin && hasModule && ( | ||
| <Button primary onClick={onConfirm}> | ||
| {t('Go_to_settings')} | ||
| </Button> | ||
| )} | ||
| {isAdmin && !hasModule && ( | ||
| <Button primary onClick={() => openExternalLink(GET_ADDONS_LINK)}> | ||
| {t('Contact_sales')} | ||
| </Button> | ||
| )} | ||
| </ModalFooterControllers> | ||
| </ModalFooter> | ||
| </Modal> | ||
| ); | ||
| }; | ||
|
|
||
| export default TeamsVoipConfigModal; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.