-
Notifications
You must be signed in to change notification settings - Fork 8.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
[Reporting] Relax save requirement for CSV reports #99313
[Reporting] Relax save requirement for CSV reports #99313
Conversation
@@ -85,7 +90,7 @@ class ReportingPanelContentUi extends Component<Props, State> { | |||
} | |||
|
|||
public render() { | |||
if (this.isNotSaved() || this.props.isDirty || this.state.isStale) { | |||
if (this.mustSaveReport()) { |
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.
I think we can simply add a prop to the ReportingPanelContent
component called requiresSavedState
or something. In x-pack/plugins/reporting/public/share_context_menu/register_csv_reporting.tsx#L109
, the prop is hardcoded to false
and in x-pack/plugins/reporting/public/components/screen_capture_panel_content.tsx#L45
it is hardcoded to true
.
if (this.mustSaveReport()) { | |
if (this.props.requiresSavedState() && this.isNotSaved() || this.props.isDirty || this.state.isStale) { |
I recalled an issue that was closed as a duplicate of #18439
The columns in the export should match the state set by the user in the dashboard panel Here's the original issue: #43977 |
@elasticmachine merge upstream |
@tsullivan Thanks for providing context and extra things to consider!
This sounds like something that we should look into addressing in another PR if there is a specific issue. I tested with discover and it looks like field order is preserved
Great point! I came up with the following My reasoning behind the current implementation is that reporting should not have to guess what the title should be based on object type, rather users of reporting should take the responsibility of ensuring that an appropriate title is provided. In this way titles can contain a bit more context. Let me know if you think reporting should also have a fallback for titles, though. |
Pinging @elastic/kibana-app-services (Team:AppServices) |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
savedSearch.title || | ||
i18n.translate('discover.localMenu.fallbackReportTitle', { | ||
defaultMessage: 'Discover search [{date}]', | ||
values: { date: moment().toISOString() }, |
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.
Without true it would return UTC time, but I think it would be more useful to provide an ISO string with offset to UTC
values: { date: moment().toISOString() }, | |
values: { date: moment().toISOString(true) }, |
BTW great improvement! love it that you no longer have to save a search to export!
@elasticmachine merge upstream |
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.
LGTM
💚 Build SucceededMetrics [docs]Async chunks
Page load bundle
Unknown metric groupsReferences to deprecated APIs
History
To update your PR or re-run it, just comment with: |
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.
Kibana app owned code LGTM, thx for this little big change! Tested locally, timestamp in the CSV title now is also helpful for non-UTC people 🕐
* update requirement to save csv report in ui * update expectation that CSV reporting is disabled for new discover searches * update test expectations (again) * refactor to using props-driven approach * provide a fallback title * refine title a bit more * added component level test * return ISO string with offset Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* update requirement to save csv report in ui * update expectation that CSV reporting is disabled for new discover searches * update test expectations (again) * refactor to using props-driven approach * provide a fallback title * refine title a bit more * added component level test * return ISO string with offset Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Summary
Part one of addressing this issue: #18439
Release note
We relaxed the requirement to first create a saved search when generating a CSV report via the share menu in Discover.
Checklist
Delete any items that are not applicable to this PR.