Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
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
8 changes: 8 additions & 0 deletions packages/connect-react/examples/nextjs/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
ComponentFormContainer, FrontendClientProvider,
} from "@pipedream/connect-react";
import { fetchToken } from "./actions";
import {DynamicProps} from "../../../../src";

Check failure on line 9 in packages/connect-react/examples/nextjs/src/app/page.tsx

View workflow job for this annotation

GitHub Actions / Lint Code Base

A space is required after '{'

Check failure on line 9 in packages/connect-react/examples/nextjs/src/app/page.tsx

View workflow job for this annotation

GitHub Actions / Lint Code Base

A space is required before '}'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix spacing for import statement.

Per lint rules, a space is required after { and before } in your import statement:

-import {DynamicProps} from "../../../../src";
+import { DynamicProps } from "../../../../src";
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import {DynamicProps} from "../../../../src";
import { DynamicProps } from "../../../../src";
🧰 Tools
🪛 eslint

[error] 9-9: A space is required after '{'.

(object-curly-spacing)


[error] 9-9: A space is required before '}'.

(object-curly-spacing)

🪛 GitHub Check: Lint Code Base

[failure] 9-9:
A space is required after '{'


[failure] 9-9:
A space is required before '}'

🪛 GitHub Actions: Pull Request Checks

[error] 9-9: A space is required after '{' (object-curly-spacing)


export default function Home() {
const userId = "my-authed-user-id";
Expand All @@ -21,6 +22,11 @@
text: "hello slack!",
});

const [
dynamicProps,
setDynamicProps,
] = useState<DynamicProps<any>>();

Check failure on line 28 in packages/connect-react/examples/nextjs/src/app/page.tsx

View workflow job for this annotation

GitHub Actions / Lint Code Base

Unexpected any. Specify a different type

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Specify a more precise type.

Using any for DynamicProps<any> reduces type safety. Provide a more specific type or introduce a generic that reflects the shape of your configurable props.

🧰 Tools
🪛 eslint

[error] 28-28: Unexpected any. Specify a different type.

(@typescript-eslint/no-explicit-any)

🪛 GitHub Check: Lint Code Base

[failure] 28-28:
Unexpected any. Specify a different type

return (
<>
<div>My application</div>
Expand All @@ -29,13 +35,15 @@
userId={userId}
componentKey="slack-send-message"
configuredProps={configuredProps}
onUpdateDynamicProps={setDynamicProps}
onUpdateConfiguredProps={setConfiguredProps}
onSubmit={async () => {
try {
await client.actionRun({
userId,
actionId: "slack-send-message",
configuredProps,
dynamicPropsId: dynamicProps?.id

Check failure on line 46 in packages/connect-react/examples/nextjs/src/app/page.tsx

View workflow job for this annotation

GitHub Actions / Lint Code Base

Missing trailing comma
});
} catch (error) {
console.error("Action run failed:", error);
Expand Down
2 changes: 1 addition & 1 deletion packages/connect-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/connect-react",
"version": "1.0.0-preview.15",
"version": "1.0.0-preview.16",
"description": "Pipedream Connect library for React",
"files": [
"dist"
Expand Down
5 changes: 5 additions & 0 deletions packages/connect-react/src/hooks/form-context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,17 @@
configuredProps,
dynamicPropsId: dynamicProps?.id,
};
const queryKeyInput = {
...componentReloadPropsInput,
}

const {
isFetching: dynamicPropsQueryIsFetching,
// TODO error
} = useQuery({
queryKey: [
"dynamicProps",
queryKeyInput

Check failure on line 142 in packages/connect-react/src/hooks/form-context.tsx

View workflow job for this annotation

GitHub Actions / Lint Code Base

Missing trailing comma
],
queryFn: async () => {
const { dynamicProps } = await client.componentReloadProps(componentReloadPropsInput);
Expand Down
Loading