-
Notifications
You must be signed in to change notification settings - Fork 62
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
base: master
Are you sure you want to change the base?
Conversation
test/helpers-isFilled.test.ts
Outdated
it("table", (/*ctx*/) => { | ||
expect(isFilled.table(null)).toBe(false) | ||
expect(isFilled.table(undefined)).toBe(false) | ||
// expect(isFilled.table(ctx.mock.value.table())).toBe(true) |
There was a problem hiding this comment.
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
* | ||
* @returns `true` if `field` is filled, `false` otherwise. | ||
*/ | ||
export const table = isNonNullish as ( |
There was a problem hiding this comment.
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
There was a problem hiding this 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.
export type { GeoPointField } from "./types/value/geoPoint" | ||
export type { TableField } from "./types/value/table" | ||
|
There was a problem hiding this comment.
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.
export type { CustomTypeModelGeoPointField } from "./types/model/geoPoint" | ||
export type { CustomTypeModelTableField } from "./types/model/table" | ||
|
There was a problem hiding this comment.
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.
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
Preview
How to QA 1
Footnotes
Please use these labels when submitting a review:
⚠️ #issue: Strongly suggest a change.
❓ #ask: Ask a question.
💡 #idea: Suggest an idea.
🎉 #nice: Share a compliment. ↩