Skip to content

Commit 74a3ff3

Browse files
committed
fix(connect-react): handle withLabel configurable prop attribute (1.0.0-preview.6)
1 parent 2fd610a commit 74a3ff3

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

packages/connect-react/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
<!-- markdownlint-disable MD024 -->
22
# Changelog
33

4+
# [1.0.0-preview.6] - 2024-12-05
5+
6+
- Handle configurable prop `withLabel` (eg. fixes config of Airtable `tableId`)
7+
48
# [1.0.0-preview.5] - 2024-12-02
59

610
- Change colors of "Connect App" button

packages/connect-react/examples/nextjs/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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.5",
3+
"version": "1.0.0-preview.6",
44
"description": "Pipedream Connect library for React",
55
"files": [
66
"dist"

packages/connect-react/src/components/ControlSelect.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ export function ControlSelect<T>({
5959
}
6060
}
6161
}
62+
} else if (ret.__lv) {
63+
ret = ret.__lv
6264
}
6365
}
6466
return ret;
@@ -87,14 +89,22 @@ export function ControlSelect<T>({
8789
if (typeof o[0] === "object" && "value" in o[0]) {
8890
const vs = [];
8991
for (const _o of o) {
90-
vs.push(_o.value);
92+
if (prop.withLabel) {
93+
vs.push(_o);
94+
} else {
95+
vs.push(_o.value);
96+
}
9197
}
9298
onChange(vs);
9399
} else {
94100
onChange(o);
95101
}
96102
} else if (typeof o === "object" && "value" in o) {
97-
onChange(o.value);
103+
if (prop.withLabel) {
104+
onChange({__lv: o});
105+
} else {
106+
onChange(o.value);
107+
}
98108
} else {
99109
throw new Error("unhandled option type"); // TODO
100110
}

0 commit comments

Comments
 (0)