-
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.
[RAC][UPTIME] -126229 - Add view in app url as an action variable in …
…the alert message for uptime app (#127478) * Expose getMonitorRouteFromMonitorId in the common folder * Remove unused import * WIP * Fix some issues * Add 5 min before when the alert is raised * Update status * Cover the autogenerated use case * Update tests * Updated tests * Use indexedStartedAt and full URL * Take into consideration the kibanaBase path * Fix URL * LINT * Fix tests * Use IBasePath for clarity and update related tests * Optim - use getViewInAppUrl * Add duration anomaly and fix tests * Fix tests * Rename server var * Remove join
- Loading branch information
Showing
14 changed files
with
145 additions
and
55 deletions.
There are no files selected for viewing
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,40 @@ | ||
/* | ||
* 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 { stringify } from 'querystring'; | ||
|
||
export const format = ({ | ||
pathname, | ||
query, | ||
}: { | ||
pathname: string; | ||
query: Record<string, any>; | ||
}): string => { | ||
return `${pathname}?${stringify(query)}`; | ||
}; | ||
|
||
export const getMonitorRouteFromMonitorId = ({ | ||
monitorId, | ||
dateRangeStart, | ||
dateRangeEnd, | ||
filters = {}, | ||
}: { | ||
monitorId: string; | ||
dateRangeStart: string; | ||
dateRangeEnd: string; | ||
filters?: Record<string, string[]>; | ||
}) => | ||
format({ | ||
pathname: `/app/uptime/monitor/${btoa(monitorId)}`, | ||
query: { | ||
dateRangeEnd, | ||
dateRangeStart, | ||
...(Object.keys(filters).length | ||
? { filters: JSON.stringify(Object.keys(filters).map((key) => [key, filters[key]])) } | ||
: {}), | ||
}, | ||
}); |
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
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
Oops, something went wrong.