Skip to content

Commit ef72f6f

Browse files
authored
Biz/dj 2788 google sheets submission doesnt work (#15179)
* Fix issue with loading dynamic props, e.g. google sheets column headers * Update version * Use query input as queryKey for useQuery * Pass dynamicPropsId when calling client run * Fix linter errors * Fix linter error
1 parent fed27d2 commit ef72f6f

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

packages/connect-react/examples/nextjs/src/app/page.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ export default function Home() {
2121
text: "hello slack!",
2222
});
2323

24+
const [
25+
dynamicPropsId,
26+
setDynamicPropsId,
27+
] = useState<string | undefined>();
28+
29+
const handleDynamicProps = (dynamicProps: { id: string | undefined }) => {
30+
setDynamicPropsId(dynamicProps.id)
31+
}
32+
2433
return (
2534
<>
2635
<div>My application</div>
@@ -29,13 +38,15 @@ export default function Home() {
2938
userId={userId}
3039
componentKey="slack-send-message"
3140
configuredProps={configuredProps}
41+
onUpdateDynamicProps={handleDynamicProps}
3242
onUpdateConfiguredProps={setConfiguredProps}
3343
onSubmit={async () => {
3444
try {
3545
await client.actionRun({
3646
userId,
3747
actionId: "slack-send-message",
3848
configuredProps,
49+
dynamicPropsId,
3950
});
4051
} catch (error) {
4152
console.error("Action run failed:", error);

packages/connect-react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/connect-react",
3-
"version": "1.0.0-preview.15",
3+
"version": "1.0.0-preview.16",
44
"description": "Pipedream Connect library for React",
55
"files": [
66
"dist"

packages/connect-react/src/hooks/form-context.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,17 @@ export const FormContextProvider = <T extends ConfigurableProps>({
129129
configuredProps,
130130
dynamicPropsId: dynamicProps?.id,
131131
};
132+
const queryKeyInput = {
133+
...componentReloadPropsInput,
134+
}
135+
132136
const {
133137
isFetching: dynamicPropsQueryIsFetching,
134138
// TODO error
135139
} = useQuery({
136140
queryKey: [
137141
"dynamicProps",
142+
queryKeyInput,
138143
],
139144
queryFn: async () => {
140145
const { dynamicProps } = await client.componentReloadProps(componentReloadPropsInput);

0 commit comments

Comments
 (0)