[Reporting/CSV/7.17] allow query from state in parameters#149297
Merged
tsullivan merged 8 commits intoelastic:7.17from Jan 24, 2023
Merged
Conversation
5594006 to
12bec57
Compare
tsullivan
commented
Jan 23, 2023
| interface CsvFromSavedObjectBase { | ||
| objectType: 'saved search'; | ||
| state?: { | ||
| query: estypes.QueryDslQueryContainer | estypes.QueryDslQueryContainer[]; |
Member
Author
There was a problem hiding this comment.
NOTE: sort and docvalue_fields are still not supported, as they had been in the older, removed code.
tsullivan
commented
Jan 23, 2023
| ]); | ||
| }); | ||
|
|
||
| it('with saved search containing a filter', async () => { |
Member
Author
There was a problem hiding this comment.
This doesn't test anything new: it was added to make sure that filters stored on the saved search can be a singular object - not just an array.
Contributor
|
Pinging @elastic/appex-sharedux (Team:SharedUX) |
rshen91
approved these changes
Jan 23, 2023
Contributor
rshen91
left a comment
There was a problem hiding this comment.
Cool PR 👍🏻
Thank you for the tests and comments to add clarity
💚 Build Succeeded
Metrics [docs]
History
To update your PR or re-run it, just comment with: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
In 7.17.9, we're restoring a report generation API endpoint to create CSV reports based on saved searches. There has been one PR that serves as the first iteration: #148030
This resolves a missing capability from the first iteration. In the first iteration, POST bodies could allow an additional time range filter, which is merged with any saved filters or queries stored in the saved search object:
This PR is a second iteration. It allows additional "unsaved state" to be merged with the saved object at the time of report generation.
Details
In the details of #148030, it was stated:
This PR pushes a bit back against that limitation. Now, requests to generate a report can accept a
statefield in the POST body. This field contains additional "unsaved state" that gets merged with the contents of the stored saved search object.However, the entire functionality of allowing
sortanddocvalue_fieldskeys in the request, is still not restored from the functionality that was implemented in 7.3-7.8. This limitation exists to minimize the complexity of the restored endpoint.Both of the non-restored keys are related to the sorting of documents. The sorting of documents is controlled by the saved search object only. The user can change the sort of the CSV after downloading the report, in a spreadsheet application or by programmatically working on the file.
Checklist
Delete any items that are not applicable to this PR.