ReturnToPrevious: Add this functionality to the "Go to panel" button on Alert rules (#83630)

Add RTP to the 'Go to panel' button
This commit is contained in:
Laura Fernández 2024-02-29 12:19:59 +01:00 committed by GitHub
parent 2a429cd7db
commit f0822e0aef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -160,8 +160,11 @@ export const RuleDetailsActionButtons = ({ rule, rulesSource, isViewMode }: Prop
key="panel" key="panel"
variant="primary" variant="primary"
icon="apps" icon="apps"
target="_blank" target={isReturnToPreviousEnabled ? undefined : '_blank'}
href={`d/${encodeURIComponent(dashboardUID)}?viewPanel=${encodeURIComponent(panelId)}`} href={`d/${encodeURIComponent(dashboardUID)}?viewPanel=${encodeURIComponent(panelId)}`}
onClick={() => {
setReturnToPrevious(rule.name);
}}
> >
Go to panel Go to panel
</LinkButton> </LinkButton>