RI-7776 Fix cloud discovery search and notifications#5296
Open
ArtemHoruzhenko wants to merge 2 commits intomainfrom
Open
RI-7776 Fix cloud discovery search and notifications#5296ArtemHoruzhenko wants to merge 2 commits intomainfrom
ArtemHoruzhenko wants to merge 2 commits intomainfrom
Conversation
…discovery - Calculate notification counts from original data instead of filtered items to prevent re-triggering toast when search filters change - Expand search fields in subscriptions page (type, provider, region, status) - Add statusAdded field to search in databases result page - Add comprehensive search tests for subscriptions page Fixes #RI-7776
Use empty string fallback to prevent false positives when statusAdded is undefined
Contributor
Code Coverage - Integration Tests
|
Contributor
Code Coverage - Backend unit tests
Test suite run success2990 tests passing in 287 suites. Report generated by 🧪jest coverage report action from 93f8edb |
Contributor
Code Coverage - Frontend unit tests
Test suite run success5475 tests passing in 703 suites. Report generated by 🧪jest coverage report action from 93f8edb |
pawelangelow
reviewed
Dec 4, 2025
| (item: RedisCloudSubscription) => | ||
| item.name?.toLowerCase()?.indexOf(value) !== -1 || | ||
| item.id?.toString()?.toLowerCase().indexOf(value) !== -1, | ||
| item.id?.toString()?.indexOf(value) !== -1 || |
Contributor
There was a problem hiding this comment.
I'm wondering can't we add such util:
export const filterBySearchTerm = <T extends Record<string, unknown>>(
items: T[],
searchTerm: string,
fields: (keyof T)[],
): T[] => {
const term = searchTerm.toLowerCase()
return items.filter((item) =>
fields.some((field) => {
const value = item[field]
return String(value ?? '').toLowerCase().includes(term)
}),
)
}
or
export const matchesSearch = (
fieldValue: unknown,
searchTerm: string, // expected to be already lowercased
): boolean => String(fieldValue ?? '').toLowerCase().includes(searchTerm)
and then this syntax would be easier to be read and moreover we have it in the RedisCloudDatabasesResult.tsx as well.
Maybe not for this PR, but actually, why not 😸
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes two issues in the cloud database discovery flow:
Root Cause
When search filtered items, the notification counts were recalculated from filtered data. This caused the
variantprop to change (e.g., from "attention" to "success" when filtered results had no failures), which triggered the MessageBar's useEffect to show a new toast.Solution
subscriptionsprop instead of filtereditemsstateTesting
Fixes #RI-7776
Note
Stabilizes notifications by deriving counts from original data and broadens search across subscriptions and database results, with tests added for search behavior.
countStatusActive/countStatusFailedfromsubscriptions(not filtereditems) inRedisCloudSubscriptions.tsxto avoid re-triggering toasts on search.RedisCloudSubscriptions.tsx: Search now matchesname,id,type,provider,region,status.RedisCloudDatabasesResult.tsx: Search now includesstatusAddedin addition to existing fields.RedisCloudSubscriptions.spec.tsx: Add comprehensive search tests (name, id, provider, region, status, type; case-insensitive) and test scaffolding withfaker.Written by Cursor Bugbot for commit 93f8edb. This will update automatically on new commits. Configure here.