-
Notifications
You must be signed in to change notification settings - Fork 0
Fixed bug - Support multiselect with integers #76
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
base: main
Are you sure you want to change the base?
Conversation
return options; | ||
} | ||
|
||
public void setOptions(Map<String, V> options) { | ||
public void setOptions(Map<Object, V> options) { | ||
boolean match = options.keySet().stream().allMatch(key -> key instanceof String || key instanceof Integer); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume only Strings and Integers are allowed here, unfortunately I had to change String here to Object, hope this validation is enough
@@ -114,7 +114,7 @@ const CodeArgumentInput: React.FC<CodeArgumentInputProps> = ({ arg }) => { | |||
orientation="horizontal" | |||
label={argLabel(arg)} | |||
errorMessage={fieldState.error ? fieldState.error.message : undefined} | |||
validationState={fieldState.error ? 'invalid' : 'valid'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
validationState is deprecated
@@ -171,9 +172,9 @@ const CodeArgumentInput: React.FC<CodeArgumentInputProps> = ({ arg }) => { | |||
<div> | |||
<ListView | |||
{...field} | |||
maxHeight="size-1600" | |||
maxHeight="size-2000" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This way always exactly 4 items display
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a bug by extending support for multiselect with integer keys in both the frontend and backend, while also refining validation handling in the CodeArgumentInput component.
- Updated TypeScript types to allow integer keys for multiselect options.
- Modified CodeArgumentInput to adjust validation and error handling.
- Adjusted Java code to accept integer keys and added a runtime type check in setOptions.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
ui.frontend/src/utils/api.types.ts | Updated MultiSelectArgument options type to support both string and number keys. |
ui.frontend/src/components/CodeArgumentInput.tsx | Revised validation logic and UI props to better handle multiselect inputs. |
core/src/main/java/com/vml/es/aem/acm/core/code/arg/MultiSelectArgument.java | Changed options type and added a key type check to restrict keys to string or integer. |
No description provided.