Skip to content

Conversation

@yomybaby
Copy link
Member

@yomybaby yomybaby commented Aug 21, 2025

Resolves #4143 (FR-1370)

Introduce BAIGraphQLPropertyFilter Component

This PR introduces a new BAIGraphQLPropertyFilter component that provides an advanced filtering interface for GraphQL-based Backend.AI applications. The component allows users to construct complex filter conditions that can be directly used in GraphQL queries.

Key features:

  • Support for various GraphQL filter types (String, Number, Boolean, Enum)
  • Flexible combination modes (AND/OR) for multiple filter conditions
  • Rich set of operators (eq, ne, contains, startsWith, endsWith, gt, gte, lt, lte, in, notIn)
  • Type-safe filtering with automatic operator suggestions based on property types
  • Bidirectional conversion between UI conditions and GraphQL filter objects
  • Validation rules and autocomplete suggestions for improved data integrity

The PR also includes comprehensive Storybook documentation with multiple examples demonstrating different use cases and configurations.

Additionally, updates the GraphQL transformer to be compatible with version 25.12.0 instead of 25.14.0.

@github-actions github-actions bot added the size:XL 500~ LoC label Aug 21, 2025
Copy link
Member Author

yomybaby commented Aug 21, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • flow:merge-queue - adds this PR to the back of the merge queue
  • flow:hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has required the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions
Copy link

github-actions bot commented Aug 21, 2025

Coverage report for ./packages/backend.ai-ui

St.
Category Percentage Covered / Total
🔴 Statements 53.11% 128/241
🔴 Branches 33.2% 80/241
🔴 Functions 35.71% 20/56
🔴 Lines 55.4% 118/213

Test suite run success

55 tests passing in 3 suites.

Report generated by 🧪jest coverage report action from a2a70f9

@github-actions
Copy link

github-actions bot commented Aug 21, 2025

Coverage report for ./react

St.
Category Percentage Covered / Total
🔴 Statements 4.62% 502/10873
🔴 Branches 3.72% 285/7657
🔴 Functions 2.63% 90/3427
🔴 Lines 4.58% 488/10646

Test suite run success

114 tests passing in 13 suites.

Report generated by 🧪jest coverage report action from 8619c7b

@yomybaby yomybaby marked this pull request as ready for review August 22, 2025 02:12
@Copilot Copilot AI review requested due to automatic review settings August 22, 2025 02:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a new BAIGraphQLPropertyFilter component for constructing GraphQL filter objects with a flexible UI interface, and updates GraphQL transformer compatibility to version 25.12.0.

  • Adds a comprehensive GraphQL property filter component with support for string, number, boolean, and enum filter types
  • Provides flexible combination modes (AND/OR) and rich operator support (eq, ne, contains, startsWith, etc.)
  • Updates GraphQL transformer version compatibility from 25.14.0 to 25.12.0

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
react/src/helper/graphql-transformer.ts Updates version compatibility check for GraphQL transformer
packages/backend.ai-ui/src/components/BAIGraphQLPropertyFilter.tsx New component implementation with types, utilities, and React component
packages/backend.ai-ui/src/components/BAIGraphQLPropertyFilter.stories.tsx Comprehensive Storybook documentation with multiple usage examples

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@yomybaby yomybaby force-pushed the feat/bai-graphql-property-filter branch from ee1f5d3 to 36ea8b5 Compare August 22, 2025 02:30
Copy link
Contributor

@agatha197 agatha197 left a comment

Choose a reason for hiding this comment

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

please update package/backend.ai-ui/src/components/index.ts

@agatha197 agatha197 force-pushed the feat/bai-graphql-property-filter branch from 36ea8b5 to a905a38 Compare August 22, 2025 07:28
@yomybaby yomybaby changed the title feat: Property filter component for GraphQL v2 filter type feat(FR-1370): Property filter component for GraphQL v2 filter type Aug 22, 2025
@yomybaby yomybaby force-pushed the feat/bai-graphql-property-filter branch from a905a38 to a4387ed Compare August 22, 2025 10:16
@yomybaby yomybaby force-pushed the feat/bai-graphql-property-filter branch from a4387ed to b26384d Compare August 26, 2025 02:31
@nowgnuesLee nowgnuesLee force-pushed the feat/bai-graphql-property-filter branch from b26384d to b000e29 Compare August 26, 2025 04:40
@nowgnuesLee nowgnuesLee force-pushed the feat/bai-graphql-property-filter branch from b000e29 to e5a7817 Compare August 26, 2025 08:33
@agatha197 agatha197 force-pushed the feat/bai-graphql-property-filter branch 2 times, most recently from b000e29 to c103a8e Compare August 26, 2025 10:15
@yomybaby yomybaby requested a review from nowgnuesLee September 2, 2025 01:33
@nowgnuesLee nowgnuesLee force-pushed the feat/bai-graphql-property-filter branch from 9950492 to 2dd2fae Compare September 2, 2025 02:33
Copy link
Contributor

@nowgnuesLee nowgnuesLee left a comment

Choose a reason for hiding this comment

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

LGTM

@agatha197 agatha197 force-pushed the feat/bai-graphql-property-filter branch from 2dd2fae to c5bcbf9 Compare September 2, 2025 07:37
@nowgnuesLee nowgnuesLee force-pushed the feat/bai-graphql-property-filter branch from c5bcbf9 to 2dd2fae Compare September 2, 2025 08:30
@graphite-app
Copy link

graphite-app bot commented Sep 3, 2025

Merge activity

…4170)

Resolves #4143 ([FR-1370](https://lablup.atlassian.net/browse/FR-1370))

# Introduce BAIGraphQLPropertyFilter Component

This PR introduces a new `BAIGraphQLPropertyFilter` component that provides an advanced filtering interface for GraphQL-based [Backend.AI](http://Backend.AI) applications. The component allows users to construct complex filter conditions that can be directly used in GraphQL queries.

Key features:

- Support for various GraphQL filter types (String, Number, Boolean, Enum)
- Flexible combination modes (AND/OR) for multiple filter conditions
- Rich set of operators (eq, ne, contains, startsWith, endsWith, gt, gte, lt, lte, in, notIn)
- Type-safe filtering with automatic operator suggestions based on property types
- Bidirectional conversion between UI conditions and GraphQL filter objects
- Validation rules and autocomplete suggestions for improved data integrity

The PR also includes comprehensive Storybook documentation with multiple examples demonstrating different use cases and configurations.

Additionally, updates the GraphQL transformer to be compatible with version 25.12.0 instead of 25.14.0.

[FR-1370]: https://lablup.atlassian.net/browse/FR-1370?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500~ LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Introduce BAIPropertyFilterObject component

3 participants