[Reporting] Allow POST URL in Canvas to be copied (#117954)
This commit is contained in:
parent
92ffb9e09a
commit
24477e9af9
|
@ -49,6 +49,7 @@ export const ShareMenu = () => {
|
|||
getJobParams={() => getPdfJobParams(sharingData, platformService.getKibanaVersion())}
|
||||
layoutOption="canvas"
|
||||
onClose={onClose}
|
||||
objectId={workpad.id}
|
||||
/>
|
||||
)
|
||||
: null;
|
||||
|
|
|
@ -63,6 +63,43 @@ test('ScreenCapturePanelContent properly renders a view with "canvas" layout opt
|
|||
expect(component.text()).toMatch('Full page layout');
|
||||
});
|
||||
|
||||
test('ScreenCapturePanelContent allows POST URL to be copied when objectId is provided', () => {
|
||||
const component = mount(
|
||||
<IntlProvider locale="en">
|
||||
<ScreenCapturePanelContent
|
||||
layoutOption="canvas"
|
||||
reportType="Analytical App"
|
||||
requiresSavedState={false}
|
||||
apiClient={apiClient}
|
||||
uiSettings={uiSettings}
|
||||
toasts={coreSetup.notifications.toasts}
|
||||
getJobParams={getJobParamsDefault}
|
||||
objectId={'1234-5'}
|
||||
/>
|
||||
</IntlProvider>
|
||||
);
|
||||
expect(component.text()).toMatch('Copy POST URL');
|
||||
expect(component.text()).not.toMatch('Unsaved work');
|
||||
});
|
||||
|
||||
test('ScreenCapturePanelContent does not allow POST URL to be copied when objectId is not provided', () => {
|
||||
const component = mount(
|
||||
<IntlProvider locale="en">
|
||||
<ScreenCapturePanelContent
|
||||
layoutOption="canvas"
|
||||
reportType="Analytical App"
|
||||
requiresSavedState={false}
|
||||
apiClient={apiClient}
|
||||
uiSettings={uiSettings}
|
||||
toasts={coreSetup.notifications.toasts}
|
||||
getJobParams={getJobParamsDefault}
|
||||
/>
|
||||
</IntlProvider>
|
||||
);
|
||||
expect(component.text()).not.toMatch('Copy POST URL');
|
||||
expect(component.text()).toMatch('Unsaved work');
|
||||
});
|
||||
|
||||
test('ScreenCapturePanelContent properly renders a view with "print" layout option', () => {
|
||||
const component = mount(
|
||||
<IntlProvider locale="en">
|
||||
|
|
|
@ -16,7 +16,8 @@ interface IncludeOnCloseFn {
|
|||
onClose: () => void;
|
||||
}
|
||||
|
||||
type Props = Pick<PanelPropsScreenCapture, 'getJobParams' | 'layoutOption'> & IncludeOnCloseFn;
|
||||
type Props = Pick<PanelPropsScreenCapture, 'getJobParams' | 'layoutOption' | 'objectId'> &
|
||||
IncludeOnCloseFn;
|
||||
|
||||
/*
|
||||
* As of 7.14, the only shared component is a PDF report that is suited for Canvas integration.
|
||||
|
|
Loading…
Reference in a new issue