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 notebooks context menu #109

Merged
merged 1 commit into from
Jul 6, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 6 additions & 13 deletions dashboards-reports/server/routes/report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,12 @@ export default function (router: IRouter, accessInfo: AccessInfoType) {
// if not deliver to user himself , no need to send actual file data to client
const delivery = report.report_definition.delivery;
addToMetric('report', 'create', 'count', report);
if (
delivery.delivery_type === DELIVERY_TYPE.opensearchDashboardsUser &&
delivery.delivery_params.opensearch_dashboards_recipients.length === 0
) {
return response.ok({
body: {
data: reportData.dataUrl,
filename: reportData.fileName,
},
});
} else {
return response.ok();
}
return response.ok({
body: {
data: reportData.dataUrl,
filename: reportData.fileName,
},
});
} catch (error) {
// TODO: better error handling for delivery and stages in generating report, pass logger to deeper level
logger.error(`Failed to generate report: ${error}`);
Expand Down