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
881e2d16
Commit
881e2d16
authored
Aug 02, 2017
by
Simon Knox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Projects dropdown to New issue form
parent
28ee4ef7
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
80 additions
and
12 deletions
+80
-12
app/assets/javascripts/boards/components/board_list.js
app/assets/javascripts/boards/components/board_list.js
+5
-0
app/assets/javascripts/boards/components/board_new_issue.js
app/assets/javascripts/boards/components/board_new_issue.js
+57
-1
app/assets/javascripts/boards/models/issue.js
app/assets/javascripts/boards/models/issue.js
+2
-2
app/assets/stylesheets/pages/boards.scss
app/assets/stylesheets/pages/boards.scss
+6
-0
app/views/shared/boards/components/_board.html.haml
app/views/shared/boards/components/_board.html.haml
+9
-8
app/views/shared/boards/components/sidebar/_labels.html.haml
app/views/shared/boards/components/sidebar/_labels.html.haml
+1
-1
No files found.
app/assets/javascripts/boards/components/board_list.js
View file @
881e2d16
...
...
@@ -9,6 +9,10 @@ const Store = gl.issueBoards.BoardsStore;
export
default
{
name
:
'
BoardList
'
,
props
:
{
groupId
:
{
type
:
Number
,
required
:
false
,
},
disabled
:
{
type
:
Boolean
,
required
:
true
,
...
...
@@ -167,6 +171,7 @@ export default {
</div>
<transition name="slide-down">
<board-new-issue
:groupId="groupId"
:list="list"
v-if="list.type !== 'closed' && showIssueForm"/>
</transition>
...
...
app/assets/javascripts/boards/components/board_new_issue.js
View file @
881e2d16
/* global ListIssue */
import
eventHub
from
'
../eventhub
'
;
import
Api
from
'
../../api
'
;
const
Store
=
gl
.
issueBoards
.
BoardsStore
;
export
default
{
name
:
'
BoardNewIssue
'
,
props
:
{
list
:
Object
,
groupId
:
{
type
:
Number
,
required
:
false
,
},
list
:
{
type
:
Object
,
required
:
true
,
},
},
data
()
{
return
{
title
:
''
,
loading
:
true
,
selectedProject
:
{},
projects
:
[],
error
:
false
,
};
},
methods
:
{
loadProjects
()
{
this
.
loading
=
true
;
Api
.
groupProjects
(
this
.
groupId
,
{},
(
projects
)
=>
{
this
.
projects
=
projects
;
this
.
loading
=
false
;
});
},
submit
(
e
)
{
e
.
preventDefault
();
if
(
this
.
title
.
trim
()
===
''
)
return
Promise
.
resolve
();
...
...
@@ -27,6 +45,7 @@ export default {
labels
,
subscribed
:
true
,
assignees
:
[],
project_id
:
this
.
selectedProject
.
id
,
});
if
(
Store
.
state
.
currentBoard
)
{
...
...
@@ -62,6 +81,18 @@ export default {
},
mounted
()
{
this
.
$refs
.
input
.
focus
();
$
(
this
.
$refs
.
projectsDropdown
).
glDropdown
({
filterable
:
true
,
filterRemote
:
true
,
search
:
{
fields
:
[
'
name_with_namespace
'
],
},
data
(
term
,
callback
)
{
console
.
log
(
term
);
return
Api
.
groupProjects
(
this
.
groupId
,
term
,
callback
);
},
text
:
project
=>
project
.
name
,
});
},
template
:
`
<div class="card board-new-issue-form">
...
...
@@ -82,6 +113,31 @@ export default {
ref="input"
autocomplete="off"
:id="list.id + '-title'" />
<div class="dropdown prepend-top-10">
<button
@click="loadProjects"
class="dropdown-menu-toggle"
type="button"
data-toggle="dropdown"
aria-expanded="false">
{{ selectedProject.name || 'Select a project' }}
<i class="fa fa-chevron-down"></i>
</button>
<div class="dropdown-menu dropdown-menu-selectable">
<ul>
<li v-for="project in projects">
<a
href="#"
role="button"
:class="{ 'is-active': project.id == selectedProject.id }"
@click.prevent="selectedProject = project">
{{ project.name }}
</a>
</li>
</ul>
</div>
</div>
<div class="clearfix prepend-top-10">
<button class="btn btn-success pull-left"
type="submit"
...
...
app/assets/javascripts/boards/models/issue.js
View file @
881e2d16
...
...
@@ -19,8 +19,8 @@ class ListIssue {
this
.
position
=
obj
.
relative_position
||
Infinity
;
this
.
milestone_id
=
obj
.
milestone_id
;
this
.
updateUrl
=
obj
.
update_url
;
this
.
canEdit
=
obj
.
can_edit
;
this
.
project
I
d
=
obj
.
project_id
;
this
.
canEdit
=
true
;
//
obj.can_edit;
this
.
project
_i
d
=
obj
.
project_id
;
if
(
obj
.
milestone
)
{
this
.
milestone
=
new
ListMilestone
(
obj
.
milestone
);
...
...
app/assets/stylesheets/pages/boards.scss
View file @
881e2d16
...
...
@@ -209,6 +209,12 @@
padding
:
$gl-padding
;
font-size
:
1em
;
border-bottom
:
1px
solid
$border-color
;
display
:
flex
;
align-items
:
center
;
}
.board-title-text
{
margin-right
:
auto
;
}
.board-delete
{
...
...
app/views/shared/boards/components/_board.html.haml
View file @
881e2d16
...
...
@@ -6,10 +6,16 @@
%i
.fa.fa-fw.board-title-expandable-toggle
{
"v-if"
:
"list.isExpandable"
,
":class"
:
"{
\"
fa-caret-down
\"
: list.isExpanded,
\"
fa-caret-right
\"
: !list.isExpanded && list.position === -1,
\"
fa-caret-left
\"
: !list.isExpanded && list.position !== -1 }"
,
"aria-hidden"
:
"true"
}
%span
.has-tooltip
{
":title"
=>
'(list.label ? list.label.description : "")'
,
%span
.
board-title-text.
has-tooltip
{
":title"
=>
'(list.label ? list.label.description : "")'
,
data:
{
container:
"body"
,
placement:
"bottom"
}
}
{{ list.title }}
.issue-count-badge.pull-right.clearfix
{
"v-if"
=>
'list.type !== "blank"'
}
-
if
can?
(
current_user
,
:admin_list
,
current_board_parent
)
%board-delete
{
"inline-template"
=>
true
,
":list"
=>
"list"
,
"v-if"
=>
"!list.preset && list.id"
}
%button
.board-delete.has-tooltip.btn.btn-transparent.link-highlight
{
type:
"button"
,
title:
"Delete list"
,
"aria-label"
=>
"Delete list"
,
data:
{
placement:
"bottom"
},
"@click.stop"
=>
"deleteBoard"
}
=
icon
(
"trash"
)
.issue-count-badge.clearfix
{
"v-if"
=>
'list.type !== "blank"'
}
%span
.issue-count-badge-count.pull-left
{
":class"
=>
'
{
"has-btn"
:
list
.
type
!==
"closed"
&&
!
disabled
}
'
}
{{ list.issuesSize }}
-
if
can?
(
current_user
,
:admin_list
,
current_board_parent
)
...
...
@@ -20,12 +26,6 @@
"title"
=>
"New issue"
,
data:
{
placement:
"top"
,
container:
"body"
}
}
=
icon
(
"plus"
,
class:
"js-no-trigger-collapse"
)
-
if
can?
(
current_user
,
:admin_list
,
current_board_parent
)
%board-delete
{
"inline-template"
=>
true
,
":list"
=>
"list"
,
"v-if"
=>
"!list.preset && list.id"
}
%button
.board-delete.has-tooltip.pull-right
{
type:
"button"
,
title:
"Delete list"
,
"aria-label"
=>
"Delete list"
,
data:
{
placement:
"bottom"
},
"@click.stop"
=>
"deleteBoard"
}
=
icon
(
"trash"
)
%board-list
{
"v-if"
=>
'list.type !== "blank"'
,
":list"
=>
"list"
,
":issues"
=>
"list.issues"
,
...
...
@@ -33,6 +33,7 @@
":disabled"
=>
"disabled"
,
":issue-link-base"
=>
"issueLinkBase"
,
":root-path"
=>
"rootPath"
,
":groupId"
=>
(
current_board_parent
.
id
if
@group
),
"ref"
=>
"board-list"
}
-
if
can?
(
current_user
,
:admin_list
,
current_board_parent
)
%board-blank-state
{
"v-if"
=>
'list.id == "blank"'
}
app/views/shared/boards/components/sidebar/_labels.html.haml
View file @
881e2d16
...
...
@@ -33,5 +33,5 @@
=
icon
(
'chevron-down'
)
.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
,
@project
and
@project
-
if
can?
(
current_user
,
:admin_label
,
current_board_parent
)
=
render
partial:
"shared/issuable/label_page_create"
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