-
Notifications
You must be signed in to change notification settings - Fork 14.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(sqllab): Dynamic query limit dropdown #25855
Conversation
Tagging @justinpark since I see you were the author of this file. |
d4c42f5
to
52fdf03
Compare
const dropdown = baseElement.getElementsByClassName( | ||
'ant-dropdown-trigger', | ||
)[0]; | ||
|
||
userEvent.click(dropdown); | ||
await waitFor(() => expect(getByRole('menu')).toBeInTheDocument()); | ||
|
||
const expectedLabels = [10, 100, 1000, 10000, 50000].map(i => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@giftig would you also mind adding a couple of tests: i) when maxRow
is a factor of 10, and ii) when the maxRow
is less than 10?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
52fdf03
to
8e7cfd1
Compare
Previously, this was a constant of powers of ten from 10 to 100000 and then we tacked on maxRow on the end, being the SQL_MAX_ROW config. This unfortunately results is very confusing behaviour if SQL_MAX_ROW is less than 100,000 as it still let you select 100,000, though wouldn't acctually use that LIMIT, and the messaging would not acknowledge the setting for SQL_MAX_ROW either. Instead, construct the list by ascending through powers of ten until we reach the configured SQL_MAX_ROW.
8e7cfd1
to
9f92fff
Compare
SUMMARY
Previously, this was a constant of powers of ten from 10 to 100000 and then we tacked on maxRow on the end, being the SQL_MAX_ROW config. This unfortunately results is very confusing behaviour if SQL_MAX_ROW is less than 100,000 as it still let you select 100,000, though wouldn't acctually use that LIMIT, and the messaging would not acknowledge the setting for SQL_MAX_ROW either.
Instead, construct the list by ascending through powers of ten until we reach the configured SQL_MAX_ROW.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before
After
TESTING INSTRUCTIONS
SQL_MAX_ROW
to a value less than 100,000 or greater than 1,000,000SQL_MAX_ROW
, and will display every power of 10 up toSQL_MAX_ROW
ADDITIONAL INFORMATION