Skip to content

Commit

Permalink
[UIPQB-134] Fix prop-type for ViewerHeadline (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
ncovercash authored Sep 18, 2024
1 parent 0b41976 commit 41757ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/QueryBuilder/QueryBuilder/TestQuery/TestQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export const TestQuery = ({
/>
);

const renderHeadline = ({ totalRecords: total = 0, currentRecordsCount = 0, defaultLimit, status }) => {
const renderHeadline = ({ totalRecords: total = '0', currentRecordsCount = '0', defaultLimit, status }) => {
const isInProgress = status === QUERY_DETAILS_STATUSES.IN_PROGRESS && !recordsLimitExceeded;
const limit = currentRecordsCount < defaultLimit ? currentRecordsCount : defaultLimit;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,20 @@ import css from '../../../QueryBuilder.css';
export const ViewerHeadline = memo(({ limit, total, isInProgress }) => {
return (
<>
{Number(total) === 0 ?
{Number(total) === 0 ? (
<FormattedMessage
id="ui-plugin-query-builder.modal.preview.title.empty"
values={{ total }}
/>
:
) : (
<FormattedMessage
id="ui-plugin-query-builder.modal.preview.title"
values={{
total,
limit,
}}
/>
}
{' '}
)}{' '}
{isInProgress && (
<span className={css.AccordionHeaderLoading}>
<FormattedMessage id="ui-plugin-query-builder.modal.preview.countingInProgress" />
Expand All @@ -33,7 +32,7 @@ export const ViewerHeadline = memo(({ limit, total, isInProgress }) => {
});

ViewerHeadline.propTypes = {
limit: PropTypes.number,
limit: PropTypes.string,
total: PropTypes.number,
isInProgress: PropTypes.bool,
};

0 comments on commit 41757ae

Please sign in to comment.