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
a998728b
Commit
a998728b
authored
Jun 16, 2020
by
David O'Regan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restrict user search to current project
parent
6795afa5
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
30 additions
and
3 deletions
+30
-3
app/assets/javascripts/alert_management/components/alert_details.vue
...javascripts/alert_management/components/alert_details.vue
+5
-0
app/assets/javascripts/alert_management/components/alert_sidebar.vue
...javascripts/alert_management/components/alert_sidebar.vue
+5
-0
app/assets/javascripts/alert_management/components/sidebar/sidebar_assignees.vue
...alert_management/components/sidebar/sidebar_assignees.vue
+5
-1
app/assets/javascripts/alert_management/details.js
app/assets/javascripts/alert_management/details.js
+2
-1
app/helpers/projects/alert_management_helper.rb
app/helpers/projects/alert_management_helper.rb
+1
-0
changelogs/unreleased/assign-alerts-permissions-hotfix.yml
changelogs/unreleased/assign-alerts-permissions-hotfix.yml
+5
-0
spec/frontend/alert_management/components/alert_management_detail_spec.js
...ert_management/components/alert_management_detail_spec.js
+2
-0
spec/frontend/alert_management/components/alert_managment_sidebar_assignees_spec.js
...ment/components/alert_managment_sidebar_assignees_spec.js
+1
-0
spec/frontend/alert_management/components/alert_sidebar_spec.js
...rontend/alert_management/components/alert_sidebar_spec.js
+1
-0
spec/helpers/projects/alert_management_helper_spec.rb
spec/helpers/projects/alert_management_helper_spec.rb
+3
-1
No files found.
app/assets/javascripts/alert_management/components/alert_details.vue
View file @
a998728b
...
@@ -57,6 +57,10 @@ export default {
...
@@ -57,6 +57,10 @@ export default {
type
:
String
,
type
:
String
,
required
:
true
,
required
:
true
,
},
},
projectId
:
{
type
:
String
,
required
:
true
,
},
projectPath
:
{
projectPath
:
{
type
:
String
,
type
:
String
,
required
:
true
,
required
:
true
,
...
@@ -327,6 +331,7 @@ export default {
...
@@ -327,6 +331,7 @@ export default {
</gl-tabs>
</gl-tabs>
<alert-sidebar
<alert-sidebar
:project-path=
"projectPath"
:project-path=
"projectPath"
:project-id=
"projectId"
:alert=
"alert"
:alert=
"alert"
:sidebar-collapsed=
"sidebarCollapsed"
:sidebar-collapsed=
"sidebarCollapsed"
@
alert-refresh=
"alertRefresh"
@
alert-refresh=
"alertRefresh"
...
...
app/assets/javascripts/alert_management/components/alert_sidebar.vue
View file @
a998728b
...
@@ -16,6 +16,10 @@ export default {
...
@@ -16,6 +16,10 @@ export default {
type
:
Boolean
,
type
:
Boolean
,
required
:
true
,
required
:
true
,
},
},
projectId
:
{
type
:
String
,
required
:
true
,
},
projectPath
:
{
projectPath
:
{
type
:
String
,
type
:
String
,
required
:
true
,
required
:
true
,
...
@@ -49,6 +53,7 @@ export default {
...
@@ -49,6 +53,7 @@ export default {
/>
/>
<sidebar-assignees
<sidebar-assignees
:project-path=
"projectPath"
:project-path=
"projectPath"
:project-id=
"projectId"
:alert=
"alert"
:alert=
"alert"
:sidebar-collapsed=
"sidebarCollapsed"
:sidebar-collapsed=
"sidebarCollapsed"
@
alert-refresh=
"$emit('alert-refresh')"
@
alert-refresh=
"$emit('alert-refresh')"
...
...
app/assets/javascripts/alert_management/components/sidebar/sidebar_assignees.vue
View file @
a998728b
...
@@ -38,6 +38,10 @@ export default {
...
@@ -38,6 +38,10 @@ export default {
SidebarAssignee
,
SidebarAssignee
,
},
},
props
:
{
props
:
{
projectId
:
{
type
:
String
,
required
:
true
,
},
projectPath
:
{
projectPath
:
{
type
:
String
,
type
:
String
,
required
:
true
,
required
:
true
,
...
@@ -128,7 +132,7 @@ export default {
...
@@ -128,7 +132,7 @@ export default {
per_page
:
20
,
per_page
:
20
,
active
:
true
,
active
:
true
,
current_user
:
true
,
current_user
:
true
,
project_id
:
gon
?.
current_project_i
d
,
project_id
:
this
.
projectI
d
,
},
},
})
})
.
then
(({
data
})
=>
{
.
then
(({
data
})
=>
{
...
...
app/assets/javascripts/alert_management/details.js
View file @
a998728b
...
@@ -8,7 +8,7 @@ Vue.use(VueApollo);
...
@@ -8,7 +8,7 @@ Vue.use(VueApollo);
export
default
selector
=>
{
export
default
selector
=>
{
const
domEl
=
document
.
querySelector
(
selector
);
const
domEl
=
document
.
querySelector
(
selector
);
const
{
alertId
,
projectPath
,
projectIssuesPath
}
=
domEl
.
dataset
;
const
{
alertId
,
projectPath
,
projectIssuesPath
,
projectId
}
=
domEl
.
dataset
;
const
apolloProvider
=
new
VueApollo
({
const
apolloProvider
=
new
VueApollo
({
defaultClient
:
createDefaultClient
(
defaultClient
:
createDefaultClient
(
...
@@ -39,6 +39,7 @@ export default selector => {
...
@@ -39,6 +39,7 @@ export default selector => {
props
:
{
props
:
{
alertId
,
alertId
,
projectPath
,
projectPath
,
projectId
,
projectIssuesPath
,
projectIssuesPath
,
},
},
});
});
...
...
app/helpers/projects/alert_management_helper.rb
View file @
a998728b
...
@@ -15,6 +15,7 @@ module Projects::AlertManagementHelper
...
@@ -15,6 +15,7 @@ module Projects::AlertManagementHelper
{
{
'alert-id'
=>
alert_id
,
'alert-id'
=>
alert_id
,
'project-path'
=>
project
.
full_path
,
'project-path'
=>
project
.
full_path
,
'project-id'
=>
project
.
id
,
'project-issues-path'
=>
project_issues_path
(
project
)
'project-issues-path'
=>
project_issues_path
(
project
)
}
}
end
end
...
...
changelogs/unreleased/assign-alerts-permissions-hotfix.yml
0 → 100644
View file @
a998728b
---
title
:
Restrict alert assignee user search to current project in alert management details
merge_request
:
34649
author
:
type
:
fixed
spec/frontend/alert_management/components/alert_management_detail_spec.js
View file @
a998728b
...
@@ -19,6 +19,7 @@ describe('AlertDetails', () => {
...
@@ -19,6 +19,7 @@ describe('AlertDetails', () => {
let
mock
;
let
mock
;
const
projectPath
=
'
root/alerts
'
;
const
projectPath
=
'
root/alerts
'
;
const
projectIssuesPath
=
'
root/alerts/-/issues
'
;
const
projectIssuesPath
=
'
root/alerts/-/issues
'
;
const
projectId
=
'
1
'
;
const
findDetailsTable
=
()
=>
wrapper
.
find
(
GlTable
);
const
findDetailsTable
=
()
=>
wrapper
.
find
(
GlTable
);
...
@@ -28,6 +29,7 @@ describe('AlertDetails', () => {
...
@@ -28,6 +29,7 @@ describe('AlertDetails', () => {
alertId
:
'
alertId
'
,
alertId
:
'
alertId
'
,
projectPath
,
projectPath
,
projectIssuesPath
,
projectIssuesPath
,
projectId
,
},
},
data
()
{
data
()
{
return
{
alert
:
{
...
mockAlert
},
...
data
};
return
{
alert
:
{
...
mockAlert
},
...
data
};
...
...
spec/frontend/alert_management/components/alert_managment_sidebar_assignees_spec.js
View file @
a998728b
...
@@ -33,6 +33,7 @@ describe('Alert Details Sidebar Assignees', () => {
...
@@ -33,6 +33,7 @@ describe('Alert Details Sidebar Assignees', () => {
...
data
,
...
data
,
sidebarCollapsed
,
sidebarCollapsed
,
projectPath
:
'
projectPath
'
,
projectPath
:
'
projectPath
'
,
projectId
:
'
1
'
,
},
},
mocks
:
{
mocks
:
{
$apollo
:
{
$apollo
:
{
...
...
spec/frontend/alert_management/components/alert_sidebar_spec.js
View file @
a998728b
...
@@ -22,6 +22,7 @@ describe('Alert Details Sidebar', () => {
...
@@ -22,6 +22,7 @@ describe('Alert Details Sidebar', () => {
alert
,
alert
,
sidebarCollapsed
,
sidebarCollapsed
,
projectPath
:
'
projectPath
'
,
projectPath
:
'
projectPath
'
,
projectId
:
'
1
'
,
},
},
stubs
,
stubs
,
});
});
...
...
spec/helpers/projects/alert_management_helper_spec.rb
View file @
a998728b
...
@@ -7,7 +7,8 @@ describe Projects::AlertManagementHelper do
...
@@ -7,7 +7,8 @@ describe Projects::AlertManagementHelper do
let_it_be
(
:project
,
reload:
true
)
{
create
(
:project
)
}
let_it_be
(
:project
,
reload:
true
)
{
create
(
:project
)
}
let_it_be
(
:current_user
)
{
create
(
:user
)
}
let_it_be
(
:current_user
)
{
create
(
:user
)
}
let_it_be
(
:project_path
)
{
project
.
full_path
}
let
(
:project_path
)
{
project
.
full_path
}
let
(
:project_id
)
{
project
.
id
}
describe
'#alert_management_data'
do
describe
'#alert_management_data'
do
let
(
:user_can_enable_alert_management
)
{
true
}
let
(
:user_can_enable_alert_management
)
{
true
}
...
@@ -75,6 +76,7 @@ describe Projects::AlertManagementHelper do
...
@@ -75,6 +76,7 @@ describe Projects::AlertManagementHelper do
expect
(
helper
.
alert_management_detail_data
(
project
,
alert_id
)).
to
eq
(
expect
(
helper
.
alert_management_detail_data
(
project
,
alert_id
)).
to
eq
(
'alert-id'
=>
alert_id
,
'alert-id'
=>
alert_id
,
'project-path'
=>
project_path
,
'project-path'
=>
project_path
,
'project-id'
=>
project_id
,
'project-issues-path'
=>
issues_path
'project-issues-path'
=>
issues_path
)
)
end
end
...
...
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