From dfe4738d9da64cb171fac1bfa9abac444bd7ee3a Mon Sep 17 00:00:00 2001 From: Uladzislau_Kutarkin Date: Fri, 20 Dec 2024 13:53:57 +0400 Subject: [PATCH 1/2] UIPQB-175: Displays the "Smth went wrong" page, when the user clicks on "Select operator" dropdown and selects any of them, if there are deleted custom fields. --- CHANGELOG.md | 1 + src/QueryBuilder/QueryBuilder/helpers/query.js | 10 ++-------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 767d4c5..d22d50d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * [UIPQB-168](https://folio-org.atlassian.net/browse/UIPQB-168) Allow editing queries containing no fields. * [UIPQB-141](https://folio-org.atlassian.net/browse/UIPQB-141) Modal dialog focus inconsistencies across screenreaders. +* [UIPQB-175](https://folio-org.atlassian.net/browse/UIPQB-175) Displays the "Smth went wrong" page, when the user clicks on "Select operator" dropdown and selects any of them, if there are deleted custom fields. ## [1.2.6](https://github.com/folio-org/ui-plugin-query-builder/tree/v1.2.6) (2024-12-11) diff --git a/src/QueryBuilder/QueryBuilder/helpers/query.js b/src/QueryBuilder/QueryBuilder/helpers/query.js index d29cc45..0786b6f 100644 --- a/src/QueryBuilder/QueryBuilder/helpers/query.js +++ b/src/QueryBuilder/QueryBuilder/helpers/query.js @@ -191,17 +191,11 @@ const getFormattedSourceField = async ({ item, intl, booleanOptions, fieldOption if (!fieldItem) { return { boolean: { options: booleanOptions, current: boolean }, - field: { options: fieldOptions, current: field, dataType: defaultItem?.dataType }, + field: { options: fieldOptions, dataType: defaultItem?.dataType }, operator: { - dataType: defaultItem?.dataType, - options: getOperatorOptions({ - dataType: defaultItem?.dataType, - hasSourceOrValues: defaultItem?.value || defaultItem?.source, - intl, - }), current: '', }, - value: { current: '', source: defaultItem?.source, options: defaultItem?.values }, + value: { current: '' }, }; } From fd827fdff4b652a10fa36254a6150a95c0934d78 Mon Sep 17 00:00:00 2001 From: Uladzislau_Kutarkin Date: Fri, 20 Dec 2024 14:02:29 +0400 Subject: [PATCH 2/2] UIPQB-175: fix test case --- src/QueryBuilder/QueryBuilder/helpers/query.test.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/QueryBuilder/QueryBuilder/helpers/query.test.js b/src/QueryBuilder/QueryBuilder/helpers/query.test.js index 1451062..e77eafc 100644 --- a/src/QueryBuilder/QueryBuilder/helpers/query.test.js +++ b/src/QueryBuilder/QueryBuilder/helpers/query.test.js @@ -258,18 +258,13 @@ describe('mongoQueryToSource()', () => { boolean: { options: booleanOptions, current: '$and' }, field: { options: fieldOptions, - current: 'delegate_languages', dataType: defaultField?.dataType, }, operator: { - dataType: defaultField?.dataType, - options: expect.any(Array), current: '', }, value: { current: '', - source: defaultField?.source, - options: defaultField?.values, }, }, ]);