From 390f26f5e438849ff1afd0efa093d2c21ec4cf2a Mon Sep 17 00:00:00 2001 From: Uladzislau_Kutarkin Date: Wed, 28 Feb 2024 15:12:22 +0400 Subject: [PATCH] UIPQB-78: Query builder display if no records match the query --- CHANGELOG.md | 1 + .../QueryBuilderModal/QueryBuilderModal.js | 8 ++++++- .../ViewerHeadline/ViewerHeadline.js | 21 ++++++++++++------- translations/ui-plugin-query-builder/en.json | 1 + 4 files changed, 23 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 46d245f1..1c7e691a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ * [UIPQB-80](https://issues.folio.org/browse/UIPQB-80) Add operators for NumberType and adjust operators for IntegerType. * [UIPQB-73](https://folio-org.atlassian.net/browse/UIPQB-73) Result Viewer shows current date if date column is not present. * [UIPQB-82](https://folio-org.atlassian.net/browse/UIPQB-82) [Query Builder] Support querying based on nested objects within arrays. +* [UIPQB-78](https://folio-org.atlassian.net/browse/UIPQB-78) Query builder display if no records match the query ## [1.0.0](https://github.com/folio-org/ui-plugin-query-builder/tree/v1.0.0) (2023-10-12) diff --git a/src/QueryBuilder/QueryBuilder/QueryBuilderModal/QueryBuilderModal.js b/src/QueryBuilder/QueryBuilder/QueryBuilderModal/QueryBuilderModal.js index e1c71426..3de6e5c2 100644 --- a/src/QueryBuilder/QueryBuilder/QueryBuilderModal/QueryBuilderModal.js +++ b/src/QueryBuilder/QueryBuilder/QueryBuilderModal/QueryBuilderModal.js @@ -40,6 +40,7 @@ export const QueryBuilderModal = ({ getParamsSource, recordsLimit, additionalControls, + canRunEmptyQuery, }) => { const intl = useIntl(); const queryClient = useQueryClient(); @@ -160,11 +161,16 @@ export const QueryBuilderModal = ({ } }, [source, isTestQueryInProgress]); + const isRunQueryDisabled = !isQueryRetrieved + || !isQueryFilled + || isRunQueryLoading + || (!canRunEmptyQuery && entityType?.columns); + const renderFooter = () => (