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

Adds more natural default header option when inserting table columns #1006

Merged
merged 7 commits into from
Sep 14, 2021

Conversation

tjramage
Copy link
Collaborator

@tjramage tjramage commented Sep 13, 2021

Description

When inserting a new column to an existing table, the current implementation of the addColumn transform only allows for all table cells to be a header at once (TH) or none at all. However, most of the time, you usually want the top row of cells to remain as a table header and all other instances as standard TD cells.

This PR allows the flexibility for the header option to be more consistent with the current table row that we're iterating through when inserting a new column 🙂

To maintain backwards compatibility, I've made sure that this only happens if the header option is not set. If the header option is already configured when calling addColumn, then this will override the default behaviour for all table cell instances.

Checklist

  • The new code matches the existing patterns and styles.
  • The tests pass with yarn test.
  • The linter passes with yarn lint. (Fix errors with yarn lint --fix.)
  • The relevant examples still work: (Run examples with yarn docs.)

@tjramage tjramage requested a review from dylans as a code owner September 13, 2021 13:10
@changeset-bot
Copy link

changeset-bot bot commented Sep 13, 2021

🦋 Changeset detected

Latest commit: 56b2551

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@udecode/plate-table Patch
@udecode/plate-table-ui Patch
@udecode/plate Patch
@udecode/plate-csv-serializer Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Sep 13, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/udecode/plate/9yd9vuxHsEKjtY8RBBxt9CZ8h6fy
✅ Preview: https://plate-git-fork-tjramage-patch-1-udecode.vercel.app

dylans
dylans previously approved these changes Sep 14, 2021
@tjramage
Copy link
Collaborator Author

Thanks @dylans! Looking forward to getting this merged in 👍

@zbeyens
Copy link
Member

zbeyens commented Sep 14, 2021

Thanks @tjramage !

@zbeyens zbeyens merged commit bd3273d into udecode:main Sep 14, 2021
@github-actions github-actions bot mentioned this pull request Sep 14, 2021
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.

3 participants