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(structure): fixing incorrect way of setting col visibility #6716

Merged
merged 2 commits into from
May 21, 2024

Conversation

jordanl17
Copy link
Member

Description

Fixes an issue introduced in EDX-1308 (#6661) where tanstack col visibility expects field separator as _ but incorrectly . was being used for our definitions

What to review

Defining an id for all cols which is used in flatColumns.
Selected column now a display column

Testing

Updated test case

Notes for release

Not relevant - this feature is not yet user facing

@jordanl17 jordanl17 requested a review from a team as a code owner May 20, 2024 16:20
@jordanl17 jordanl17 requested review from binoy14 and removed request for a team May 20, 2024 16:20
Copy link

vercel bot commented May 20, 2024

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

Name Status Preview Comments Updated (UTC)
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 21, 2024 9:42am
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 21, 2024 9:42am
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 21, 2024 9:42am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview May 21, 2024 9:42am

Copy link
Contributor

No changes to documentation

Copy link
Contributor

github-actions bot commented May 20, 2024

Component Testing Report Updated May 21, 2024 9:44 AM (UTC)

File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 36s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 6s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 26s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 31s 11 7 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 14s 6 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 36s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 15s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 2s 18 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 6s 3 9 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 21s 9 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 14s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ❌ Failed (Inspect) 33s 11 0 1

Copy link
Contributor

@binoy14 binoy14 left a comment

Choose a reason for hiding this comment

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

don't have full context of what is going on here, probably makes more sense for Pedro to give a ✅

@@ -20,7 +21,7 @@ describe('useDocumentSheetColumns', () => {
{name: 'email', type: {name: 'string'}},
{name: 'age', type: {name: 'number'}},
{
name: 'address',
name: 'address.place',
Copy link
Contributor

Choose a reason for hiding this comment

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

This type of schema name won't be allowed in the studio, it doesn't support dot notation in the naems
Screenshot 2024-05-21 at 08 11 35

Copy link
Member Author

@jordanl17 jordanl17 May 21, 2024

Choose a reason for hiding this comment

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

  • tests don't need to test with dot notation

@@ -156,17 +160,19 @@ export function useDocumentSheetColumns(documentSchemaType?: ObjectSchemaType) {
() =>
flatColumns(columns).reduce<[VisibilityState, number]>(
([accCols, countAllowedVisible], column) => {
const visibilityKey = String(column.id)
Copy link
Contributor

Choose a reason for hiding this comment

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

Column id is possibly undefined according to the tanstack column definition and accessor functions, thinking on throwing an error if it doesn't have a column.id
We are controlling this, but in case something changes in the future it will be simpler to identify the problem if for some case the id is missing.

Copy link
Member Author

@jordanl17 jordanl17 May 21, 2024

Choose a reason for hiding this comment

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

  • throw if there's not an ID on a column

Copy link
Contributor

@pedrobonamin pedrobonamin left a comment

Choose a reason for hiding this comment

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

Thanks @jordanl17 looks good to me

@jordanl17 jordanl17 added this pull request to the merge queue May 21, 2024
Merged via the queue into next with commit 06f7902 May 21, 2024
40 checks passed
@jordanl17 jordanl17 deleted the EDX-1316 branch May 21, 2024 09:52
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.

None yet

3 participants