Skip to content

Commit

Permalink
[UILISTS-184]Add polling mode for result viewer (#157)
Browse files Browse the repository at this point in the history
* Add polling mode for result viewer

* Add polling mode for result viewer
  • Loading branch information
SergeYvas authored Sep 27, 2024
1 parent 538882c commit 5f787f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/QueryBuilder/QueryBuilder/TestQuery/TestQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ export const TestQuery = ({

{queryId && (
<ResultViewer
poolingMode
onSuccess={handleQueryRetrieved}
onPreviewShown={handlePreviewShown}
forcedVisibleValues={forcedVisibleValues}
Expand Down
4 changes: 3 additions & 1 deletion src/QueryBuilder/ResultViewer/ResultViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { useLastNotEmptyValue } from '../../hooks/useLastNotEmptyValue';
export const ResultViewer = ({
showPagination = true,
defaultLimit = 100,
pollingMode = false,
defaultOffset = 0,
queryParams = {},
contentQueryOptions = {},
Expand Down Expand Up @@ -137,7 +138,7 @@ export const ResultViewer = ({
) : (
<MultiColumnList
data-testid="results-viewer-table"
contentData={lastNotEmptyContent}
contentData={pollingMode ? lastNotEmptyContent : contentData}
columnMapping={columnMapping}
formatter={formatter}
columnWidths={columnWidths}
Expand Down Expand Up @@ -205,6 +206,7 @@ ResultViewer.propTypes = {
onSetDefaultColumns: PropTypes.func,
defaultLimit: PropTypes.number,
defaultOffset: PropTypes.number,
pollingMode: PropTypes.bool,
height: PropTypes.number,
showPagination: PropTypes.bool,
refreshTrigger: PropTypes.oneOfType([PropTypes.number, PropTypes.bool]),
Expand Down

0 comments on commit 5f787f5

Please sign in to comment.