feat: show only triggerable apps in trigger steps

This commit is contained in:
Ali BARIN
2022-02-01 00:22:32 +01:00
committed by Ömer Faruk Aydın
parent 89fbfd9dfc
commit 8364695f8a
2 changed files with 3 additions and 3 deletions

View File

@@ -63,7 +63,7 @@ export default function FlowStep(props: FlowStepProps): React.ReactElement | nul
const initialRender = React.useRef<boolean>(true); const initialRender = React.useRef<boolean>(true);
const formatMessage = useFormatMessage(); const formatMessage = useFormatMessage();
const [currentSubstep, setCurrentSubstep] = React.useState<number | null>(0); const [currentSubstep, setCurrentSubstep] = React.useState<number | null>(0);
const { data } = useQuery(GET_APPS) const { data } = useQuery(GET_APPS, { variables: { onlyWithTriggers: isTrigger }});
const apps: App[] = data?.getApps; const apps: App[] = data?.getApps;
const app = apps?.find((currentApp: App) => currentApp.key === step.appKey); const app = apps?.find((currentApp: App) => currentApp.key === step.appKey);

View File

@@ -1,8 +1,8 @@
import { gql } from '@apollo/client'; import { gql } from '@apollo/client';
export const GET_APPS = gql` export const GET_APPS = gql`
query GetApps($name: String) { query GetApps($name: String, $onlyWithTriggers: Boolean) {
getApps(name: $name) { getApps(name: $name, onlyWithTriggers: $onlyWithTriggers) {
name name
key key
iconUrl iconUrl