From 8364695f8a977895ea53d7968ac705a223cad1dc Mon Sep 17 00:00:00 2001 From: Ali BARIN Date: Tue, 1 Feb 2022 00:22:32 +0100 Subject: [PATCH] feat: show only triggerable apps in trigger steps --- packages/web/src/components/FlowStep/index.tsx | 2 +- packages/web/src/graphql/queries/get-apps.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/web/src/components/FlowStep/index.tsx b/packages/web/src/components/FlowStep/index.tsx index 7a31e11a..f98c4de9 100644 --- a/packages/web/src/components/FlowStep/index.tsx +++ b/packages/web/src/components/FlowStep/index.tsx @@ -63,7 +63,7 @@ export default function FlowStep(props: FlowStepProps): React.ReactElement | nul const initialRender = React.useRef(true); const formatMessage = useFormatMessage(); const [currentSubstep, setCurrentSubstep] = React.useState(0); - const { data } = useQuery(GET_APPS) + const { data } = useQuery(GET_APPS, { variables: { onlyWithTriggers: isTrigger }}); const apps: App[] = data?.getApps; const app = apps?.find((currentApp: App) => currentApp.key === step.appKey); diff --git a/packages/web/src/graphql/queries/get-apps.ts b/packages/web/src/graphql/queries/get-apps.ts index 3236b9fd..d2d3f26a 100644 --- a/packages/web/src/graphql/queries/get-apps.ts +++ b/packages/web/src/graphql/queries/get-apps.ts @@ -1,8 +1,8 @@ import { gql } from '@apollo/client'; export const GET_APPS = gql` - query GetApps($name: String) { - getApps(name: $name) { + query GetApps($name: String, $onlyWithTriggers: Boolean) { + getApps(name: $name, onlyWithTriggers: $onlyWithTriggers) { name key iconUrl