feat: add supportsConnections support in App

This commit is contained in:
Ali BARIN
2022-07-29 14:04:44 +02:00
parent f7ab2b667c
commit 5271af8b94
20 changed files with 38 additions and 4 deletions

View File

@@ -23,6 +23,14 @@ import AppIcon from 'components/AppIcon';
import { GET_APPS } from 'graphql/queries/get-apps';
import useFormatMessage from 'hooks/useFormatMessage';
function createConnectionOrFlow(appKey: string, supportsConnections = false) {
if (!supportsConnections) {
return URLS.CREATE_FLOW_WITH_APP(appKey);
}
return URLS.APP_ADD_CONNECTION(appKey);
};
type AddNewAppConnectionProps = {
onClose: () => void;
};
@@ -70,7 +78,7 @@ export default function AddNewAppConnection(props: AddNewAppConnectionProps): Re
<List sx={{ pt: 2 }}>
{data?.getApps?.map((app: IApp) => (
<ListItem disablePadding key={app.name}>
<ListItemButton component={Link} to={URLS.APP_ADD_CONNECTION(app.name.toLowerCase())}>
<ListItemButton component={Link} to={createConnectionOrFlow(app.name.toLowerCase(), app.supportsConnections)}>
<ListItemIcon sx={{ minWidth: 74 }}>
<AppIcon color="transparent" url={app.iconUrl} name={app.name} />
</ListItemIcon>