@@ -101,12 +101,13 @@ export const TriggerTypeOptions = [
101
101
{ label : "On Page Load" , value : "onPageLoad" } ,
102
102
{ label : "On Input Change" , value : "onInputChange" } ,
103
103
{ label : "On Query Execution" , value : "onQueryExecution" } ,
104
+ { label : "On Timeout" , value : "onTimeout" } ,
104
105
{ label : trans ( "query.triggerTypeAuto" ) , value : "automatic" } ,
105
106
{ label : trans ( "query.triggerTypeManual" ) , value : "manual" } ,
106
107
] as const ;
107
108
108
109
export const JSTriggerTypeOptions = [
109
- { label : trans ( "query.triggerTypeAuto " ) , value : "automatic" } ,
110
+ { label : trans ( "query.triggerTypePageLoad " ) , value : "automatic" } ,
110
111
{ label : trans ( "query.triggerTypeManual" ) , value : "manual" } ,
111
112
] ;
112
113
@@ -160,7 +161,13 @@ const childrenMap = {
160
161
} ,
161
162
} ) ,
162
163
cancelPrevious : withDefault ( BoolPureControl , false ) ,
164
+ // use only for onQueryExecution trigger
163
165
depQueryName : SimpleNameComp ,
166
+ // use only for onTimeout trigger, triggers query after x time passed on page load
167
+ delayTime : millisecondsControl ( {
168
+ left : 0 ,
169
+ defaultValue : 5 * 1000 ,
170
+ } )
164
171
} ;
165
172
166
173
let QueryCompTmp = withTypeAndChildren < typeof QueryMap , ToInstanceType < typeof childrenMap > > (
@@ -317,6 +324,12 @@ function QueryView(props: QueryViewProps) {
317
324
comp . dispatch ( deferAction ( executeQueryAction ( { } ) ) ) ;
318
325
} , 300 ) ;
319
326
}
327
+
328
+ if ( getTriggerType ( comp ) === "onTimeout" ) {
329
+ setTimeout ( ( ) => {
330
+ comp . dispatch ( deferAction ( executeQueryAction ( { } ) ) ) ;
331
+ } , comp . children . delayTime . getView ( ) ) ;
332
+ }
320
333
} , [ ] ) ;
321
334
322
335
useFixedDelay (
0 commit comments