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

Implement copy-paste for rows in TableBlock #2887

Open
wants to merge 3 commits into
base: feature/table-block
Choose a base branch
from

Conversation

jamesricky
Copy link
Contributor

@jamesricky jamesricky commented Dec 5, 2024

@jamesricky jamesricky self-assigned this Dec 5, 2024
Copy link
Collaborator

@johnnyomair johnnyomair left a comment

Choose a reason for hiding this comment

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

Should this really be done via the clipboard? Wouldn't in memory be sufficient?

@jamesricky
Copy link
Contributor Author

Should this really be done via the clipboard?

I think it makes sense to handle this the same as copy/pasting blocks.
This allows copying between different table-blocks, environments and projects.

Wouldn't in memory be sufficient?

What do you mean with "in memory"?
Save it in a variable/state?

@johnnyomair
Copy link
Collaborator

What do you mean with "in memory"?
Save it in a variable/state?

Exactly.

I think it makes sense to handle this the same as copy/pasting blocks.
This allows copying between different table-blocks, environments and projects.

Good point, then let's keep it like this.

@jamesricky jamesricky force-pushed the table-block-copy-paste-rows branch from 64a5dff to b5846d0 Compare December 5, 2024 15:43
Base automatically changed from table-block-duplicate-rows-and-columns to feature/table-block December 5, 2024 15:52
@jamesricky jamesricky force-pushed the table-block-copy-paste-rows branch from b5846d0 to c4d6cc6 Compare December 5, 2024 15:56
Comment on lines +12 to +15
const clipboardRowSchema = z.object({
highlighted: z.boolean(),
cellValues: z.array(z.string()),
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why did you decide to add zod?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seemed like the easies way to validate if the structure of the pasted JSON is correct

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you know of a better alternative/method?

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