Skip to content

Commit

Permalink
[ResponseOps][Rules] Adding rule.url variable (#145035)
Browse files Browse the repository at this point in the history
This PR adds a new actions variable for linking back the stack
management rule page. In a future PR we will require the rule type to
specify the plugin's path when registering the rule type that way we can
link back to the specific plugin that created the rule.

Issue: #145132

<details><summary>Mustache variable</summary>


![image](https://user-images.githubusercontent.com/56361221/201212197-48577715-954b-463d-9164-5d2ebfc18cb4.png)


![image](https://user-images.githubusercontent.com/56361221/201212231-23319658-0b21-469b-a272-7c59f5caa618.png)


</details>

<details><summary>Constructed URL</summary>


![image](https://user-images.githubusercontent.com/56361221/201212322-6a4eab78-88ef-4cef-aa41-e34792a8148b.png)


</details>

Co-authored-by: Xavier Mouligneau <[email protected]>
  • Loading branch information
jonathan-buttner and XavierM authored Nov 15, 2022
1 parent 5ee2172 commit 2180a8a
Show file tree
Hide file tree
Showing 13 changed files with 393 additions and 150 deletions.
1 change: 1 addition & 0 deletions packages/kbn-rule-data-utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ export * from './src/technical_field_names';
export * from './src/alerts_as_data_rbac';
export * from './src/alerts_as_data_severity';
export * from './src/alerts_as_data_status';
export * from './src/routes/stack_rule_paths';
12 changes: 12 additions & 0 deletions packages/kbn-rule-data-utils/src/routes/stack_rule_paths.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

export const ruleDetailsRoute = '/rule/:ruleId' as const;
export const triggersActionsRoute = '/app/management/insightsAndAlerting/triggersActions' as const;

export const getRuleDetailsRoute = (ruleId: string) => ruleDetailsRoute.replace(':ruleId', ruleId);
Loading

0 comments on commit 2180a8a

Please sign in to comment.