Update filters UI to show properly errors#6043
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
🦋 Changeset detectedLatest commit: 5e5781a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
There was a problem hiding this comment.
Pull Request Overview
This PR enhances metadata filtering functionality by adding validation for metadata keys, supporting optional values for WHERE API queries, and improving error display in the filter UI.
Key changes:
- Adds validation to ensure metadata
keyis always provided while allowing emptyvaluefor WHERE API - Refactors UI components to display error messages in a dedicated row beneath filter inputs
- Centralizes API type constants and extracts filter definition resolvers to module level
Reviewed Changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| queryVariables.ts | Introduces QUERY_API_TYPES constant and refactors query variable functions to extract builders to module scope |
| intl.ts | Adds "No value" placeholder message for metadata inputs |
| context/provider.tsx | Passes queryApiType to all filter providers |
| context/context.ts | Adds queryApiType field to context type |
| Validation/metadata.ts | New validator ensuring metadata key is provided |
| Validation/metadata.test.ts | Tests for metadata validation logic |
| Validation/index.ts | Registers metadata validator |
| UI/Row.tsx | Refactored to use new FilterInputs and FilterErrors components with improved layout |
| UI/RightOperator.tsx | Removes helperText prop from component interface |
| UI/MetadataInput.tsx | Implements optional value support with dynamic placeholder based on API type |
| UI/MetadataInput.module.css | Styles for visible placeholders |
| UI/Filters.tsx | Simplified layout logic with label handling |
| UI/FilterInputs.tsx | New component extracting input rendering logic from Row |
| UI/FilterErrors.tsx | New component for displaying validation errors in a separate row |
| UI/BulkSelect.tsx | Removes helperText prop from interface |
| FiltersQueryBuilder/.../MetadataFilterInputQueryVarsBuilder.ts | Omits value field when empty for WHERE API |
| FiltersQueryBuilder/.../MetadataFilterInputQueryVarsBuilder.test.ts | Adds test for empty value handling |
| locale/defaultMessages.json | Adds translation entry for "No value" |
| .changeset files | Documents the changes for release notes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| index={index} | ||
| emitter={emitter} | ||
| error={error.right.show} | ||
| helperText={error.right.text} |
There was a problem hiding this comment.
The helperText prop is being passed to RightOperator, but this prop was removed from the RightOperatorProps interface (see RightOperator.tsx lines 29-35). This will cause a TypeScript error or runtime issue. Remove this prop as error messages are now displayed via the FilterErrors component.
| helperText={error.right.text} |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #6043 +/- ##
=========================================
Coverage 39.72% 39.72%
=========================================
Files 2437 2440 +3
Lines 39921 40002 +81
Branches 9123 8823 -300
=========================================
+ Hits 15857 15892 +35
- Misses 22853 24081 +1228
+ Partials 1211 29 -1182 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Uh oh!
There was an error while loading. Please reload this page.