Skip to content

Commit

Permalink
Merge pull request #5071 from gooddata/ine-lx-336
Browse files Browse the repository at this point in the history
fix: proper query options when searching
  • Loading branch information
NestorEncinas authored Jun 27, 2024
2 parents 01bb4ca + c679d1f commit 69b5f0d
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ export function* elementsSaga(

const { enableDuplicatedLabelValuesInAttributeFilter } = context;

const filterByPrimaryLabelProp =
enableDuplicatedLabelValuesInAttributeFilter &&
attributeFilterDisplayAsDisplayFormRef &&
!options.search // when searching by string, we need to apply it to the displayAsLabel directly not primary label
? { filterByPrimaryLabel: true }
: {};

const elementsQueryResult: PromiseFnReturnType<typeof loadElements> = yield call(
loadElements,
context,
Expand All @@ -50,9 +57,7 @@ export function* elementsSaga(
? attributeFilterDisplayAsDisplayFormRef
: attributeFilterDisplayFormRef,
...options,
...(enableDuplicatedLabelValuesInAttributeFilter && attributeFilterDisplayAsDisplayFormRef
? { filterByPrimaryLabel: true }
: {}),
...filterByPrimaryLabelProp,
},
{
hiddenElements,
Expand Down

0 comments on commit 69b5f0d

Please sign in to comment.