feat: show related flows for connections

This commit is contained in:
Ali BARIN
2022-08-11 18:44:44 +02:00
parent a5b6e66e22
commit ad97fae883
4 changed files with 10 additions and 4 deletions

View File

@@ -40,7 +40,7 @@ export default function ContextMenu(props: ContextMenuProps): React.ReactElement
>
<MenuItem
component={Link}
to={URLS.APP_FLOWS(appKey)}
to={URLS.APP_FLOWS_FOR_CONNECTION(appKey, connectionId)}
onClick={createActionHandler({ type: 'viewFlows' })}
>
{formatMessage('connection.viewFlows')}

View File

@@ -21,8 +21,13 @@ const getLimitAndOffset = (page: number) => ({
export default function AppFlows(props: AppFlowsProps): React.ReactElement {
const { appKey } = props;
const [searchParams, setSearchParams] = useSearchParams();
const connectionId = searchParams.get('connectionId') || null;
const page = parseInt(searchParams.get('page') || '', 10) || 1;
const { data } = useQuery(GET_FLOWS, { variables: { appKey, ...getLimitAndOffset(page) }});
const { data } = useQuery(GET_FLOWS, { variables: {
appKey,
connectionId,
...getLimitAndOffset(page)
}});
const getFlows = data?.getFlows || {};
const { pageInfo, edges } = getFlows;