[Security Solution][Data Views] - Update bulk actions data views index param to be snake_case (#138429) (#138443)

## Summary

Overlooked a param name - should be snake case per our APIs. `overwriteDataViews` --> `overwrite_data_views`

(cherry picked from commit 6da6f18b2d)

Co-authored-by: Yara Tercero <yctercero@users.noreply.github.com>
This commit is contained in:
Kibana Machine 2022-08-09 15:13:58 -04:00 committed by GitHub
parent 6a5528d23f
commit 9b27de2096
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 9 deletions

View file

@ -401,7 +401,7 @@ const bulkActionEditPayloadIndexPatterns = t.intersection([
]),
value: index,
}),
t.exact(t.partial({ overwriteDataViews: t.boolean })),
t.exact(t.partial({ overwrite_data_views: t.boolean })),
]);
export type BulkActionEditPayloadIndexPatterns = t.TypeOf<

View file

@ -118,7 +118,7 @@ const IndexPatternsFormComponent = ({
const payload = {
value: data.index,
type: data.overwrite ? BulkActionEditType.set_index_patterns : editAction,
overwriteDataViews: data.overwriteDataViews,
overwrite_data_views: data.overwriteDataViews,
};
onConfirm(payload);

View file

@ -98,28 +98,28 @@ describe('ruleParamsModifier', () => {
expect(editedRuleParams).toHaveProperty('index', ['index']);
});
test('should set dataViewId to undefined if overwriteDataViews=true on set_index_patterns action', () => {
test('should set dataViewId to undefined if overwrite_data_views=true on set_index_patterns action', () => {
const editedRuleParams = ruleParamsModifier(
{ dataViewId: 'test-data-view', index: ['test-*'] } as RuleAlertType['params'],
[
{
type: BulkActionEditType.set_index_patterns,
value: ['index'],
overwriteDataViews: true,
overwrite_data_views: true,
},
]
);
expect(editedRuleParams).toHaveProperty('dataViewId', undefined);
});
test('should set dataViewId to undefined if overwriteDataViews=true on add_index_patterns action', () => {
test('should set dataViewId to undefined if overwrite_data_views=true on add_index_patterns action', () => {
const editedRuleParams = ruleParamsModifier(
{ dataViewId: 'test-data-view', index: ['test-*'] } as RuleAlertType['params'],
[
{
type: BulkActionEditType.add_index_patterns,
value: ['index'],
overwriteDataViews: true,
overwrite_data_views: true,
},
]
);

View file

@ -35,7 +35,7 @@ const applyBulkActionEditToRuleParams = (
"Index patterns can't be added. Machine learning rule doesn't have index patterns property"
);
if (action.overwriteDataViews) {
if (action.overwrite_data_views) {
ruleParams.dataViewId = undefined;
}
@ -59,7 +59,7 @@ const applyBulkActionEditToRuleParams = (
"Index patterns can't be overwritten. Machine learning rule doesn't have index patterns property"
);
if (action.overwriteDataViews) {
if (action.overwrite_data_views) {
ruleParams.dataViewId = undefined;
}

View file

@ -580,7 +580,7 @@ export default ({ getService }: FtrProviderContext): void => {
{
type: BulkActionEditType.add_index_patterns,
value: ['initial-index-*'],
overwriteDataViews: true,
overwrite_data_views: true,
},
],
})