feat: Add video call option with Dyte in the dashboard (#6207)

Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
This commit is contained in:
Pranav Raj S
2023-01-09 11:49:27 -08:00
committed by GitHub
parent 0a65a233d7
commit 24cf7af30b
12 changed files with 358 additions and 50 deletions

View File

@@ -16,14 +16,15 @@ const state = {
},
};
const isAValidAppIntegration = integration => {
return ['dialogflow', 'dyte'].includes(integration.id);
};
export const getters = {
getIntegrations($state) {
return $state.records.filter(
item => item.id !== 'fullcontact' && item.id !== 'dialogflow'
);
return $state.records.filter(item => !isAValidAppIntegration(item));
},
getAppIntegrations($state) {
return $state.records.filter(item => item.id === 'dialogflow');
return $state.records.filter(item => isAValidAppIntegration(item));
},
getIntegration: $state => integrationId => {
const [integration] = $state.records.filter(

View File

@@ -5,28 +5,40 @@ describe('#getters', () => {
const state = {
records: [
{
id: 1,
id: 'test1',
name: 'test1',
logo: 'test',
enabled: true,
},
{
id: 2,
id: 'test2',
name: 'test2',
logo: 'test',
enabled: true,
},
{
id: 'dyte',
name: 'dyte',
logo: 'test',
enabled: true,
},
{
id: 'dialogflow',
name: 'dialogflow',
logo: 'test',
enabled: true,
},
],
};
expect(getters.getIntegrations(state)).toEqual([
{
id: 1,
id: 'test1',
name: 'test1',
logo: 'test',
enabled: true,
},
{
id: 2,
id: 'test2',
name: 'test2',
logo: 'test',
enabled: true,
@@ -38,11 +50,17 @@ describe('#getters', () => {
const state = {
records: [
{
id: 1,
id: 'test1',
name: 'test1',
logo: 'test',
enabled: true,
},
{
id: 'dyte',
name: 'dyte',
logo: 'test',
enabled: true,
},
{
id: 'dialogflow',
name: 'test2',
@@ -52,6 +70,12 @@ describe('#getters', () => {
],
};
expect(getters.getAppIntegrations(state)).toEqual([
{
id: 'dyte',
name: 'dyte',
logo: 'test',
enabled: true,
},
{
id: 'dialogflow',
name: 'test2',