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
cca4a5fd
Commit
cca4a5fd
authored
Apr 05, 2019
by
Tucker Chapman
Committed by
Phil Hughes
Apr 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add checkbox to choose to create new list when creating new label
parent
e4a37158
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
51 additions
and
9 deletions
+51
-9
app/assets/javascripts/boards/components/new_list_dropdown.js
...assets/javascripts/boards/components/new_list_dropdown.js
+5
-1
app/assets/javascripts/create_label.js
app/assets/javascripts/create_label.js
+7
-2
app/assets/javascripts/gl_dropdown.js
app/assets/javascripts/gl_dropdown.js
+2
-3
app/views/shared/boards/components/sidebar/_labels.html.haml
app/views/shared/boards/components/sidebar/_labels.html.haml
+1
-1
app/views/shared/issuable/_board_create_list_dropdown.html.haml
...ews/shared/issuable/_board_create_list_dropdown.html.haml
+1
-1
app/views/shared/issuable/_label_page_create.html.haml
app/views/shared/issuable/_label_page_create.html.haml
+8
-0
changelogs/unreleased/create-label-and-list-checkbox.yml
changelogs/unreleased/create-label-and-list-checkbox.yml
+5
-0
locale/gitlab.pot
locale/gitlab.pot
+3
-0
spec/features/boards/boards_spec.rb
spec/features/boards/boards_spec.rb
+1
-1
spec/features/boards/sidebar_spec.rb
spec/features/boards/sidebar_spec.rb
+18
-0
No files found.
app/assets/javascripts/boards/components/new_list_dropdown.js
View file @
cca4a5fd
...
...
@@ -8,7 +8,11 @@ import boardsStore from '../stores/boards_store';
$
(
document
)
.
off
(
'
created.label
'
)
.
on
(
'
created.label
'
,
(
e
,
label
)
=>
{
.
on
(
'
created.label
'
,
(
e
,
label
,
addNewList
)
=>
{
if
(
!
addNewList
)
{
return
;
}
boardsStore
.
new
({
title
:
label
.
title
,
position
:
boardsStore
.
state
.
lists
.
length
-
2
,
...
...
app/assets/javascripts/create_label.js
View file @
cca4a5fd
...
...
@@ -14,6 +14,7 @@ export default class CreateLabelDropdown {
this
.
$newLabelField
=
$
(
'
#new_label_name
'
,
this
.
$el
);
this
.
$newColorField
=
$
(
'
#new_label_color
'
,
this
.
$el
);
this
.
$colorPreview
=
$
(
'
.js-dropdown-label-color-preview
'
,
this
.
$el
);
this
.
$addList
=
$
(
'
.js-add-list
'
,
this
.
$el
);
this
.
$newLabelError
=
$
(
'
.js-label-error
'
,
this
.
$el
);
this
.
$newLabelCreateButton
=
$
(
'
.js-new-label-btn
'
,
this
.
$el
);
this
.
$colorSuggestions
=
$
(
'
.suggest-colors-dropdown a
'
,
this
.
$el
);
...
...
@@ -21,6 +22,8 @@ export default class CreateLabelDropdown {
this
.
$newLabelError
.
hide
();
this
.
$newLabelCreateButton
.
disable
();
this
.
addListDefault
=
this
.
$addList
.
is
(
'
:checked
'
);
this
.
cleanBinding
();
this
.
addBinding
();
}
...
...
@@ -83,6 +86,8 @@ export default class CreateLabelDropdown {
this
.
$newColorField
.
val
(
''
).
trigger
(
'
change
'
);
this
.
$addList
.
prop
(
'
checked
'
,
this
.
addListDefault
);
this
.
$colorPreview
.
css
(
'
background-color
'
,
''
)
.
parent
()
...
...
@@ -116,9 +121,9 @@ export default class CreateLabelDropdown {
this
.
$newLabelError
.
html
(
errors
).
show
();
}
else
{
const
addNewList
=
this
.
$addList
.
is
(
'
:checked
'
);
this
.
$dropdownBack
.
trigger
(
'
click
'
);
$
(
document
).
trigger
(
'
created.label
'
,
label
);
$
(
document
).
trigger
(
'
created.label
'
,
[
label
,
addNewList
]);
}
},
);
...
...
app/assets/javascripts/gl_dropdown.js
View file @
cca4a5fd
...
...
@@ -561,10 +561,9 @@ GitLabDropdown = (function() {
!
$target
.
data
(
'
isLink
'
)
)
{
e
.
stopPropagation
();
return
false
;
}
else
{
return
true
;
}
return
true
;
}
};
...
...
app/views/shared/boards/components/sidebar/_labels.html.haml
View file @
cca4a5fd
...
...
@@ -28,4 +28,4 @@
.dropdown-menu.dropdown-select.dropdown-menu-paging.dropdown-menu-labels.dropdown-menu-selectable
=
render
partial:
"shared/issuable/label_page_default"
-
if
can?
(
current_user
,
:admin_label
,
current_board_parent
)
=
render
partial:
"shared/issuable/label_page_create"
=
render
partial:
"shared/issuable/label_page_create"
,
locals:
{
show_add_list:
true
}
app/views/shared/issuable/_board_create_list_dropdown.html.haml
View file @
cca4a5fd
...
...
@@ -4,5 +4,5 @@
.dropdown-menu.dropdown-extended-height.dropdown-menu-paging.dropdown-menu-right.dropdown-menu-issues-board-new.dropdown-menu-selectable.js-tab-container-labels
=
render
partial:
"shared/issuable/label_page_default"
,
locals:
{
show_footer:
true
,
show_create:
true
,
show_boards_content:
true
,
title:
"Add list"
}
-
if
can?
(
current_user
,
:admin_label
,
board
.
parent
)
=
render
partial:
"shared/issuable/label_page_create"
=
render
partial:
"shared/issuable/label_page_create"
,
locals:
{
show_add_list:
true
,
add_list:
true
,
add_list_class:
'd-none'
}
=
dropdown_loading
app/views/shared/issuable/_label_page_create.html.haml
View file @
cca4a5fd
-
show_close
=
local_assigns
.
fetch
(
:show_close
,
true
)
-
show_add_list
=
local_assigns
.
fetch
(
:show_add_list
,
false
)
-
add_list
=
local_assigns
.
fetch
(
:add_list
,
false
)
-
add_list_class
=
local_assigns
.
fetch
(
:add_list_class
,
''
)
-
subject
=
@project
||
@group
.dropdown-page-two.dropdown-new-label
=
dropdown_title
(
create_label_title
(
subject
),
options:
{
back:
true
,
close:
show_close
})
...
...
@@ -12,6 +15,11 @@
.dropdown-label-color-input
.dropdown-label-color-preview.js-dropdown-label-color-preview
%input
#new_label_color
.default-dropdown-input
{
type:
"text"
,
placeholder:
_
(
'Assign custom color like #FF0000'
)
}
-
if
show_add_list
.dropdown-label-input
{
class:
add_list_class
}
%label
%input
.js-add-list
{
type:
"checkbox"
,
name:
"add_list"
,
checked:
add_list
}
%span
=
_
(
'Add list'
)
.clearfix
%button
.btn.btn-primary.float-left.js-new-label-btn
{
type:
"button"
}
=
_
(
'Create'
)
...
...
changelogs/unreleased/create-label-and-list-checkbox.yml
0 → 100644
View file @
cca4a5fd
---
title
:
'
Added
"Add
List"
checkbox
to
create
label
dropdown
to
make
creation
of
list
optional'
merge_request
:
25716
author
:
Tucker Chapman
type
:
fixed
locale/gitlab.pot
View file @
cca4a5fd
...
...
@@ -453,6 +453,9 @@ msgstr ""
msgid "Add license"
msgstr ""
msgid "Add list"
msgstr ""
msgid "Add new application"
msgstr ""
...
...
spec/features/boards/boards_spec.rb
View file @
cca4a5fd
...
...
@@ -345,7 +345,7 @@ describe 'Issue Boards', :js do
click_link
'Create project label'
fill_in
(
'new_label_name'
,
with:
'Testing New Label'
)
fill_in
(
'new_label_name'
,
with:
'Testing New Label
- with list
'
)
first
(
'.suggest-colors a'
).
click
...
...
spec/features/boards/sidebar_spec.rb
View file @
cca4a5fd
...
...
@@ -343,6 +343,24 @@ describe 'Issue Boards', :js do
expect
(
page
).
to
have_link
'test label'
end
expect
(
page
).
to
have_selector
(
'.board'
,
count:
3
)
end
it
'creates project label and list'
do
click_card
(
card
)
page
.
within
(
'.labels'
)
do
click_link
'Edit'
click_link
'Create project label'
fill_in
'new_label_name'
,
with:
'test label'
first
(
'.suggest-colors-dropdown a'
).
click
first
(
'.js-add-list'
).
click
click_button
'Create'
wait_for_requests
expect
(
page
).
to
have_link
'test label'
end
expect
(
page
).
to
have_selector
(
'.board'
,
count:
4
)
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