[FIX] Omnichannel call provider option (#27466)

pull/27506/head
Douglas Fabris 3 years ago committed by GitHub
parent 61689c8c49
commit b2ed028140
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      apps/meteor/app/livechat/server/api/lib/livechat.ts
  2. 5
      apps/meteor/app/livechat/server/config.ts
  3. 2
      apps/meteor/app/videobridge/client/tabBar.tsx
  4. 2
      apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json
  5. 1
      apps/meteor/server/startup/migrations/index.ts
  6. 20
      apps/meteor/server/startup/migrations/v282.ts
  7. 2
      apps/meteor/tests/end-to-end/api/livechat/16-video-call.ts

@ -147,7 +147,7 @@ export async function settings({ businessUnit = '' }: { businessUnit?: string }
nameFieldRegistrationForm: initSettings.Livechat_name_field_registration_form,
emailFieldRegistrationForm: initSettings.Livechat_email_field_registration_form,
displayOfflineForm: initSettings.Livechat_display_offline_form,
videoCall: initSettings.Omnichannel_call_provider === 'Jitsi',
videoCall: initSettings.Omnichannel_call_provider === 'default-provider',
fileUpload: initSettings.Livechat_fileupload_enabled && initSettings.FileUpload_Enabled,
language: initSettings.Language,
transcript: initSettings.Livechat_enable_transcript,

@ -623,13 +623,10 @@ Meteor.startup(function () {
section: 'Video_and_Audio_Call',
values: [
{ key: 'none', i18nLabel: 'None' },
{ key: 'Jitsi', i18nLabel: 'Jitsi' },
{ key: 'WebRTC', i18nLabel: 'WebRTC' },
{ key: 'default-provider', i18nLabel: 'Default Provider' },
],
i18nDescription: 'Feature_depends_on_selected_call_provider_to_be_enabled_from_administration_settings',
i18nLabel: 'Call_provider',
alert:
'The WebRTC provider is currently in alpha!<br/>We recommend using Firefox Browser for this feature since there are some known bugs within other browsers that still need to be fixed.<br/>Please report bugs to github.com/RocketChat/Rocket.Chat/issues',
enableQuery: omnichannelEnabledQuery,
});
});

@ -49,7 +49,7 @@ addAction('start-call', ({ room }) => {
const enabledChannel = useSetting('VideoConf_Enable_Channels') !== false;
const enabledTeams = useSetting('VideoConf_Enable_Teams') !== false;
const enabledGroups = useSetting('VideoConf_Enable_Groups') !== false;
const enabledLiveChat = useSetting('Omnichannel_call_provider') === 'Jitsi';
const enabledLiveChat = useSetting('Omnichannel_call_provider') === 'default-provider';
const live = room?.streamingOptions && room.streamingOptions.type === 'call';
const enabled = enabledDMs || enabledChannel || enabledTeams || enabledGroups || enabledLiveChat;

@ -2063,7 +2063,7 @@
"Favorites": "Favorites",
"featured": "featured",
"Featured": "Featured",
"Feature_depends_on_selected_call_provider_to_be_enabled_from_administration_settings": "This feature depends on the above selected call provider to be enabled from the administration settings.<br/>For **Jitsi**, please make sure you have Jitsi Enabled under Admin -> Video Conference -> Jitsi -> Enabled.<br/>For **WebRTC**, please make sure you have WebRTC enabled under Admin -> WebRTC -> Enabled.",
"Feature_depends_on_selected_call_provider_to_be_enabled_from_administration_settings": "This feature depends on the above selected call provider to be enabled from the administration settings (Admin -> Video Conference).",
"Feature_Depends_on_Livechat_Visitor_navigation_as_a_message_to_be_enabled": "This feature depends on \"Send Visitor Navigation History as a Message\" to be enabled.",
"Feature_Limiting": "Feature Limiting",
"Features": "Features",

@ -40,4 +40,5 @@ import './v278';
import './v279';
import './v280';
import './v281';
import './v282';
import './xrun';

@ -0,0 +1,20 @@
import { Settings } from '@rocket.chat/models';
import { addMigration } from '../../lib/migrations';
import { settings } from '../../../app/settings/server';
addMigration({
version: 282,
up() {
const omnichannelCallProvider = settings.get('Omnichannel_call_provider');
if (omnichannelCallProvider !== 'none') {
Settings.updateOne(
{ _id: 'Omnichannel_call_provider' },
{
$set: { value: 'default-provider' },
},
{ upsert: true },
);
}
},
});

@ -43,7 +43,7 @@ describe('LIVECHAT - WebRTC video call', function () {
await updateSetting('WebRTC_Enabled', true);
});
it('should fail if WebRTC_Enabled is true but Omnichannel_call_provider setting is not WebRTC', async () => {
await updateSetting('Omnichannel_call_provider', 'Jitsi');
await updateSetting('Omnichannel_call_provider', 'default-provider');
const visitor = await createVisitor();
const room = await createLivechatRoom(visitor.token);
const response = await request.get(api('livechat/webrtc.call')).set(credentials).query({

Loading…
Cancel
Save