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

Transform modal: Return javascript query from modal (and populate modal with existing query) #393

Open
conorw opened this issue Jan 22, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@conorw
Copy link

conorw commented Jan 22, 2024

This control is exactly what I was looking for... with one exception:

Is it possible to expose the JavaScript query that is generated in the transform modal?
Likewise, is it possible to populate the transform modal with an existing query?

@josdejong
Copy link
Owner

Thanks, good to hear. I'm not sure what you mean: do you mean copy/paste as an end user? (You can just edit the contents of the query in the "Query" input field). Or do you mean a programmatic API?

@conorw
Copy link
Author

conorw commented Jan 22, 2024

apologies @josdejong , I should have explained better:
Ideally, I want to be able to save the javascript transformation code that is built in the transformation modal dialog.
Hopefully the following quick and dirty PR should explain better #394

@josdejong
Copy link
Owner

Ah, yes, so you want to be able to programmatically initialize the query when opening the transform modal, and, I guess, get a callback with the applied query when the user clicks "Transform" in the modal. I like to open up the API for this!

We have to think through what API we want exactly. Some first thoughts:

  • I think we'll have to implement an API for both the Transform modal and the Sort modal to be feature complete
  • Besides the query field, the Transform modal also has a wizard. I think we should be able to set all off the state, not just query.
  • We could introduce properties like query and onQuery. Or maybe we should introduce hooks like onTransformOpen and onTransformClose, allowing to get and set the query and all other state.

@josdejong josdejong added the enhancement New feature or request label Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants