eschutho commented on a change in pull request #14381:
URL: https://github.com/apache/superset/pull/14381#discussion_r625931300
##########
File path: superset-frontend/src/SqlLab/components/ResultSet.tsx
##########
@@ -502,21 +503,73 @@ export default class ResultSet extends
React.PureComponent<
}
renderRowsReturned() {
- const { results, rows, queryLimit } = this.props.query;
+ const { results, rows, queryLimit, limitingFactor } = this.props.query;
const limitReached = results?.displayLimitReached;
+ let limitMessage;
+ const isAdmin = this.props.user?.roles.hasOwnProperty('Admin');
+ const defaultDropdownLimit = queryLimit === 1000;
+ const defaultDropdown =
+ limitingFactor === 'DROPDOWN' && defaultDropdownLimit;
+ const adminWarning = isAdmin
+ ? ' by the configuration DISPLAY_MAX_ROWS'
+ : null;
+ if (limitingFactor === 'QUERY' && this.props.csv) {
+ limitMessage = (
+ <span className="limitMessage">
+ {t(
+ `The number of rows displayed is limited to %s by the query`,
+ rows,
+ )}
+ </span>
+ );
+ } else if (limitingFactor === 'DROPDOWN' && !defaultDropdown) {
+ limitMessage = (
+ <span className="limitMessage">
+ {t(
+ `The number of rows displayed is limited to %s by the limit
dropdown`,
+ rows,
+ )}
+ </span>
+ );
+ } else if (limitingFactor === 'QUERY_AND_DROPDOWN') {
Review comment:
can you put these constants into an enum?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]