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

Add support for null & not null filter options to enum columns #92

Merged
merged 3 commits into from
Jun 20, 2024

Conversation

JSReds
Copy link
Contributor

@JSReds JSReds commented Jun 19, 2024

No description provided.

Change-type: patch
@JSReds JSReds self-assigned this Jun 19, 2024
@JSReds JSReds requested a review from thgreasi June 19, 2024 12:32
@JSReds JSReds marked this pull request as ready for review June 19, 2024 12:32
@flowzone-app flowzone-app bot enabled auto-merge June 19, 2024 12:35
@JSReds JSReds changed the title Add enum null filter Add support for null & not null filter options to enum columns Jun 20, 2024
parsedFilterDescription: SieveFilterDescription,
): string => {
const { schema, value } = parsedFilterDescription;
if (schema && isDateTimeFormat(schema.format)) {
return dateFormat(value, 'PPPppp');
}
if (schema?.enum && 'enumNames' in schema) {
const index = schema.enum.findIndex((a) => isEqual(a, value));
return (schema.enumNames as string[])[index];
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess we could do v

Suggested change
return (schema.enumNames as string[])[index];
return String(schema.enumNames[index]);

@flowzone-app flowzone-app bot merged commit ae06983 into main Jun 20, 2024
45 checks passed
@flowzone-app flowzone-app bot deleted the add-enum-null-filter branch June 20, 2024 13:27
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

2 participants