Skip to content

Commit

Permalink
fix: avoid showing converted objects as default data connectors options
Browse files Browse the repository at this point in the history
fix #3475
  • Loading branch information
lorenzo-cavazzi committed Jan 15, 2025
1 parent f6841a4 commit 0904902
Showing 1 changed file with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,12 @@ function PasswordOptionItem({
id={option.name}
type={showPassword ? "text" : "password"}
className={cx("form-control", "rounded-0", "rounded-start")}
placeholder={option.convertedDefault?.toString() ?? ""}
placeholder={
option.convertedDefault &&
option.convertedDefault?.toString() !== "[object Object]"
? option.convertedDefault?.toString()
: ""
}
onChange={(e) => {
field.onChange(e);
onFieldValueChange(option.name, e.target.value);
Expand Down Expand Up @@ -530,7 +535,12 @@ function PasswordOptionItemStored({
readOnly={true}
type="text"
className={cx("form-control", "rounded-0", "rounded-start")}
placeholder={option.convertedDefault?.toString() ?? ""}
placeholder={
option.convertedDefault &&
option.convertedDefault?.toString() !== "[object Object]"
? option.convertedDefault?.toString()
: ""
}
onChange={() => {}}
/>
)}
Expand Down Expand Up @@ -580,7 +590,8 @@ function InputOptionItem({
type={inputType}
className="form-control"
placeholder={
option.convertedDefault
option.convertedDefault &&
option.convertedDefault?.toString() !== "[object Object]"
? option.convertedDefault?.toString()
: inputType === "dropdown"
? option.filteredExamples[0].value
Expand Down Expand Up @@ -910,9 +921,7 @@ export function AddStorageOptions({
<InputOptionItem
control={control}
defaultValue={
storage.options &&
storage.options[o.name] &&
storage.options[o.name] !== "[object Object]"
storage.options && storage.options[o.name]
? (storage.options[o.name] as string | number | undefined)
: ""
}
Expand Down

0 comments on commit 0904902

Please sign in to comment.