-
Notifications
You must be signed in to change notification settings - Fork 3
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
ObjectArrayControl #33
Conversation
78ccc2d
to
08298c4
Compare
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 needs a test--make sure to specifically test the case where multiple items exist in a list, and the first one is deleted. The bug I'm worried about is that deleting the first one just shortens the list.
src/controls/ObjectArrayControl.tsx
Outdated
import { JsonFormsDispatch } from "@jsonforms/react" | ||
import { Flex, List, Button } from "antd" | ||
import range from "lodash.range" | ||
import React, { useCallback, useEffect } from "react" |
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 think you can/should omit this (the React import, I mean)
Co-authored-by: Drew Hoover <[email protected]>
}) | ||
await screen.findByDisplayValue("my asset") | ||
await user.click(screen.getByRole("button", { name: "Add Assets" })) | ||
const newAsset = await screen.findByDisplayValue("") |
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 is a bit odd--maybe findByLabelText("Name")?
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.
The two inputs would have the same label though. I can update test to go from no data to some data instead
expect(updatedRemoveButtons).toHaveLength(2) | ||
}) | ||
|
||
test("ObjectArrayControl renders with overwritten icons and does not allow overwriting onClick", async () => { |
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.
what does overwritten icons mean, exactly?
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.
3ce20bb
to
4d2ea9b
Compare
84513b0
to
8475e64
Compare
@@ -0,0 +1,146 @@ | |||
import type { Meta, StoryObj } from "@storybook/react" | |||
|
|||
import { rendererRegistryEntries } from "../../renderers" |
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 should be a merge conflict, right? Since renderers was renamed to renderer-registry-entries
src/ui-schema.ts
Outdated
@@ -1,5 +1,5 @@ | |||
import type { JsonSchema } from "@jsonforms/core" | |||
import type { AlertProps, InputNumberProps } from "antd" | |||
import { JsonSchema } from "@jsonforms/core" |
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.
why kill the type imports?
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.
Oops. Bad rebase.
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.
Approving but pls fix the import in the story first
🎉 This PR is included in version 1.7.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Will add tests in a separate PR