Skip to content
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
2 changes: 1 addition & 1 deletion components/onelogin/onelogin.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
2 changes: 1 addition & 1 deletion components/pennylane/pennylane.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
2 changes: 1 addition & 1 deletion components/pingone/pingone.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
4 changes: 4 additions & 0 deletions packages/connect-react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<!-- markdownlint-disable MD024 -->
# Changelog

# [1.0.0-preview.10] - 2024-12-12

- Enforce string length limits

# [1.0.0-preview.9] - 2024-12-10

- Disabled submit button when form is incomplete
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.9",
"version": "1.0.0-preview.10",
"description": "Pipedream Connect library for React",
"files": [
"dist"
Expand Down
6 changes: 6 additions & 0 deletions packages/connect-react/src/hooks/form-context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import isEqual from "lodash.isequal";
import { useQuery } from "@tanstack/react-query";
import type {
ComponentReloadPropsOpts, ConfigurableProp, ConfigurableProps, ConfiguredProps, V1Component, PropValue,

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

View workflow job for this annotation

GitHub Actions / Lint Code Base

'PropValue' is defined but never used
} from "@pipedream/sdk";
import { useFrontendClient } from "./frontend-client-context";
import type { ComponentFormProps } from "../components/ComponentForm";
Expand Down Expand Up @@ -166,7 +166,7 @@

// these validations are necessary because they might override PropInput for number case for instance
// so can't rely on that base control form validation
const propErrors = <T extends ConfigurableProps>(prop: ConfigurableProp, value: unknown): string[] => {

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

View workflow job for this annotation

GitHub Actions / Lint Code Base

'T' is defined but never used
const errs: string[] = [];
if (value === undefined) {
if (!prop.optional) {
Expand All @@ -188,14 +188,20 @@
errs.push("not a boolean");
}
} else if (prop.type === "string") {
const { min = 1, max } = prop as unknown as { min?: number, max?: number }

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

View workflow job for this annotation

GitHub Actions / Lint Code Base

Expected a line break after this opening brace

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

View workflow job for this annotation

GitHub Actions / Lint Code Base

Expected a line break before this closing brace
if (typeof value !== "string") {
errs.push("not a string");
} else {
if (value.length < min)
errs.push("string too short");
if (max && value.length > max)
errs.push("string too long");
}
} else if (prop.type === "app") {
const field = fields[prop.name]
if (field) {
const app = field.extra.app
const err = appPropError({ value, app })

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

View workflow job for this annotation

GitHub Actions / Lint Code Base

Expected a line break after this opening brace

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

View workflow job for this annotation

GitHub Actions / Lint Code Base

Object properties must go on a new line

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

View workflow job for this annotation

GitHub Actions / Lint Code Base

Expected a line break before this closing brace
if (err) errs.push(err)
} else {
errs.push("field not registered")
Expand Down
Loading