forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Synthetics] Monitor list add bulk delete (elastic#190674)
## Summary Monitor list add bulk delete !! <img width="1727" alt="image" src="https://github.com/user-attachments/assets/4a9fddd2-9ce4-43ee-9024-c3dfc3511657">
- Loading branch information
Showing
12 changed files
with
164 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
...pps/synthetics/components/monitors_page/management/monitor_list_table/bulk_operations.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { i18n } from '@kbn/i18n'; | ||
import { EuiButtonEmpty } from '@elastic/eui'; | ||
import { | ||
ConfigKey, | ||
EncryptedSyntheticsSavedMonitor, | ||
} from '../../../../../../../common/runtime_types'; | ||
|
||
export const BulkOperations = ({ | ||
selectedItems, | ||
setMonitorPendingDeletion, | ||
}: { | ||
selectedItems: EncryptedSyntheticsSavedMonitor[]; | ||
setMonitorPendingDeletion: (val: string[]) => void; | ||
}) => { | ||
const onDeleted = () => { | ||
setMonitorPendingDeletion(selectedItems.map((item) => item[ConfigKey.CONFIG_ID])); | ||
}; | ||
|
||
if (selectedItems.length === 0) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<EuiButtonEmpty | ||
data-test-subj="syntheticsBulkOperationPopoverClickMeToLoadAContextMenuButton" | ||
iconType="trash" | ||
iconSide="left" | ||
onClick={onDeleted} | ||
color="danger" | ||
> | ||
{i18n.translate('xpack.synthetics.bulkOperationPopover.clickMeToLoadButtonLabel', { | ||
defaultMessage: | ||
'Delete {monitorCount, number} selected {monitorCount, plural, one {monitor} other {monitors}}', | ||
values: { monitorCount: selectedItems.length }, | ||
})} | ||
</EuiButtonEmpty> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...synthetics/components/monitors_page/management/monitor_list_table/monitor_list_header.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; | ||
|
||
import React from 'react'; | ||
import { BulkOperations } from './bulk_operations'; | ||
import { EncryptedSyntheticsSavedMonitor } from '../../../../../../../common/runtime_types'; | ||
|
||
export const MonitorListHeader = ({ | ||
selectedItems, | ||
recordRangeLabel, | ||
setMonitorPendingDeletion, | ||
}: { | ||
recordRangeLabel: JSX.Element; | ||
selectedItems: EncryptedSyntheticsSavedMonitor[]; | ||
setMonitorPendingDeletion: (val: string[]) => void; | ||
}) => { | ||
return ( | ||
<EuiFlexGroup alignItems="center"> | ||
<EuiFlexItem grow={false}> | ||
<span>{recordRangeLabel}</span> | ||
</EuiFlexItem> | ||
<EuiFlexItem grow={false}> | ||
<BulkOperations | ||
selectedItems={selectedItems} | ||
setMonitorPendingDeletion={setMonitorPendingDeletion} | ||
/> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters