Skip to content

Commit

Permalink
UIPQB-175: Displays the "Smth went wrong" page, when the user clicks …
Browse files Browse the repository at this point in the history
…on "Select operator" dropdown and selects any of them, if there are deleted custom fields. (#201)
  • Loading branch information
UladzislauKutarkin authored Dec 24, 2024
1 parent 3c7f980 commit f97fb60
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* [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-162](https://folio-org.atlassian.net/browse/UIPQB-162) Errors when query includes a modified custom field.
* [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)

Expand Down
10 changes: 2 additions & 8 deletions src/QueryBuilder/QueryBuilder/helpers/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: '' },
};
}

Expand Down
5 changes: 0 additions & 5 deletions src/QueryBuilder/QueryBuilder/helpers/query.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
},
]);
Expand Down

0 comments on commit f97fb60

Please sign in to comment.