Commit 0f65ae4c authored by Simon Knox's avatar Simon Knox

Merge branch '225655-alert-new-page' into 'master'

Allow alerts to open on new tab

Closes #225655

See merge request gitlab-org/gitlab!42691
parents 4ea45b8f 5d867627
......@@ -267,8 +267,8 @@ export default {
this.searchTerm = trimmedInput;
}
}, 500),
navigateToAlertDetails({ iid }) {
return visitUrl(joinPaths(window.location.pathname, iid, 'details'));
navigateToAlertDetails({ iid }, index, { metaKey }) {
return visitUrl(joinPaths(window.location.pathname, iid, 'details'), metaKey);
},
trackPageViews() {
const { category, action } = trackAlertListViewsOptions;
......
---
title: Allow alerts to open on new tab
merge_request: 42691
author:
type: changed
......@@ -295,10 +295,30 @@ describe('AlertManagementTable', () => {
loading: false,
});
expect(visitUrl).not.toHaveBeenCalled();
findAlerts()
.at(0)
.trigger('click');
expect(visitUrl).toHaveBeenCalledWith('/1527542/details');
expect(visitUrl).toHaveBeenCalledWith('/1527542/details', false);
});
it('navigates to the detail page in new tab when alert row is clicked with the metaKey', () => {
mountComponent({
props: { alertManagementEnabled: true, userCanEnableAlertManagement: true },
data: { alerts: { list: mockAlerts }, alertsCount, hasError: false },
loading: false,
});
expect(visitUrl).not.toHaveBeenCalled();
findAlerts()
.at(0)
.trigger('click', {
metaKey: true,
});
expect(visitUrl).toHaveBeenCalledWith('/1527542/details', true);
});
describe('alert issue links', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment