feat: show poll interval in trigger step
This commit is contained in:
@@ -102,6 +102,7 @@
|
|||||||
{
|
{
|
||||||
"name": "New message posted to a channel",
|
"name": "New message posted to a channel",
|
||||||
"key": "newMessageToChannel",
|
"key": "newMessageToChannel",
|
||||||
|
"pollInterval": 15,
|
||||||
"description": "Triggers when a new message is posted to a channel",
|
"description": "Triggers when a new message is posted to a channel",
|
||||||
"substeps": [
|
"substeps": [
|
||||||
{
|
{
|
||||||
|
@@ -220,6 +220,7 @@
|
|||||||
{
|
{
|
||||||
"name": "My Tweets",
|
"name": "My Tweets",
|
||||||
"key": "myTweets",
|
"key": "myTweets",
|
||||||
|
"pollInterval": 15,
|
||||||
"description": "Will be triggered when you tweet something new.",
|
"description": "Will be triggered when you tweet something new.",
|
||||||
"substeps": [
|
"substeps": [
|
||||||
{
|
{
|
||||||
@@ -235,6 +236,7 @@
|
|||||||
{
|
{
|
||||||
"name": "User Tweets",
|
"name": "User Tweets",
|
||||||
"key": "userTweets",
|
"key": "userTweets",
|
||||||
|
"pollInterval": 15,
|
||||||
"description": "Will be triggered when a specific user tweet something new.",
|
"description": "Will be triggered when a specific user tweet something new.",
|
||||||
"substeps": [
|
"substeps": [
|
||||||
{
|
{
|
||||||
@@ -262,6 +264,7 @@
|
|||||||
{
|
{
|
||||||
"name": "Search Tweets",
|
"name": "Search Tweets",
|
||||||
"key": "searchTweets",
|
"key": "searchTweets",
|
||||||
|
"pollInterval": 15,
|
||||||
"description": "Will be triggered when any user tweet something containing a specific keyword, phrase, username or hashtag.",
|
"description": "Will be triggered when any user tweet something containing a specific keyword, phrase, username or hashtag.",
|
||||||
"substeps": [
|
"substeps": [
|
||||||
{
|
{
|
||||||
@@ -289,6 +292,7 @@
|
|||||||
{
|
{
|
||||||
"name": "New follower of me",
|
"name": "New follower of me",
|
||||||
"key": "myFollowers",
|
"key": "myFollowers",
|
||||||
|
"pollInterval": 15,
|
||||||
"description": "Will be triggered when you have a new follower.",
|
"description": "Will be triggered when you have a new follower.",
|
||||||
"substeps": [
|
"substeps": [
|
||||||
{
|
{
|
||||||
|
@@ -386,6 +386,7 @@ type Trigger {
|
|||||||
name: String
|
name: String
|
||||||
key: String
|
key: String
|
||||||
description: String
|
description: String
|
||||||
|
pollInterval: Int
|
||||||
substeps: [TriggerSubstep]
|
substeps: [TriggerSubstep]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -52,6 +52,7 @@ function ChooseAppAndEventSubstep(props: ChooseAppAndEventSubstepProps): React.R
|
|||||||
const appOptions = React.useMemo(() => apps?.map((app) => optionGenerator(app)), [apps]);
|
const appOptions = React.useMemo(() => apps?.map((app) => optionGenerator(app)), [apps]);
|
||||||
const actionsOrTriggers = isTrigger ? app?.triggers : app?.actions;
|
const actionsOrTriggers = isTrigger ? app?.triggers : app?.actions;
|
||||||
const actionOptions = React.useMemo(() => actionsOrTriggers?.map((trigger) => optionGenerator(trigger)) ?? [], [app?.key]);
|
const actionOptions = React.useMemo(() => actionsOrTriggers?.map((trigger) => optionGenerator(trigger)) ?? [], [app?.key]);
|
||||||
|
const selectedActionOrTrigger = actionsOrTriggers?.find((actionOrTrigger) => actionOrTrigger.key === step?.key) || null;
|
||||||
|
|
||||||
const {
|
const {
|
||||||
name,
|
name,
|
||||||
@@ -140,6 +141,16 @@ function ChooseAppAndEventSubstep(props: ChooseAppAndEventSubstepProps): React.R
|
|||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{isTrigger && selectedActionOrTrigger?.pollInterval && (
|
||||||
|
<TextField
|
||||||
|
label="Poll interval"
|
||||||
|
value={`Every ${selectedActionOrTrigger.pollInterval} minutes`}
|
||||||
|
sx={{ mt: 2 }}
|
||||||
|
fullWidth
|
||||||
|
disabled
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
fullWidth
|
fullWidth
|
||||||
variant="contained"
|
variant="contained"
|
||||||
|
@@ -54,6 +54,7 @@ export const GET_APP = gql`
|
|||||||
triggers {
|
triggers {
|
||||||
name
|
name
|
||||||
key
|
key
|
||||||
|
pollInterval
|
||||||
description
|
description
|
||||||
substeps {
|
substeps {
|
||||||
name
|
name
|
||||||
|
@@ -53,6 +53,7 @@ export const GET_APPS = gql`
|
|||||||
triggers {
|
triggers {
|
||||||
name
|
name
|
||||||
key
|
key
|
||||||
|
pollInterval
|
||||||
description
|
description
|
||||||
substeps {
|
substeps {
|
||||||
key
|
key
|
||||||
|
Reference in New Issue
Block a user