Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
3aa32bf7
Commit
3aa32bf7
authored
May 18, 2020
by
David O'Regan
Committed by
Martin Wortschack
May 18, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use visitUrl in Alert management
parent
e4d0c250
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
7 deletions
+16
-7
app/assets/javascripts/alert_management/components/alert_management_list.vue
...pts/alert_management/components/alert_management_list.vue
+4
-4
changelogs/unreleased/217992.yml
changelogs/unreleased/217992.yml
+5
-0
spec/frontend/alert_management/components/alert_management_list_spec.js
...alert_management/components/alert_management_list_spec.js
+7
-3
No files found.
app/assets/javascripts/alert_management/components/alert_management_list.vue
View file @
3aa32bf7
...
@@ -13,7 +13,7 @@ import {
...
@@ -13,7 +13,7 @@ import {
}
from
'
@gitlab/ui
'
;
}
from
'
@gitlab/ui
'
;
import
createFlash
from
'
~/flash
'
;
import
createFlash
from
'
~/flash
'
;
import
{
s__
}
from
'
~/locale
'
;
import
{
s__
}
from
'
~/locale
'
;
import
{
joinPaths
}
from
'
~/lib/utils/url_utility
'
;
import
{
joinPaths
,
visitUrl
}
from
'
~/lib/utils/url_utility
'
;
import
TimeAgo
from
'
~/vue_shared/components/time_ago_tooltip.vue
'
;
import
TimeAgo
from
'
~/vue_shared/components/time_ago_tooltip.vue
'
;
import
getAlerts
from
'
../graphql/queries/getAlerts.query.graphql
'
;
import
getAlerts
from
'
../graphql/queries/getAlerts.query.graphql
'
;
import
{
ALERTS_STATUS
,
ALERTS_STATUS_TABS
,
ALERTS_SEVERITY_LABELS
}
from
'
../constants
'
;
import
{
ALERTS_STATUS
,
ALERTS_STATUS_TABS
,
ALERTS_SEVERITY_LABELS
}
from
'
../constants
'
;
...
@@ -173,8 +173,8 @@ export default {
...
@@ -173,8 +173,8 @@ export default {
);
);
});
});
},
},
handleRowClick
({
iid
})
{
navigateToAlertDetails
({
iid
})
{
window
.
location
.
assign
(
joinPaths
(
window
.
location
.
pathname
,
iid
,
'
details
'
));
return
visitUrl
(
joinPaths
(
window
.
location
.
pathname
,
iid
,
'
details
'
));
},
},
},
},
};
};
...
@@ -209,7 +209,7 @@ export default {
...
@@ -209,7 +209,7 @@ export default {
:busy=
"loading"
:busy=
"loading"
stacked=
"md"
stacked=
"md"
:tbody-tr-class=
"$options.bodyTrClass"
:tbody-tr-class=
"$options.bodyTrClass"
@
row-clicked=
"
handleRowClick
"
@
row-clicked=
"
navigateToAlertDetails
"
>
>
<
template
#cell(severity)=
"{ item }"
>
<
template
#cell(severity)=
"{ item }"
>
<div
<div
...
...
changelogs/unreleased/217992.yml
0 → 100644
View file @
3aa32bf7
---
title
:
Use visitUrl in Alert management
merge_request
:
32414
author
:
type
:
other
spec/frontend/alert_management/components/alert_management_list_spec.js
View file @
3aa32bf7
...
@@ -9,6 +9,7 @@ import {
...
@@ -9,6 +9,7 @@ import {
GlIcon
,
GlIcon
,
GlTab
,
GlTab
,
}
from
'
@gitlab/ui
'
;
}
from
'
@gitlab/ui
'
;
import
{
visitUrl
}
from
'
~/lib/utils/url_utility
'
;
import
TimeAgo
from
'
~/vue_shared/components/time_ago_tooltip.vue
'
;
import
TimeAgo
from
'
~/vue_shared/components/time_ago_tooltip.vue
'
;
import
createFlash
from
'
~/flash
'
;
import
createFlash
from
'
~/flash
'
;
import
AlertManagementList
from
'
~/alert_management/components/alert_management_list.vue
'
;
import
AlertManagementList
from
'
~/alert_management/components/alert_management_list.vue
'
;
...
@@ -18,6 +19,11 @@ import mockAlerts from '../mocks/alerts.json';
...
@@ -18,6 +19,11 @@ import mockAlerts from '../mocks/alerts.json';
jest
.
mock
(
'
~/flash
'
);
jest
.
mock
(
'
~/flash
'
);
jest
.
mock
(
'
~/lib/utils/url_utility
'
,
()
=>
({
visitUrl
:
jest
.
fn
().
mockName
(
'
visitUrlMock
'
),
joinPaths
:
jest
.
requireActual
(
'
~/lib/utils/url_utility
'
).
joinPaths
,
}));
describe
(
'
AlertManagementList
'
,
()
=>
{
describe
(
'
AlertManagementList
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
...
@@ -220,12 +226,10 @@ describe('AlertManagementList', () => {
...
@@ -220,12 +226,10 @@ describe('AlertManagementList', () => {
loading
:
false
,
loading
:
false
,
});
});
window
.
location
.
assign
=
jest
.
fn
();
findAlerts
()
findAlerts
()
.
at
(
0
)
.
at
(
0
)
.
trigger
(
'
click
'
);
.
trigger
(
'
click
'
);
expect
(
window
.
location
.
assign
).
toHaveBeenCalledWith
(
'
/1527542/details
'
);
expect
(
visitUrl
).
toHaveBeenCalledWith
(
'
/1527542/details
'
);
});
});
describe
(
'
handle date fields
'
,
()
=>
{
describe
(
'
handle date fields
'
,
()
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment