[Cloud Posture] fix CSP fleet extension form (#138647)

This commit is contained in:
Or Ouziel 2022-08-12 02:07:57 +03:00 committed by GitHub
parent af9e2d9569
commit 288006a12c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View file

@ -22,7 +22,7 @@ export const getCspNewPolicyMock = (type: BenchmarkId = 'cis_k8s'): NewPackagePo
enabled: type === 'cis_k8s',
streams: [
{
enabled: true,
enabled: type === 'cis_k8s',
data_stream: {
type: 'logs',
dataset: 'cloud_security_posture.findings',
@ -36,7 +36,7 @@ export const getCspNewPolicyMock = (type: BenchmarkId = 'cis_k8s'): NewPackagePo
enabled: type === 'cis_eks',
streams: [
{
enabled: false,
enabled: type === 'cis_eks',
data_stream: {
type: 'logs',
dataset: 'cloud_security_posture.findings',

View file

@ -20,6 +20,10 @@ export const getUpdatedDeploymentType = (newPolicy: NewPackagePolicy, inputType:
inputs: newPolicy.inputs.map((item) => ({
...item,
enabled: item.type === inputType,
streams: item.streams.map((stream) => ({
...stream,
enabled: item.type === inputType,
})),
})),
},
});