[Security Solution][Exceptions] - Adds sort order for exception items (#76537)
## Summary **Components affected:** ExceptionsViewer **Current behavior:** - when a user edits an exception item, the order of the exception items in the viewer changes. This creates confusion and looks like updates weren't applied (even though they were, just item order changed) **New behavior:** - when a user edits an exception item, the order of the exception items in the viewer don't change. Sort order is now based on `created_at`
This commit is contained in:
parent
aac84240b2
commit
c46e77712a
|
@ -375,6 +375,8 @@ describe('Exceptions Lists API', () => {
|
|||
namespace_type: 'single,single',
|
||||
page: '1',
|
||||
per_page: '20',
|
||||
sort_field: 'created_at',
|
||||
sort_order: 'desc',
|
||||
},
|
||||
signal: abortCtrl.signal,
|
||||
});
|
||||
|
@ -406,6 +408,8 @@ describe('Exceptions Lists API', () => {
|
|||
namespace_type: 'single',
|
||||
page: '1',
|
||||
per_page: '20',
|
||||
sort_field: 'created_at',
|
||||
sort_order: 'desc',
|
||||
},
|
||||
signal: abortCtrl.signal,
|
||||
});
|
||||
|
@ -437,6 +441,8 @@ describe('Exceptions Lists API', () => {
|
|||
namespace_type: 'agnostic',
|
||||
page: '1',
|
||||
per_page: '20',
|
||||
sort_field: 'created_at',
|
||||
sort_order: 'desc',
|
||||
},
|
||||
signal: abortCtrl.signal,
|
||||
});
|
||||
|
@ -468,6 +474,8 @@ describe('Exceptions Lists API', () => {
|
|||
namespace_type: 'agnostic',
|
||||
page: '1',
|
||||
per_page: '20',
|
||||
sort_field: 'created_at',
|
||||
sort_order: 'desc',
|
||||
},
|
||||
signal: abortCtrl.signal,
|
||||
});
|
||||
|
@ -500,6 +508,8 @@ describe('Exceptions Lists API', () => {
|
|||
namespace_type: 'agnostic',
|
||||
page: '1',
|
||||
per_page: '20',
|
||||
sort_field: 'created_at',
|
||||
sort_order: 'desc',
|
||||
},
|
||||
signal: abortCtrl.signal,
|
||||
});
|
||||
|
|
|
@ -288,6 +288,8 @@ export const fetchExceptionListsItemsByListIds = async ({
|
|||
namespace_type: namespaceTypes.join(','),
|
||||
page: pagination.page ? `${pagination.page}` : '1',
|
||||
per_page: pagination.perPage ? `${pagination.perPage}` : '20',
|
||||
sort_field: 'created_at',
|
||||
sort_order: 'desc',
|
||||
...(filters.trim() !== '' ? { filter: filters } : {}),
|
||||
};
|
||||
const [validatedRequest, errorsRequest] = validate(query, findExceptionListItemSchema);
|
||||
|
|
Loading…
Reference in a new issue