Skip to content

feat(site): Support list(string) rich parameter field #6653

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 17, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Minor fixes
  • Loading branch information
BrunoQuaresma committed Mar 17, 2023
commit 1b0d866095fa6aa4e505323e94950432a3a16e67
1 change: 0 additions & 1 deletion site/src/components/MultiTextField/MultiTextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export const MultiTextField: FC<MultiTextFieldProps> = ({
key={index}
label={value}
size="small"
color="primary"
onDelete={() => {
onChange(values.filter((oldValue) => oldValue !== value))
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@ const RichParameterField: React.FC<RichParameterInputProps> = ({
values={values}
onChange={(values) => {
try {
onChange(JSON.stringify(values))
const value = JSON.stringify(values)
setParameterValue(value)
onChange(value)
} catch (e) {
console.error("Error on change of list(string) parameter", e)
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to do anything else with error handling here or on line 165?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is something we control but in case it gets an error, I added a message to help a bit more.

}
Expand Down
5 changes: 5 additions & 0 deletions site/src/theme/overrides.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,5 +229,10 @@ export const getOverrides = ({
borderRadius: 999,
},
},
MuiChip: {
root: {
backgroundColor: colors.gray[12],
},
},
}
}