From 1a413114152cdf0431d84a31a62cf38180f59fe2 Mon Sep 17 00:00:00 2001 From: "grafana-delivery-bot[bot]" <132647405+grafana-delivery-bot[bot]@users.noreply.github.com> Date: Wed, 15 Nov 2023 21:01:40 +0100 Subject: [PATCH] [v10.2.x] Alerting: Fix export with modifications URL when mounted on subpath (#78217) Co-authored-by: Gilles De Mey Fix export with modifications URL when mounted on subpath (#77622) --- .../rules/RuleDetailsActionButtons.tsx | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/public/app/features/alerting/unified/components/rules/RuleDetailsActionButtons.tsx b/public/app/features/alerting/unified/components/rules/RuleDetailsActionButtons.tsx index 44cd3979713..c3225e8bb6e 100644 --- a/public/app/features/alerting/unified/components/rules/RuleDetailsActionButtons.tsx +++ b/public/app/features/alerting/unified/components/rules/RuleDetailsActionButtons.tsx @@ -4,7 +4,7 @@ import React, { Fragment, useState } from 'react'; import { useLocation } from 'react-router-dom'; import { GrafanaTheme2, textUtil, urlUtil } from '@grafana/data'; -import { config, locationService } from '@grafana/runtime'; +import { config } from '@grafana/runtime'; import { Button, ClipboardButton, @@ -238,17 +238,11 @@ export const RuleDetailsActionButtons = ({ rule, rulesSource, isViewMode }: Prop } if (isGrafanaRulerRule(rulerRule)) { - moreActionsButtons.push( - - locationService.push( - createUrl(`/alerting/${encodeURIComponent(ruleId.stringifyIdentifier(identifier))}/modify-export`) - ) - } - /> + const modifyUrl = createUrl( + `/alerting/${encodeURIComponent(ruleId.stringifyIdentifier(identifier))}/modify-export` ); + + moreActionsButtons.push(); } if (hasCreateRulePermission && !isFederated) {