Skip to content

Commit

Permalink
Allows ability to duplicate pre-packaged immutable rule
Browse files Browse the repository at this point in the history
  • Loading branch information
spong committed Jan 14, 2020
1 parent 760c8d5 commit 9ec5a7d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const RuleActionsOverflowComponent = ({
<EuiContextMenuItem
key={i18nActions.DUPLICATE_RULE}
icon="exportAction"
disabled={userHasNoPermissions}
onClick={async () => {
setIsPopoverOpen(false);
await duplicateRuleAction(rule, noop, dispatchToaster);
Expand All @@ -61,6 +62,7 @@ const RuleActionsOverflowComponent = ({
<EuiContextMenuItem
key={i18nActions.EXPORT_RULE}
icon="indexEdit"
disabled={userHasNoPermissions || rule.immutable}
onClick={async () => {
setIsPopoverOpen(false);
setRulesToExport([rule]);
Expand All @@ -71,6 +73,7 @@ const RuleActionsOverflowComponent = ({
<EuiContextMenuItem
key={i18nActions.DELETE_RULE}
icon="trash"
disabled={userHasNoPermissions || rule.immutable}
onClick={async () => {
setIsPopoverOpen(false);
await deleteRulesAction([rule.id], noop, dispatchToaster, onRuleDeletedCallback);
Expand All @@ -92,7 +95,7 @@ const RuleActionsOverflowComponent = ({
<EuiButtonIcon
iconType="boxesHorizontal"
aria-label={i18n.ALL_ACTIONS}
isDisabled={(userHasNoPermissions || rule?.immutable) ?? true}
isDisabled={userHasNoPermissions}
onClick={() => setIsPopoverOpen(!isPopoverOpen)}
/>
</EuiToolTip>
Expand Down

0 comments on commit 9ec5a7d

Please sign in to comment.