Skip to content
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

fix(ui): updated default positioning for adding aggregate funcs when toggling from query builder #17028

Merged
merged 5 commits into from
Mar 3, 2020

Conversation

asalem1
Copy link
Contributor

@asalem1 asalem1 commented Feb 27, 2020

Closes #16668

Problem

Currently toggling from the query builder to the script editor will default aggregate functions that are selected to the initial part of the query.

Solution

Create a conditional check to update the range that we are adding to to be the end of the existing query. Also added logic to add a new line whenever an aggregate function is selected.

  • CHANGELOG.md updated with a link to the PR (not the Issue)

@asalem1 asalem1 requested a review from ebb-tide February 27, 2020 17:21
@@ -20,7 +20,7 @@ export const formatFunctionForInsert = (
return `\n${fluxFunction}`
}

return ` |> ${fluxFunction}`
return `\n |> ${fluxFunction}`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ensures that all selected aggregate functions are inserted onto a new line

@asalem1 asalem1 force-pushed the regression/script-default-position branch from 38e8289 to 4b2f192 Compare March 3, 2020 16:49
@asalem1 asalem1 requested review from 121watts and removed request for ebb-tide March 3, 2020 16:49
Copy link
Contributor

@121watts 121watts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a unit test for the insertFunction util.

@asalem1 asalem1 force-pushed the regression/script-default-position branch from 4b2f192 to a365b5b Compare March 3, 2020 17:28
@asalem1 asalem1 requested a review from 121watts March 3, 2020 17:34
@asalem1 asalem1 merged commit 2e348eb into master Mar 3, 2020
@asalem1 asalem1 deleted the regression/script-default-position branch March 3, 2020 18:09
jacobmarble pushed a commit that referenced this pull request Mar 12, 2020
…toggling from query builder (#17028)

fix(ui): updated default positioning for adding aggregate funcs when toggling from query builder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Data Explorer: Script Editor should default position to END of script
2 participants