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

Simplify multi-object picker logic with search #8010

Merged
merged 22 commits into from
Nov 7, 2024

Conversation

ijreilly
Copy link
Collaborator

@ijreilly ijreilly commented Oct 23, 2024

Simplifying the logic around multi-object pickers and search by getting rid of the behaviour that keeped selected elements even when they did not match the search filter (eg keeping selected record "Brian Chesky" in dropdown even when search input is "Qonto"). This allows us to simplify the fetch queries around the search to only do one query.

@ijreilly ijreilly changed the title Fix multi pickers glitch Simplify multi-object picker logic Oct 24, 2024
@ijreilly ijreilly changed the title Simplify multi-object picker logic Simplify multi-object picker logic with search Oct 24, 2024
@ijreilly ijreilly marked this pull request as ready for review October 24, 2024 12:16
@ijreilly ijreilly requested a review from lucasbordeau October 24, 2024 12:19
import { RelationPickerScopeInternalContext } from '@/object-record/relation-picker/scopes/scope-internal-context/RelationPickerScopeInternalContext';
import { useAvailableScopeIdOrThrow } from '@/ui/utilities/recoil-scope/scopes-internal/hooks/useAvailableScopeId';
import { isDeeplyEqual } from '~/utils/isDeeplyEqual';

export type SelectedObjectRecordId = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we extract this type ?

import { isObjectMetadataItemSearchableInCombinedRequest } from '@/object-record/utils/isObjectMetadataItemSearchableInCombinedRequest';
import { isDefined } from '~/utils/isDefined';

export const formatSearchResults = (
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we extract this util and call it inside useMultiObjectRecordsQueryResultFormattedAsObjectRecordForSelectArray ?

@lucasbordeau lucasbordeau merged commit ac233b7 into main Nov 7, 2024
19 checks passed
@lucasbordeau lucasbordeau deleted the fix-multi-pickers-glitch branch November 7, 2024 16:09
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