Skip to content

Commit

Permalink
spaces are back
Browse files Browse the repository at this point in the history
  • Loading branch information
XavierM committed Nov 15, 2022
1 parent d2d1394 commit b0a1c95
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/kbn-rule-data-utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +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/paths';
export * from './src/routes/stack_rule_paths';
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export class ExecutionHandler<
kibanaBaseUrl: this.taskRunnerContext.kibanaBaseUrl,
alertParams: this.rule.params,
actionParams: action.params,
ruleUrl: this.buildRuleUrl(),
ruleUrl: this.buildRuleUrl(spaceId),
}),
}),
};
Expand Down Expand Up @@ -284,14 +284,16 @@ export class ExecutionHandler<
return executables;
}

private buildRuleUrl(): string | undefined {
private buildRuleUrl(spaceId: string): string | undefined {
if (!this.taskRunnerContext.kibanaBaseUrl) {
return;
}

try {
const ruleUrl = new URL(
`${triggersActionsRoute}${getRuleDetailsRoute(this.rule.id)}`,
`${
spaceId !== 'default' ? `/s/${spaceId}` : ''
}${triggersActionsRoute}${getRuleDetailsRoute(this.rule.id)}`,
this.taskRunnerContext.kibanaBaseUrl
);

Expand Down

0 comments on commit b0a1c95

Please sign in to comment.