[Synthetics]Sort monitor list by frequency column (#133713)

This commit is contained in:
Shahzad 2022-06-16 12:02:29 +02:00 committed by GitHub
parent b05f8c1240
commit b041f04893
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 2 deletions

View file

@ -90,7 +90,7 @@ export function useInlineErrors({
},
},
collapse: { field: 'config_id' },
sort: [{ [sortFieldMap[sortField]]: sortOrder }],
sort: sortFieldMap[sortField] ? [{ [sortFieldMap[sortField]]: sortOrder }] : undefined,
},
},
[syntheticsMonitors, lastRefresh, doFetch, sortField, sortOrder],

View file

@ -118,6 +118,7 @@ export function getMonitorListColumns({
{
align: 'left' as const,
field: ConfigKey.SCHEDULE,
sortable: true,
name: i18n.translate('xpack.synthetics.management.monitorList.frequency', {
defaultMessage: 'Frequency',
}),

View file

@ -72,6 +72,13 @@ export const syntheticsMonitor: SavedObjectsType = {
tags: {
type: 'keyword',
},
schedule: {
properties: {
number: {
type: 'integer',
},
},
},
},
},
management: {

View file

@ -92,7 +92,7 @@ export const getAllSyntheticsMonitorRoute: UMRestApiRouteFactory = () => ({
type: syntheticsMonitorType,
perPage,
page,
sortField,
sortField: sortField === 'schedule.keyword' ? 'schedule.number' : sortField,
sortOrder,
searchFields: ['name', 'tags.text', 'locations.id.text', 'urls'],
search: query ? `${query}*` : undefined,