Skip to content

Commit

Permalink
[Canvas] Fix map embeddables not showing up on PDF reports (elastic#6…
Browse files Browse the repository at this point in the history
…1149) (elastic#61345)

* Allow embeddables to track their own render complete for report generation in canvas

* Updating following consult with reporting team

Co-authored-by: Elastic Machine <[email protected]>

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
poffdeluxe and elasticmachine authored Mar 25, 2020
1 parent f91fb98 commit eb46653
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export class ExportApp extends React.PureComponent {
const { workpad, selectedPageId } = this.props;
const { pages, height, width } = workpad;
const activePage = pages.find(page => page.id === selectedPageId);
const pageElementCount = activePage.elements.length;

return (
<div className="canvasExport">
Expand All @@ -39,7 +40,7 @@ export class ExportApp extends React.PureComponent {
</div>
{Style.it(
workpad.css,
<div className="canvasExport__stageContent">
<div className="canvasExport__stageContent" data-shared-items-count={pageElementCount}>
<WorkpadPage
isSelected
key={activePage.id}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,15 @@ export class ElementShareContainer extends React.PureComponent {
};

render() {
const shouldTrackComplete = this.props.functionName !== 'embeddable';

// NOTE: the data-shared-item and data-render-complete attributes are used for reporting
// Embeddables should be setting data-shared-item and data-render-complete on themselves
// so we should not be tracking them here.
return (
<div
data-shared-item
data-render-complete={this.state.renderComplete}
data-shared-item={shouldTrackComplete ? this.state.renderComplete : undefined}
data-render-complete={shouldTrackComplete ? this.state.renderComplete : undefined}
className={this.props.className}
ref={ref => (this.sharedItemRef = ref)}
>
Expand Down

0 comments on commit eb46653

Please sign in to comment.