check limiting factor on query results (#14719)

This commit is contained in:
Elizabeth Thompson 2021-05-19 14:38:57 -07:00 committed by GitHub
parent 26c0b30ec9
commit a9d888ad40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -527,6 +527,7 @@ export default class ResultSet extends React.PureComponent<
let limitMessage; let limitMessage;
const limitReached = results?.displayLimitReached; const limitReached = results?.displayLimitReached;
const isAdmin = !!this.props.user?.roles.Admin; const isAdmin = !!this.props.user?.roles.Admin;
const limit = queryLimit || results.query.limit;
const displayMaxRowsReachedMessage = { const displayMaxRowsReachedMessage = {
withAdmin: t( withAdmin: t(
`The number of results displayed is limited to %(rows)d by the configuration DISPLAY_MAX_ROWS. `, `The number of results displayed is limited to %(rows)d by the configuration DISPLAY_MAX_ROWS. `,
@ -535,7 +536,9 @@ export default class ResultSet extends React.PureComponent<
t( t(
`Please add additional limits/filters or download to csv to see more rows up to the`, `Please add additional limits/filters or download to csv to see more rows up to the`,
), ),
t(`the %(queryLimit)d limit.`, { queryLimit }), t(`the %(limit)d limit.`, {
limit,
}),
), ),
withoutAdmin: t( withoutAdmin: t(
`The number of results displayed is limited to %(rows)d. `, `The number of results displayed is limited to %(rows)d. `,
@ -544,8 +547,8 @@ export default class ResultSet extends React.PureComponent<
t( t(
`Please add additional limits/filters, download to csv, or contact an admin`, `Please add additional limits/filters, download to csv, or contact an admin`,
), ),
t(`to see more rows up to the the %(queryLimit)d limit.`, { t(`to see more rows up to the the %(limit)d limit.`, {
queryLimit, limit,
}), }),
), ),
}; };

View File

@ -52,6 +52,7 @@ export type Query = {
data: Record<string, unknown>[]; data: Record<string, unknown>[];
expanded_columns: Column[]; expanded_columns: Column[];
selected_columns: Column[]; selected_columns: Column[];
query: { limit: number };
}; };
resultsKey: string | null; resultsKey: string | null;
schema: string; schema: string;