这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@jyash97
Copy link
Contributor

@jyash97 jyash97 commented Dec 30, 2022

Potential fix for #959

@vercel
Copy link

vercel bot commented Dec 30, 2022

@jyash97 is attempting to deploy a commit to the Rowy Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Dec 30, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
rowy-os ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Dec 30, 2022 at 9:24PM (UTC)
1 Ignored Deployment
Name Status Preview Comments Updated
rowy-typedoc ⬜️ Ignored (Inspect) Dec 30, 2022 at 9:24PM (UTC)

icon: <DataArrayIcon />,
settings: Settings,
description:
"Connects to a sub-table in the current row. Also displays number of rows inside the sub-table. Max sub-table depth: 100.",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need description

description:
"Connects to a sub-table in the current row. Also displays number of rows inside the sub-table. Max sub-table depth: 100.",
TableCell: withRenderTableCell(DisplayCell, SideDrawerField, "popover", {
popoverProps: { PaperProps: { sx: { p: 1, minWidth: "200px" } } },
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I went with the popover approach because the sub-table approach opens a Modal from the bottom, and thus the user loses the context of the row since he has to close the modal to see the row and the Modal breaks the flow, IMO Popover approach seems to be simple steps to go with. Let me know I can use modal in case this isn't what we want

Copy link
Contributor

Choose a reason for hiding this comment

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

You can try embedding the table component inside the popover, however providing a way to configure the column schema might be more challenging

Comment on lines +72 to +81
<CodeEditor
defaultLanguage="json"
value={JSON.stringify(value) || "{\n \n}"}
onChange={(v) => {
try {
if (v) onChange(JSON.parse(v));
} catch (e) {
console.log(`Failed to parse JSON: ${e}`);
}
}}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This can be used to add array of objects

@jyash97
Copy link
Contributor Author

jyash97 commented Dec 31, 2022

Need to add delete field option

@shamsmosowi
Copy link
Contributor

Hi @ jyash97, this column type is an interesting idea. It could be helpful in some cases, especially if we add support for Rowy column types, not just the base types.
I don't think it solves the main objective of #959, which is mainly concerned with the need to provide users with a way to enter arrays of structured JSON data easily/safely

@jyash97
Copy link
Contributor Author

jyash97 commented Jan 3, 2023

@shamsmosowi

Thanks for the review.

I think the issue needs to be more informative since it doesn't focus on the structured JSON data and just mentions array fields. Now I have a better understanding of what the issue is about, tho I have a few questions:

  1. Where to store the structure of the array, let's say the structure should be {title: string; description: string}[], where we would save it & provide an option to configure it?
  2. On opening the drawer from the bottom, where do we show the schema? Or we would just show the data
  3. Which types to use for the table and will it be editable? string, boolean? or the Short text, long text types?
  4. Will adding a new row save the data automatically ? Or do we need to display a save button option to save the new rows?
  5. How to render a nested object or array of array in the array table? Let's say we have a structure:
    meta: { name: string; id: string; }
    
    So we render the column as meta.name or do we just render meta column with JSON editor ?

@jyash97 jyash97 closed this Jan 9, 2023
@jyash97
Copy link
Contributor Author

jyash97 commented Jan 9, 2023

Closing this because of inactivity and the PR does not solve the issue of adding schema and adding/editing an array of object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants