Skip to content
This repository has been archived by the owner on Aug 9, 2022. It is now read-only.

Commit

Permalink
Remove reporting plugin page from kibana nav (#302)
Browse files Browse the repository at this point in the history
* Remove from kibana nav

* Remove more unnecessary items

* Fix toast height

* Fix disabled context menu height
  • Loading branch information
joshuali925 authored Jan 15, 2021
1 parent f7e8832 commit 758f432
Show file tree
Hide file tree
Showing 11 changed files with 10,402 additions and 22,661 deletions.
49 changes: 4 additions & 45 deletions kibana-reports/public/components/context_menu/context_menu_ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const popoverMenu = (savedObjectAvailable) => {
? 'euiContextMenuItem'
: 'euiContextMenuItem euiContextMenuItem-isDisabled';
const button = savedObjectAvailable ? 'button' : 'button disabled';
const popoverHeight = savedObjectAvailable ? '395px' : '380px';
const popoverHeight = savedObjectAvailable ? '213px' : '198px';
const message = savedObjectAvailable
? `Files can take a minute or two to generate depending on the size of your source data.`
: `Save this Visualization/Dashboard to enable PDF/PNG reports.`;
Expand All @@ -45,7 +45,7 @@ export const popoverMenu = (savedObjectAvailable) => {
<div class="euiPopover__panelArrow euiPopover__panelArrow--bottom" style="left: 15.9417px; top: 0px;">
</div>
<div>
<div class="euiContextMenu" data-test-subj="shareContextMenu" style="height: 305px; width: 235px;">
<div class="euiContextMenu" data-test-subj="shareContextMenu" style="height: ${popoverHeight}; width: 235px;">
<div class="euiContextMenuPanel euiContextMenu__panel" tabindex="0">
<div class="euiPopoverTitle">
<span class="euiContextMenu__itemLayout">
Expand Down Expand Up @@ -96,24 +96,6 @@ export const popoverMenu = (savedObjectAvailable) => {
</span>
</button>
</div>
<div class="euiPopoverTitle">
<span class="euiContextMenu__itemLayout">
View
</span>
</div>
<div>
<button class="euiContextMenuItem" type="button" data-test-subj="downloadPanel-GeneratePDF" id="viewReports">
<span class="euiContextMenu__itemLayout">
<svg id="reports-icon" width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" class="euiIcon euiIcon--medium euiIcon-isLoaded euiContextMenu__icon">
<g transform="translate(1.000000, 0.000000)" fill="currentColor">
<path d="M9.8,0 L1,0 C0.448,0 0,0.448 0,1 L0,15 C0,15.552 0.448,16 1,16 L13,16 C13.552,16 14,15.552 14,15 L14,4.429 C14,4.173 13.902,3.926 13.726,3.74 L10.526,0.312 C10.337,0.113 10.074,0 9.8,0 M9,1 L9,4.5 C9,4.776 9.224,5 9.5,5 L9.5,5 L13,5 L13,15 L1,15 L1,1 L9,1 Z M11.5,13 L2.5,13 L2.5,14 L11.5,14 L11.5,13 Z M10.8553858,6.66036578 L7.924,9.827 L5.42565136,8.13939866 L2.63423628,11.1343544 L3.36576372,11.8161664 L5.574,9.446 L8.07559521,11.1358573 L11.5892757,7.33963422 L10.8553858,6.66036578 Z M7.5,4 L2.5,4 L2.5,5 L7.5,5 L7.5,4 Z M7.5,2 L2.5,2 L2.5,3 L7.5,3 L7.5,2 Z"></path>
</g>
</svg>
<span class="euiContextMenuItem__text">View reports</span>
</svg>
</span>
</button>
</div>
</div>
</div>
</div>
Expand All @@ -129,7 +111,7 @@ export const popoverMenuDiscover = (savedObjectAvailable) => {
? 'euiContextMenuItem'
: 'euiContextMenuItem euiContextMenuItem-isDisabled';
const button = savedObjectAvailable ? 'button' : 'button disabled';
const popoverHeight = savedObjectAvailable ? '265px' : '235px';
const popoverHeight = savedObjectAvailable ? '171px' : '141px';
const message = savedObjectAvailable
? `Files can take a minute or two to generate depending on the size of your source data.`
: `Save this search to enable CSV reports.`;
Expand Down Expand Up @@ -180,24 +162,6 @@ export const popoverMenuDiscover = (savedObjectAvailable) => {
</span>
</button>
</div>
<div class="euiPopoverTitle">
<span class="euiContextMenu__itemLayout">
View
</span>
</div>
<div>
<button class="euiContextMenuItem" type="button" data-test-subj="downloadPanel-GeneratePDF" id="viewReports">
<span class="euiContextMenu__itemLayout">
<svg id="reports-icon" width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" class="euiIcon euiIcon--medium euiIcon-isLoaded euiContextMenu__icon">
<g transform="translate(1.000000, 0.000000)" fill="currentColor">
<path d="M9.8,0 L1,0 C0.448,0 0,0.448 0,1 L0,15 C0,15.552 0.448,16 1,16 L13,16 C13.552,16 14,15.552 14,15 L14,4.429 C14,4.173 13.902,3.926 13.726,3.74 L10.526,0.312 C10.337,0.113 10.074,0 9.8,0 M9,1 L9,4.5 C9,4.776 9.224,5 9.5,5 L9.5,5 L13,5 L13,15 L1,15 L1,1 L9,1 Z M11.5,13 L2.5,13 L2.5,14 L11.5,14 L11.5,13 Z M10.8553858,6.66036578 L7.924,9.827 L5.42565136,8.13939866 L2.63423628,11.1343544 L3.36576372,11.8161664 L5.574,9.446 L8.07559521,11.1358573 L11.5892757,7.33963422 L10.8553858,6.66036578 Z M7.5,4 L2.5,4 L2.5,5 L7.5,5 L7.5,4 Z M7.5,2 L2.5,2 L2.5,3 L7.5,3 L7.5,2 Z"></path>
</g>
</svg>
<span class="euiContextMenuItem__text">View Reports</span>
</svg>
</span>
</button>
</div>
</div>
</div>
</div>
Expand Down Expand Up @@ -233,7 +197,7 @@ export const reportGenerationSuccess = () => {
return `
<div class="euiToast euiToast--success" id="reportSuccessToast">
<p class="euiScreenReaderOnly">A new notification appears</p>
<div class="euiToastHeader euiToastHeader--withBody"
<div class="euiToastHeader"
aria-label="Notification" data-test-subj="euiToastHeader">
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"
class="euiIcon euiIcon--medium euiToastHeader__icon" focusable="false"
Expand All @@ -249,11 +213,6 @@ export const reportGenerationSuccess = () => {
<path d="M7.293 8L3.146 3.854a.5.5 0 11.708-.708L8 7.293l4.146-4.147a.5.5 0 01.708.708L8.707 8l4.147 4.146a.5.5 0 01-.708.708L8 8.707l-4.146 4.147a.5.5 0 01-.708-.708L7.293 8z"></path>
</svg>
</button>
<div class="euiText euiText--small euiToastBody">
<p>View
<a class="euiLink euiLink--primary"
href="opendistro_kibana_reports#/" rel="noreferrer">Reports</a>.</p>
</div>
</div>
`;
};
Expand Down
44 changes: 22 additions & 22 deletions kibana-reports/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,28 @@ export class OpendistroKibanaReportsPlugin
> {
public setup(core: CoreSetup): OpendistroKibanaReportsPluginSetup {
// Register an application into the side navigation menu
core.application.register({
id: PLUGIN_NAME,
title: 'Reporting',
category: {
id: 'odfe',
label: 'Open Distro for Elasticsearch',
order: 2000,
},
order: 2000,
async mount(params: AppMountParameters) {
// Load application bundle
const { renderApp } = await import('./application');
// Get start services as specified in kibana.json
const [coreStart, depsStart] = await core.getStartServices();
// Render the application
return renderApp(
coreStart,
depsStart as AppPluginStartDependencies,
params
);
},
});
// core.application.register({
// id: PLUGIN_NAME,
// title: 'Reporting',
// category: {
// id: 'odfe',
// label: 'Open Distro for Elasticsearch',
// order: 2000,
// },
// order: 2000,
// async mount(params: AppMountParameters) {
// // Load application bundle
// const { renderApp } = await import('./application');
// // Get start services as specified in kibana.json
// const [coreStart, depsStart] = await core.getStartServices();
// // Render the application
// return renderApp(
// coreStart,
// depsStart as AppPluginStartDependencies,
// params
// );
// },
// });

// Return methods that should be available to other plugins
return {};
Expand Down
6 changes: 3 additions & 3 deletions kibana-reports/server/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { IRouter } from '../../../../src/core/server';

export default function (router: IRouter) {
registerReportRoute(router);
registerReportDefinitionRoute(router);
registerReportSourceRoute(router);
registerMetricRoute(router);
// registerReportDefinitionRoute(router);
// registerReportSourceRoute(router);
// registerMetricRoute(router);
}
Loading

0 comments on commit 758f432

Please sign in to comment.