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
e336d8d2
Commit
e336d8d2
authored
Jun 15, 2020
by
Rajat Jain
Committed by
Eugenia Grieff
Jun 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow health status to be reset
Send in 0 instead of null to reset the health status in the backend.
parent
f1e3dba7
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
23 additions
and
55 deletions
+23
-55
app/assets/javascripts/issuable_bulk_update_sidebar.js
app/assets/javascripts/issuable_bulk_update_sidebar.js
+4
-1
app/services/issuable/bulk_update_service.rb
app/services/issuable/bulk_update_service.rb
+2
-4
app/views/shared/issuable/_bulk_update_sidebar.html.haml
app/views/shared/issuable/_bulk_update_sidebar.html.haml
+1
-1
ee/app/assets/javascripts/sidebar/components/status/health_status_dropdown.vue
...ipts/sidebar/components/status/health_status_dropdown.vue
+0
-22
ee/app/assets/javascripts/vue_shared/components/sidebar/health_status_select/health_status_bundle.js
...ents/sidebar/health_status_select/health_status_bundle.js
+1
-1
ee/app/views/shared/issuable/_group_bulk_update_sidebar.html.haml
...iews/shared/issuable/_group_bulk_update_sidebar.html.haml
+1
-1
ee/spec/features/issues/bulk_assignment_health_status_spec.rb
...pec/features/issues/bulk_assignment_health_status_spec.rb
+14
-25
No files found.
app/assets/javascripts/issuable_bulk_update_sidebar.js
View file @
e336d8d2
...
...
@@ -65,7 +65,10 @@ export default class IssuableBulkUpdateSidebar {
new
MilestoneSelect
();
issueStatusSelect
();
subscriptionSelect
();
HealthStatusSelect
();
if
(
HealthStatusSelect
)
{
HealthStatusSelect
();
}
}
setupBulkUpdateActions
()
{
...
...
app/services/issuable/bulk_update_service.rb
View file @
e336d8d2
...
...
@@ -16,12 +16,12 @@ module Issuable
ids
=
params
.
delete
(
:issuable_ids
).
split
(
","
)
items
=
find_issuables
(
parent
,
model_class
,
ids
)
update_params
=
filter_update_params
(
type
)
filter_update_params
(
type
)
items
.
each
do
|
issuable
|
next
unless
can?
(
current_user
,
:"update_
#{
type
}
"
,
issuable
)
update_class
.
new
(
issuable
.
issuing_parent
,
current_user
,
update_
params
).
execute
(
issuable
)
update_class
.
new
(
issuable
.
issuing_parent
,
current_user
,
params
).
execute
(
issuable
)
end
{
...
...
@@ -53,8 +53,6 @@ module Issuable
if
params
[
:assignee_ids
]
==
[
IssuableFinder
::
Params
::
NONE
.
to_s
]
params
[
:assignee_ids
]
=
[]
end
params
end
def
find_issuables
(
parent
,
model_class
,
ids
)
...
...
app/views/shared/issuable/_bulk_update_sidebar.html.haml
View file @
e336d8d2
-
type
=
local_assigns
.
fetch
(
:type
)
-
bulk_issue_health_status_flag
=
@project
&
.
group
&
.
feature_available?
(
:issuable_health_status
)
&&
Feature
.
enabled?
(
:bulk_update_health_status
)
&&
type
==
:issues
-
bulk_issue_health_status_flag
=
Feature
.
enabled?
(
:bulk_update_health_status
)
&&
type
==
:issues
&&
@project
&
.
group
&
.
feature_available?
(
:issuable_health_status
)
%aside
.issues-bulk-update.js-right-sidebar.right-sidebar
{
"aria-live"
=>
"polite"
,
data:
{
'signed-in'
:
current_user
.
present?
}
}
.issuable-sidebar.hidden
...
...
ee/app/assets/javascripts/sidebar/components/status/health_status_dropdown.vue
View file @
e336d8d2
<
script
>
import
Tracking
from
'
~/tracking
'
;
import
{
GlButton
,
GlDropdownItem
,
GlDropdown
,
GlDropdownDivider
}
from
'
@gitlab/ui
'
;
import
{
s__
}
from
'
~/locale
'
;
import
{
healthStatusTextMap
}
from
'
../../constants
'
;
...
...
@@ -11,7 +10,6 @@ export default {
GlDropdownItem
,
GlDropdownDivider
,
},
mixins
:
[
Tracking
.
mixin
()],
props
:
{
isEditable
:
{
type
:
Boolean
,
...
...
@@ -40,9 +38,6 @@ export default {
};
},
computed
:
{
canRemoveStatus
()
{
return
this
.
isEditable
&&
this
.
status
;
},
statusText
()
{
return
this
.
status
?
healthStatusTextMap
[
this
.
status
]
:
s__
(
'
Sidebar|None
'
);
},
...
...
@@ -72,28 +67,11 @@ export default {
handleDropdownClick
(
status
)
{
this
.
selectedStatus
=
status
;
this
.
$emit
(
'
onDropdownClick
'
,
status
);
this
.
track
(
'
change_health_status
'
,
{
property
:
status
});
this
.
hideDropdown
();
},
hideDropdown
()
{
this
.
isDropdownShowing
=
false
;
},
toggleFormDropdown
()
{
this
.
isDropdownShowing
=
!
this
.
isDropdownShowing
;
/**
* We need to programmatically open the dropdown to make the
* outside click on document close the dropdown.
*/
const
{
dropdown
}
=
this
.
$refs
.
dropdown
.
$refs
;
if
(
dropdown
&&
this
.
isDropdownShowing
)
{
dropdown
.
show
();
}
},
removeStatus
()
{
this
.
handleDropdownClick
(
null
);
},
isSelected
(
status
)
{
return
this
.
status
===
status
;
},
...
...
ee/app/assets/javascripts/vue_shared/components/sidebar/health_status_select/health_status_bundle.js
View file @
e336d8d2
...
...
@@ -27,7 +27,7 @@ export default () => {
this
.
selectedStatus
=
selectedStatus
;
healthStatusFormFieldEl
.
setAttribute
(
'
value
'
,
selectedStatus
?
healthStatusForRestApi
[
selectedStatus
]
:
selectedStatus
,
healthStatusForRestApi
[
selectedStatus
||
'
NO_STATUS
'
]
,
);
},
},
...
...
ee/app/views/shared/issuable/_group_bulk_update_sidebar.html.haml
View file @
e336d8d2
-
group
=
local_assigns
.
fetch
(
:group
)
-
type
=
local_assigns
.
fetch
(
:type
)
-
bulk_issue_health_status_flag
=
@group
&
.
feature_available?
(
:issuable_health_status
)
&&
Feature
.
enabled?
(
:bulk_update_health_status
)
&&
type
==
:issues
-
bulk_issue_health_status_flag
=
Feature
.
enabled?
(
:bulk_update_health_status
)
&&
type
==
:issues
&&
@project
&
.
group
&
.
feature_available?
(
:issuable_health_status
)
%aside
.issues-bulk-update.js-right-sidebar.right-sidebar
{
'aria-live'
=>
'polite'
,
data:
{
'signed-in'
:
current_user
.
present?
}
}
.issuable-sidebar.hidden
...
...
ee/spec/features/issues/bulk_assignment_health_status_spec.rb
View file @
e336d8d2
...
...
@@ -3,12 +3,11 @@
require
'spec_helper'
describe
'Issues > Health status bulk assignment'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:group
)
{
create
(
:group
,
:public
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
group:
group
)
}
let!
(
:issue1
)
{
create
(
:issue
,
project:
project
,
title:
"Issue 1"
)
}
let!
(
:issue2
)
{
create
(
:issue
,
project:
project
,
title:
"Issue 2"
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:group
)
{
create
(
:group
,
:public
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:public
,
group:
group
)
}
let_it_be
(
:issue1
)
{
create
(
:issue
,
project:
project
,
title:
"Issue 1"
)
}
let_it_be
(
:issue2
)
{
create
(
:issue
,
project:
project
,
title:
"Issue 2"
)
}
context
'as an allowed user'
,
:js
do
before
do
...
...
@@ -22,16 +21,12 @@ describe 'Issues > Health status bulk assignment' do
end
context
'sidebar'
do
before
do
enable_bulk_update
end
it
'is present when bulk edit is enabled'
do
enable_bulk_update
expect
(
page
).
to
have_css
(
'.issuable-sidebar'
)
end
it
'is not present when bulk edit is disabled'
do
disable_bulk_update
expect
(
page
).
not_to
have_css
(
'.issuable-sidebar'
)
end
end
...
...
@@ -49,7 +44,7 @@ describe 'Issues > Health status bulk assignment' do
update_issues
end
it
do
it
'updates the health statuses'
do
expect
(
issue1
.
reload
.
health_status
).
to
eq
'on_track'
expect
(
issue2
.
reload
.
health_status
).
to
eq
'on_track'
end
...
...
@@ -62,7 +57,7 @@ describe 'Issues > Health status bulk assignment' do
update_issues
end
it
do
it
'updates the checked issue\'s status'
do
expect
(
issue1
.
reload
.
health_status
).
to
eq
'at_risk'
expect
(
issue2
.
reload
.
health_status
).
to
eq
nil
end
...
...
@@ -81,12 +76,10 @@ describe 'Issues > Health status bulk assignment' do
visit
project_issues_path
(
project
)
end
context
'cannot bulk assign health_status'
do
it
do
expect
(
page
).
not_to
have_button
'Edit issues'
expect
(
page
).
not_to
have_css
'.check-all-issues'
expect
(
page
).
not_to
have_css
'.issue-check'
end
it
'cannot bulk assign health_status'
do
expect
(
page
).
not_to
have_button
'Edit issues'
expect
(
page
).
not_to
have_css
'.check-all-issues'
expect
(
page
).
not_to
have_css
'.issue-check'
end
end
...
...
@@ -99,7 +92,7 @@ describe 'Issues > Health status bulk assignment' do
end
end
def
check
_issue
(
issue
,
uncheck
=
false
)
def
toggle
_issue
(
issue
,
uncheck
=
false
)
page
.
within
(
'.issues-list'
)
do
if
uncheck
uncheck
"selected_issue_
#{
issue
.
id
}
"
...
...
@@ -110,7 +103,7 @@ describe 'Issues > Health status bulk assignment' do
end
def
uncheck_issue
(
issue
)
check_issue
(
issue
,
true
)
toggle_issue
(
issue
,
uncheck:
true
)
end
def
update_issues
...
...
@@ -122,8 +115,4 @@ describe 'Issues > Health status bulk assignment' do
visit
project_issues_path
(
project
)
click_button
'Edit issues'
end
def
disable_bulk_update
click_button
'Cancel'
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