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

feat: support table field #375

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

feat: support table field #375

wants to merge 10 commits into from

Conversation

levimykel
Copy link
Contributor

@levimykel levimykel commented Jan 21, 2025

Resolves:
https://linear.app/prismic/issue/DT-2584/[m]-aadev-when-i-add-a-table-field-i-can-see-the-according-type

Description

Adds table field type and value.

Checklist

  • A comprehensive Linear ticket, providing sufficient context and details to facilitate the review of the PR, is linked to the PR.
  • If my changes require tests, I added them.
  • If my changes affect backward compatibility, it has been discussed.
  • If my changes require an update to the CONTRIBUTING.md guide, I updated it.

Preview

How to QA 1

Footnotes

  1. Please use these labels when submitting a review:
    ❓ #ask: Ask a question.
    💡 #idea: Suggest an idea.
    ⚠️ #issue: Strongly suggest a change.
    🎉 #nice: Share a compliment.

it("table", (/*ctx*/) => {
expect(isFilled.table(null)).toBe(false)
expect(isFilled.table(undefined)).toBe(false)
// expect(isFilled.table(ctx.mock.value.table())).toBe(true)
Copy link
Contributor

Choose a reason for hiding this comment

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

todo: uncomment this one when the mock is ready

@dani-mp dani-mp marked this pull request as ready for review January 24, 2025 15:09
*
* @returns `true` if `field` is filled, `false` otherwise.
*/
export const table = isNonNullish as (
Copy link
Contributor

@dani-mp dani-mp Jan 24, 2025

Choose a reason for hiding this comment

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

we might want to do something more sophisticated here, i.e. a table with no head and an empty body is probably "not filled", but it feels more like a product question

Copy link
Contributor Author

@levimykel levimykel left a comment

Choose a reason for hiding this comment

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

This looks good. I added a couple of comments.

Comment on lines 229 to 231
export type { GeoPointField } from "./types/value/geoPoint"
export type { TableField } from "./types/value/table"

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 would alphabetize TableField and GeoPointField here, but it's not a big deal.

Comment on lines 291 to 293
export type { CustomTypeModelGeoPointField } from "./types/model/geoPoint"
export type { CustomTypeModelTableField } from "./types/model/table"

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 would alphabetize CustomTypeModelTableField and CustomTypeModelGeoPointField here, but it's not a big deal.

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