Skip to content

Commit

Permalink
fix menu cut off (#315)
Browse files Browse the repository at this point in the history
Signed-off-by: Danila Gulderov <[email protected]>
Signed-off-by: Eric <[email protected]>
Signed-off-by: Eric Wei <[email protected]>
Co-authored-by: Eric <[email protected]>
  • Loading branch information
gulderov and mengweieric authored Mar 11, 2024
1 parent a811806 commit e2fe9a0
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions public/components/context_menu/context_menu_ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export const popoverMenu = (savedObjectAvailable) => {
? 'euiContextMenuItem'
: 'euiContextMenuItem euiContextMenuItem-isDisabled';
const button = savedObjectAvailable ? 'button' : 'button disabled';
const popoverHeight = getPopoverHeight(false, savedObjectAvailable);
const message = savedObjectAvailable
? i18n.translate('opensearch.reports.menu.visual.waitPrompt', {
defaultMessage:
Expand All @@ -30,7 +29,7 @@ export const popoverMenu = (savedObjectAvailable) => {
});

const arrowRight = '100px';
const popoverRight = '77px';
const popoverRight = '170px';

return `
<div>
Expand All @@ -43,8 +42,8 @@ export const popoverMenu = (savedObjectAvailable) => {
<div class="euiPopover__panelArrow euiPopover__panelArrow--bottom" style="right: ${arrowRight}; top: 0px;">
</div>
<div>
<div class="euiContextMenu" data-test-subj="shareContextMenu" style="height: ${popoverHeight}; width: 235px;">
<div class="euiContextMenuPanel euiContextMenu__panel" tabindex="0">
<div class="euiContextMenu" data-test-subj="shareContextMenu" style="width: 235px;">
<div class="euiContextMenuPanel" tabindex="0">
<div class="euiPopoverTitle">
<span data-html2canvas-ignore class="euiContextMenu__itemLayout">
${i18n.translate(
Expand Down Expand Up @@ -138,7 +137,6 @@ export const popoverMenuDiscover = (savedObjectAvailable) => {
? 'euiContextMenuItem'
: 'euiContextMenuItem euiContextMenuItem-isDisabled';
const button = savedObjectAvailable ? 'button' : 'button disabled';
const popoverHeight = getPopoverHeight(true, savedObjectAvailable);
const message = savedObjectAvailable
? i18n.translate('opensearch.reports.menu.csv.waitPrompt', {
defaultMessage:
Expand All @@ -148,7 +146,7 @@ export const popoverMenuDiscover = (savedObjectAvailable) => {
defaultMessage: 'Save this search to enable CSV/XLSX reports.',
});
const arrowRight = '60px';
const popoverRight = '77px';
const popoverRight = '170px';

return `
<div>
Expand All @@ -161,8 +159,8 @@ export const popoverMenuDiscover = (savedObjectAvailable) => {
<div class="euiPopover__panelArrow euiPopover__panelArrow--bottom" style="right: ${arrowRight}; top: 0px;">
</div>
<div>
<div class="euiContextMenu" data-test-subj="shareContextMenu" style="height: ${popoverHeight}; width: 235px;">
<div class="euiContextMenuPanel euiContextMenu__panel" tabindex="0">
<div class="euiContextMenu" data-test-subj="shareContextMenu" style="width: 235px;">
<div class="euiContextMenuPanel" tabindex="0">
<div class="euiPopoverTitle">
<span data-html2canvas-ignore class="euiContextMenu__itemLayout">
${i18n.translate(
Expand Down Expand Up @@ -192,7 +190,10 @@ export const popoverMenuDiscover = (savedObjectAvailable) => {
<${button} class="${buttonClass}" type="button" data-test-subj="downloadPanel-GeneratePDF" id="generateXLSX">
<span data-html2canvas-ignore class="euiContextMenu__itemLayout">
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" class="euiIcon euiIcon--medium euiIcon-isLoaded euiContextMenu__icon" focusable="false" role="img" aria-hidden="true"><path d="M9 9.114l1.85-1.943a.52.52 0 01.77 0c.214.228.214.6 0 .829l-1.95 2.05a1.552 1.552 0 01-2.31 0L5.41 8a.617.617 0 010-.829.52.52 0 01.77 0L8 9.082V.556C8 .249 8.224 0 8.5 0s.5.249.5.556v8.558z"></path><path d="M16 13.006V10h-1v3.006a.995.995 0 01-.994.994H3.01a.995.995 0 01-.994-.994V10h-1v3.006c0 1.1.892 1.994 1.994 1.994h10.996c1.1 0 1.994-.893 1.994-1.994z"></path></svg>
<span data-html2canvas-ignore class="euiContextMenuItem__text">${i18n.translate('opensearch.reports.menu.csv.generateXLSX', { defaultMessage: 'Generate XLSX' })}</span>
<span data-html2canvas-ignore class="euiContextMenuItem__text">${i18n.translate(
'opensearch.reports.menu.csv.generateXLSX',
{ defaultMessage: 'Generate XLSX' }
)}</span>
</span>
</button>
</div>
Expand Down

0 comments on commit e2fe9a0

Please sign in to comment.