Content-Length: 338831 | pFad | http://github.com/lowcoder-org/lowcoder/pull/1443/commits/ed1220665bc383999045f8788a72a0d18c02c57d

3B Feat/query triggers by raheeliftikhar5 · Pull Request #1443 · lowcoder-org/lowcoder · GitHub
Skip to content

Feat/query triggers #1443

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added onTimeout trigger on query
  • Loading branch information
raheeliftikhar5 committed Jan 14, 2025
commit ed1220665bc383999045f8788a72a0d18c02c57d
15 changes: 14 additions & 1 deletion client/packages/lowcoder/src/comps/queries/queryComp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,13 @@ export const TriggerTypeOptions = [
{ label: "On Page Load", value: "onPageLoad"},
{ label: "On Input Change", value: "onInputChange"},
{ label: "On Query Execution", value: "onQueryExecution"},
{ label: "On Timeout", value: "onTimeout"},
{ label: trans("query.triggerTypeAuto"), value: "automatic" },
{ label: trans("query.triggerTypeManual"), value: "manual" },
] as const;

export const JSTriggerTypeOptions = [
{ label: trans("query.triggerTypeAuto"), value: "automatic" },
{ label: trans("query.triggerTypePageLoad"), value: "automatic" },
{ label: trans("query.triggerTypeManual"), value: "manual" },
];

Expand Down Expand Up @@ -160,7 +161,13 @@ const childrenMap = {
},
}),
cancelPrevious: withDefault(BoolPureControl, false),
// use only for onQueryExecution trigger
depQueryName: SimpleNameComp,
// use only for onTimeout trigger, triggers query after x time passed on page load
delayTime: millisecondsControl({
left: 0,
defaultValue: 5 * 1000,
})
};

let QueryCompTmp = withTypeAndChildren<typeof QueryMap, ToInstanceType<typeof childrenMap>>(
Expand Down Expand Up @@ -317,6 +324,12 @@ function QueryView(props: QueryViewProps) {
comp.dispatch(deferAction(executeQueryAction({})));
}, 300);
}

if(getTriggerType(comp) === "onTimeout") {
setTimeout(() => {
comp.dispatch(deferAction(executeQueryAction({})));
}, comp.children.delayTime.getView());
}
}, []);

useFixedDelay(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,16 @@ export const QueryGeneralPropertyView = (props: {
/>
</TriggerTypeStyled>
)}
{children.triggerType.getView() === 'onTimeout' && (
<TriggerTypeStyled>
{children.delayTime.propertyView({
label: trans("query.timeout"),
placeholder: "5s",
tooltip: trans("query.timeoutTooltip", { maxSeconds: 3600, defaultSeconds: 5 }),
placement: "bottom",
})}
</TriggerTypeStyled>
)}
</>
)}
</QuerySectionWrapper>
Expand Down








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/lowcoder-org/lowcoder/pull/1443/commits/ed1220665bc383999045f8788a72a0d18c02c57d

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy