mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
Hide manual rule run behind feature flag for bulk actions (#188506)
## Hide manual rule run behind feature flag for bulk actions Currently it exposes on serverless, but user can't run it still. We are waiting for docs, to remove FF Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
05534b0899
commit
5a09ec9a30
1 changed files with 15 additions and 8 deletions
|
@ -16,6 +16,7 @@ import { MAX_MANUAL_RULE_RUN_BULK_SIZE } from '../../../../../../common/constant
|
|||
import type { TimeRange } from '../../../../rule_gaps/types';
|
||||
import { useKibana } from '../../../../../common/lib/kibana';
|
||||
import { convertRulesFilterToKQL } from '../../../../../../common/detection_engine/rule_management/rule_filtering';
|
||||
import { useIsExperimentalFeatureEnabled } from '../../../../../common/hooks/use_experimental_features';
|
||||
import { DuplicateOptions } from '../../../../../../common/detection_engine/rule_management/constants';
|
||||
import type {
|
||||
BulkActionEditPayload,
|
||||
|
@ -88,6 +89,7 @@ export const useBulkActions = ({
|
|||
actions: { clearRulesSelection, setIsPreflightInProgress },
|
||||
} = rulesTableContext;
|
||||
|
||||
const isManualRuleRunEnabled = useIsExperimentalFeatureEnabled('manualRuleRunEnabled');
|
||||
const getBulkItemsPopoverContent = useCallback(
|
||||
(closePopover: () => void): EuiContextMenuPanelDescriptor[] => {
|
||||
const selectedRules = rules.filter(({ id }) => selectedRuleIds.includes(id));
|
||||
|
@ -446,14 +448,18 @@ export const useBulkActions = ({
|
|||
onClick: handleExportAction,
|
||||
icon: undefined,
|
||||
},
|
||||
{
|
||||
key: i18n.BULK_ACTION_MANUAL_RULE_RUN,
|
||||
name: i18n.BULK_ACTION_MANUAL_RULE_RUN,
|
||||
'data-test-subj': 'scheduleRuleRunBulk',
|
||||
disabled: containsLoading || (!containsEnabled && !isAllSelected),
|
||||
onClick: handleScheduleRuleRunAction,
|
||||
icon: undefined,
|
||||
},
|
||||
...(isManualRuleRunEnabled
|
||||
? [
|
||||
{
|
||||
key: i18n.BULK_ACTION_MANUAL_RULE_RUN,
|
||||
name: i18n.BULK_ACTION_MANUAL_RULE_RUN,
|
||||
'data-test-subj': 'scheduleRuleRunBulk',
|
||||
disabled: containsLoading || (!containsEnabled && !isAllSelected),
|
||||
onClick: handleScheduleRuleRunAction,
|
||||
icon: undefined,
|
||||
},
|
||||
]
|
||||
: []),
|
||||
{
|
||||
key: i18n.BULK_ACTION_DISABLE,
|
||||
name: i18n.BULK_ACTION_DISABLE,
|
||||
|
@ -594,6 +600,7 @@ export const useBulkActions = ({
|
|||
filterOptions,
|
||||
completeBulkEditForm,
|
||||
startServices,
|
||||
isManualRuleRunEnabled,
|
||||
]
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue