Merge pull request #507 from automatisch/issue-499

feat: show poll interval in trigger step
This commit is contained in:
Ömer Faruk Aydın
2022-09-14 01:12:10 +03:00
committed by GitHub
6 changed files with 19 additions and 0 deletions

View File

@@ -102,6 +102,7 @@
{
"name": "New message posted to a channel",
"key": "newMessageToChannel",
"pollInterval": 15,
"description": "Triggers when a new message is posted to a channel",
"substeps": [
{

View File

@@ -218,6 +218,7 @@
{
"name": "My Tweets",
"key": "myTweets",
"pollInterval": 15,
"description": "Will be triggered when you tweet something new.",
"substeps": [
{
@@ -233,6 +234,7 @@
{
"name": "User Tweets",
"key": "userTweets",
"pollInterval": 15,
"description": "Will be triggered when a specific user tweet something new.",
"substeps": [
{
@@ -260,6 +262,7 @@
{
"name": "Search Tweets",
"key": "searchTweets",
"pollInterval": 15,
"description": "Will be triggered when any user tweet something containing a specific keyword, phrase, username or hashtag.",
"substeps": [
{
@@ -287,6 +290,7 @@
{
"name": "New follower of me",
"key": "myFollowers",
"pollInterval": 15,
"description": "Will be triggered when you have a new follower.",
"substeps": [
{

View File

@@ -387,6 +387,7 @@ type Trigger {
name: String
key: String
description: String
pollInterval: Int
substeps: [TriggerSubstep]
}

View File

@@ -52,6 +52,7 @@ function ChooseAppAndEventSubstep(props: ChooseAppAndEventSubstepProps): React.R
const appOptions = React.useMemo(() => apps?.map((app) => optionGenerator(app)), [apps]);
const actionsOrTriggers = isTrigger ? app?.triggers : app?.actions;
const actionOptions = React.useMemo(() => actionsOrTriggers?.map((trigger) => optionGenerator(trigger)) ?? [], [app?.key]);
const selectedActionOrTrigger = actionsOrTriggers?.find((actionOrTrigger) => actionOrTrigger.key === step?.key) || null;
const {
name,
@@ -140,6 +141,16 @@ function ChooseAppAndEventSubstep(props: ChooseAppAndEventSubstepProps): React.R
</Box>
)}
{isTrigger && selectedActionOrTrigger?.pollInterval && (
<TextField
label="Poll interval"
value={`Every ${selectedActionOrTrigger.pollInterval} minutes`}
sx={{ mt: 2 }}
fullWidth
disabled
/>
)}
<Button
fullWidth
variant="contained"

View File

@@ -55,6 +55,7 @@ export const GET_APP = gql`
triggers {
name
key
pollInterval
description
substeps {
name

View File

@@ -53,6 +53,7 @@ export const GET_APPS = gql`
triggers {
name
key
pollInterval
description
substeps {
key