Skip to content
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

fix(designer): Complex array items to only be required if ancestors are all required #6278

Merged
merged 9 commits into from
Jan 6, 2025

Conversation

Eric-B-Wu
Copy link
Contributor

Fixes #5084

@Eric-B-Wu Eric-B-Wu requested a review from Copilot December 19, 2024 05:09

Choose a reason for hiding this comment

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (7)

libs/designer-ui/src/lib/arrayeditor/util/util.ts:228

  • Removing the error parameter from the catch block can make debugging harder. Consider keeping the error parameter for better error handling.
catch {

libs/designer-ui/src/lib/arrayeditor/util/util.ts:273

  • Removing the error parameter from the catch block can make debugging harder. Consider keeping the error parameter for better error handling.
catch {

libs/designer-ui/src/lib/arrayeditor/util/util.ts:105

  • [nitpick] The function name handleArrayItems could be more descriptive. Consider renaming it to something like handleArrayItemsInComplexArray.
const handleArrayItems = (

libs/designer-ui/src/lib/arrayeditor/util/util.ts:130

  • [nitpick] The function name handleSimpleItem could be more descriptive. Consider renaming it to something like handleSimpleItemInComplexArray.
const handleSimpleItem = (

libs/designer-ui/src/lib/arrayeditor/util/util.ts:150

  • [nitpick] The function name handleArrayOfComplexItems could be more descriptive. Consider renaming it to something like handleArrayOfComplexItemsInArray.
const handleArrayOfComplexItems = (

libs/designer-ui/src/lib/arrayeditor/util/util.ts:31

  • Ensure that the new behavior introduced by the isRequired parameter is adequately covered by tests.
export const getOneDimensionalSchema = (itemSchema: ArrayItemSchema, isRequired: boolean): ItemSchemaItemProps[] => {

libs/designer-ui/src/lib/arrayeditor/index.tsx:136

  • Ensure that the new isRequired behavior is covered by tests.
const objectValue = parseComplexItems(newItems, itemSchema, isRequired, castParameter, suppressCastingForSerialize);
@Eric-B-Wu Eric-B-Wu merged commit 9276e62 into main Jan 6, 2025
12 checks passed
@Eric-B-Wu Eric-B-Wu deleted the eric/complexArrayEditorRequired branch January 6, 2025 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants