Skip to content

Commit

Permalink
popover padding size unified
Browse files Browse the repository at this point in the history
  • Loading branch information
semd committed Aug 19, 2021
1 parent cb0ce59 commit 9356c70
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
EuiDataGridColumn,
EuiFlexGroup,
EuiFlexItem,
EuiContextMenu,
EuiContextMenuPanel,
EuiPopover,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
Expand Down Expand Up @@ -219,26 +219,21 @@ function ObservabilityActions({
onUpdateFailure: onAlertStatusUpdated,
});

const actionsPanels = useMemo(() => {
const actionsMenuItems = useMemo(() => {
return [
{
id: 0,
content: [
timelines.getAddToExistingCaseButton({
event,
casePermissions,
appId: observabilityFeatureId,
onClose: afterCaseSelection,
}),
timelines.getAddToNewCaseButton({
event,
casePermissions,
appId: observabilityFeatureId,
onClose: afterCaseSelection,
}),
...(alertPermissions.crud ? statusActionItems : []),
],
},
timelines.getAddToExistingCaseButton({
event,
casePermissions,
appId: observabilityFeatureId,
onClose: afterCaseSelection,
}),
timelines.getAddToNewCaseButton({
event,
casePermissions,
appId: observabilityFeatureId,
onClose: afterCaseSelection,
}),
...(alertPermissions.crud ? statusActionItems : []),
];
}, [afterCaseSelection, casePermissions, timelines, event, statusActionItems, alertPermissions]);

Expand Down Expand Up @@ -279,7 +274,7 @@ function ObservabilityActions({
panelPaddingSize="none"
anchorPosition="downLeft"
>
<EuiContextMenu panels={actionsPanels} initialPanelId={0} />
<EuiContextMenuPanel size="s" items={actionsMenuItems} />
</EuiPopover>
</EuiFlexItem>
</EuiFlexGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ const AddToCaseActionComponent: React.FC<AddToCaseActionProps> = ({
<EuiContextMenuItem
aria-label={ariaLabel}
data-test-subj="attach-alert-to-case-button"
size="s"
onClick={addExistingCaseClick}
disabled={isDisabled}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ const AddToCaseActionComponent: React.FC<AddToCaseActionProps> = ({
<EuiContextMenuItem
aria-label={ariaLabel}
data-test-subj="attach-alert-to-case-button"
size="s"
onClick={addNewCaseClick}
disabled={isDisabled}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const BulkActionsComponent: React.FC<BulkActionsProps> = ({
<EuiPopover
isOpen={isActionsPopoverOpen}
anchorPosition="upCenter"
panelPaddingSize="s"
panelPaddingSize="none"
button={
<EuiButtonEmpty
aria-label="selectedShowBulkActions"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ export const useStatusBulkActionItems = ({
key="open"
data-test-subj="open-alert-status"
onClick={() => onClickUpdate(FILTER_OPEN)}
size="s"
>
{i18n.BULK_ACTION_OPEN_SELECTED}
</EuiContextMenuItem>
Expand All @@ -139,7 +138,6 @@ export const useStatusBulkActionItems = ({
key="acknowledge"
data-test-subj="acknowledged-alert-status"
onClick={() => onClickUpdate(FILTER_ACKNOWLEDGED)}
size="s"
>
{i18n.BULK_ACTION_ACKNOWLEDGED_SELECTED}
</EuiContextMenuItem>
Expand All @@ -151,7 +149,6 @@ export const useStatusBulkActionItems = ({
key="close"
data-test-subj="close-alert-status"
onClick={() => onClickUpdate(FILTER_CLOSED)}
size="s"
>
{i18n.BULK_ACTION_CLOSE_SELECTED}
</EuiContextMenuItem>
Expand Down

0 comments on commit 9356c70

Please sign in to comment.