mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
ShareModal: Remove shareView param when creating a sharing URL (#81976)
This commit is contained in:
parent
cf601fab09
commit
eab7990349
@ -162,6 +162,17 @@ describe('ShareModal', () => {
|
||||
`http://localhost:3000/goto/${mockUid}`
|
||||
);
|
||||
});
|
||||
|
||||
it('should generate render url without shareView param', async () => {
|
||||
mockLocationHref('http://dashboards.grafana.com/d/abcdefghi/my-dash?shareView=link');
|
||||
render(<ShareLink {...props} />);
|
||||
|
||||
const base = 'http://dashboards.grafana.com/render/d-solo/abcdefghi/my-dash';
|
||||
const params = '?from=1000&to=2000&orgId=1&panelId=22&width=1000&height=500&tz=UTC';
|
||||
expect(
|
||||
await screen.findByRole('link', { name: selectors.pages.SharePanelModal.linkToRenderedImage })
|
||||
).toHaveAttribute('href', base + params);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -52,6 +52,10 @@ export function buildParams({
|
||||
// Token is unique to the authenticated identity and should not be shared with the URL,
|
||||
// so we are stripping it from the query params as a safety measure.
|
||||
searchParams.delete('auth_token');
|
||||
|
||||
// The shareView param is used to indicate that the sharing modal is open and should never be included in the URL
|
||||
searchParams.delete('shareView');
|
||||
|
||||
return searchParams;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user