-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[D4C] updated cloud_defend to use new fleet extension (#157342)
## Summary Fixes an onboarding issue related to using the old "create" and "edit" fleet extensions. Agent flyout would not automatically open after adding the integration. Using the 'package-policy-replace-define-step' hook fixes the problem. New hook does not implement integration **name** and **description** fields, so those were added in as well.  ### Checklist Delete any items that are not applicable to this PR. - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
- Loading branch information
1 parent
a520001
commit f884e24
Showing
8 changed files
with
150 additions
and
73 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
...efend/public/components/fleet_extensions/package_policy_replace_define_step_extension.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,24 @@ | ||
/* | ||
* 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, { memo } from 'react'; | ||
import type { PackagePolicyReplaceDefineStepExtensionComponentProps } from '@kbn/fleet-plugin/public/types'; | ||
import { PolicySettings } from '../policy_settings'; | ||
|
||
export const CloudDefendFleetPolicyReplaceDefineStepExtension = | ||
memo<PackagePolicyReplaceDefineStepExtensionComponentProps>( | ||
({ newPolicy, onChange }: PackagePolicyReplaceDefineStepExtensionComponentProps) => { | ||
const policy = JSON.parse(JSON.stringify(newPolicy)); | ||
|
||
return <PolicySettings policy={policy} onChange={onChange} />; | ||
} | ||
); | ||
|
||
CloudDefendFleetPolicyReplaceDefineStepExtension.displayName = | ||
'CloudDefendFleetPolicyReplaceDefineStepExtension'; | ||
|
||
// eslint-disable-next-line import/no-default-export | ||
export { CloudDefendFleetPolicyReplaceDefineStepExtension as default }; |
20 changes: 0 additions & 20 deletions
20
x-pack/plugins/cloud_defend/public/components/fleet_extensions/policy_extension_create.tsx
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
x-pack/plugins/cloud_defend/public/components/fleet_extensions/policy_extension_edit.tsx
This file was deleted.
Oops, something went wrong.
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
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