Skip to content

Commit

Permalink
[#3927] Added airy contacts to catalog (#3932)
Browse files Browse the repository at this point in the history
  • Loading branch information
Thorsten authored Nov 11, 2022
1 parent d7d7cd4 commit ae1e34c
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion frontend/control-center/src/components/Sidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const connector = connect(mapStateToProps);

const Sidebar = (props: SideBarProps) => {
const {version, components} = props;
const componentInfo = useCurrentComponentForSource(Source.webhooks);
const componentInfo = useCurrentComponentForSource(Source.airyWebhooks);

const webhooksEnabled = componentInfo.installationStatus === InstallationStatus.installed;
const inboxEnabled = components[Source.frontendInbox]?.enabled || false;
Expand Down
6 changes: 3 additions & 3 deletions frontend/control-center/src/pages/Connectors/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, {useEffect} from 'react';
import {connect, ConnectedProps} from 'react-redux';
import {Connector, InstallationStatus, Source} from 'model';
import {airyProduct, Connector, InstallationStatus} from 'model';
import InfoCard from './InfoCard';
import {StateModel} from '../../reducers';
import {setPageTitle} from '../../services/pageTitle';
Expand All @@ -24,11 +24,11 @@ const Connectors = (props: ConnectedProps<typeof connector>) => {
const installedConnectors = Object.values(connectors).filter(
(connector: Connector) =>
connector.installationStatus === InstallationStatus.installed &&
connector.source !== Source.webhooks &&
connector.source !== airyProduct &&
connector.price
);
const hasAvailableConnectors =
Object.values(connectors).filter((connector: Connector) => connector.source !== Source.webhooks && connector.price)
Object.values(connectors).filter((connector: Connector) => connector.source !== airyProduct && connector.price)
.length > 0;

const hasInstalledComponents = installedConnectors.length > 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {ReactComponent as CheckmarkIcon} from 'assets/images/icons/checkmarkFill
import {ReactComponent as UncheckedIcon} from 'assets/images/icons/uncheckIcon.svg';
import {ReactComponent as ArrowRight} from 'assets/images/icons/arrowRight.svg';
import {getChannelAvatar} from '../../../components/ChannelAvatar';
import {Source} from 'model';
import {Source, airyProduct} from 'model';
import {SettingsModal, Button, Toggle, Tooltip} from 'components';
import {connect, ConnectedProps, useSelector} from 'react-redux';
import {useTranslation} from 'react-i18next';
Expand Down Expand Up @@ -44,7 +44,7 @@ const ItemInfo = (props: ComponentInfoProps) => {
let isConfigurable = false;

Object.entries(catalogList).forEach(elem => {
if (elem[1] && elem[1].source && elem[1].source === source && elem[1].source !== Source.webhooks)
if (elem[1] && elem[1].source && elem[1].source === source && elem[1].source !== airyProduct)
isConfigurable = true;
});

Expand Down
4 changes: 2 additions & 2 deletions frontend/control-center/src/services/getRouteForCard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const getConnectedRouteForComponent = (
hasConnectedChannels?: boolean,
configured?: boolean
) => {
if (source === Source.webhooks) return WEBHOOKS_ROUTE;
if (source === Source.airyWebhooks) return WEBHOOKS_ROUTE;

if ((!configured || !isChannel) && source !== Source.chatPlugin) return `${CONNECTORS_ROUTE}/${source}/configure`;

Expand All @@ -19,7 +19,7 @@ export const getConnectedRouteForComponent = (
};

export const getNewChannelRouteForComponent = (source: Source, isChannel?: boolean, configured?: boolean) => {
if (source === Source.webhooks) return WEBHOOKS_ROUTE;
if (source === Source.airyWebhooks) return WEBHOOKS_ROUTE;

if ((!configured || !isChannel) && source !== Source.chatPlugin) return `${CONNECTORS_ROUTE}/${source}/configure`;

Expand Down
5 changes: 4 additions & 1 deletion lib/typescript/model/Source.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export enum Source {
airyContacts = 'airyContacts',
airyWebhooks = 'webhooks',
facebook = 'facebook',
google = 'google',
chatPlugin = 'chatplugin',
Expand All @@ -12,7 +14,6 @@ export enum Source {
salesforce = 'salesforce',
cognigy = 'cognigy',
rasa = 'rasa',
webhooks = 'webhooks',
amelia = 'amelia',
mobile = 'mobile',
whatsapp = 'whatsapp',
Expand All @@ -22,6 +23,8 @@ export enum Source {
amazonLexV2 = 'amazonLexV2',
}

export const airyProduct = Source.airyContacts && Source.airyWebhooks;

export const prettifySource = (source: string) =>
source
.split('.')
Expand Down
8 changes: 4 additions & 4 deletions lib/typescript/translations/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ const resources = {
rasaDescription: 'Open source conversational AI.',

//webhooks
webhooksDescription: 'Get notified when events happen.',
airyWebhooksDescription: 'Get notified when events happen.',

//amelia
ameliaDescription: 'An intelligent cognitive conversational chatbot.',
Expand Down Expand Up @@ -946,7 +946,7 @@ const resources = {
rasaDescription: 'Open-Source-Gesprächs-KI.',

//webhooks
webhooksDescription: 'Lassen Sie sich benachrichtigen, wenn Ereignisse eintreten.',
airyWebhooksDescription: 'Lassen Sie sich benachrichtigen, wenn Ereignisse eintreten.',

//amelia
ameliaDescription: 'Ein intelligenter kognitiver Konversations-Chatbot.',
Expand Down Expand Up @@ -1569,7 +1569,7 @@ const resources = {
rasaDescription: 'IA conversationnelle open source.',

//webhooks
webhooksDescription: 'Soyez averti lorsque des événements se produisent.',
airyWebhooksDescription: 'Soyez averti lorsque des événements se produisent.',

//amelia
ameliaDescription: 'Un chatbot conversationnel cognitif intelligent.',
Expand Down Expand Up @@ -2131,7 +2131,7 @@ const resources = {
rasaDescription: 'IA conversacional Open Source.',

//webhooks
webhooksDescription: 'Reciba notificaciones cuando ocurran eventos.',
airyWebhooksDescription: 'Reciba notificaciones cuando ocurran eventos.',

//amelia
ameliaDescription: 'Un chatbot conversacional cognitivo inteligente.',
Expand Down

0 comments on commit ae1e34c

Please sign in to comment.