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
4d9f76c1
Commit
4d9f76c1
authored
Oct 03, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added ability to save the new issue
parent
4241c290
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
54 additions
and
7 deletions
+54
-7
app/assets/javascripts/boards/components/board_list.js.es6
app/assets/javascripts/boards/components/board_list.js.es6
+1
-1
app/assets/javascripts/boards/components/board_new_issue.js.es6
...sets/javascripts/boards/components/board_new_issue.js.es6
+14
-1
app/assets/javascripts/boards/mixins/sortable_default_options.js.es6
...javascripts/boards/mixins/sortable_default_options.js.es6
+1
-1
app/assets/javascripts/boards/models/list.js.es6
app/assets/javascripts/boards/models/list.js.es6
+11
-0
app/assets/javascripts/boards/services/board_service.js.es6
app/assets/javascripts/boards/services/board_service.js.es6
+8
-0
app/controllers/projects/boards/issues_controller.rb
app/controllers/projects/boards/issues_controller.rb
+13
-0
app/views/projects/boards/components/_board.html.haml
app/views/projects/boards/components/_board.html.haml
+5
-3
config/routes/project.rb
config/routes/project.rb
+1
-1
No files found.
app/assets/javascripts/boards/components/board_list.js.es6
View file @
4d9f76c1
...
...
@@ -76,7 +76,7 @@
group: 'issues',
sort: false,
disabled: this.disabled,
filter: '.board-list-count',
filter: '.board-list-count
, .board-new-issue-form
',
onStart: (e) => {
const card = this.$refs.issue[e.oldIndex];
...
...
app/assets/javascripts/boards/components/board_new_issue.js.es6
View file @
4d9f76c1
...
...
@@ -3,6 +3,7 @@
gl.issueBoards.BoardNewIssue = Vue.extend({
props: {
list: Object,
showIssueForm: Boolean
},
data() {
...
...
@@ -10,14 +11,26 @@
title: ''
};
},
watch: {
showIssueForm () {
this.$els.input.focus();
}
},
methods: {
submit(e) {
e.preventDefault();
const issue = new ListIssue({
title: this.title,
labels: [this.list.label]
});
this.title = '';
this.list.newIssue(issue);
this.cancel();
},
cancel() {
this.showIssueForm = false;
this.title = '';
}
}
});
...
...
app/assets/javascripts/boards/mixins/sortable_default_options.js.es6
View file @
4d9f76c1
...
...
@@ -21,7 +21,7 @@
fallbackClass: 'is-dragging',
fallbackOnBody: true,
ghostClass: 'is-ghost',
filter: '.has-tooltip',
filter: '.has-tooltip
, .btn
',
delay: gl.issueBoards.touchEnabled ? 100 : 0,
scrollSensitivity: gl.issueBoards.touchEnabled ? 60 : 100,
scrollSpeed: 20,
...
...
app/assets/javascripts/boards/models/list.js.es6
View file @
4d9f76c1
...
...
@@ -87,6 +87,17 @@ class List {
});
}
newIssue (issue) {
this.addIssue(issue);
this.issuesSize++;
gl.boardService.newIssue(this.id, issue)
.then((resp) => {
const data = resp.json();
issue.id = data.iid;
});
}
createIssues (data) {
data.forEach((issueObj) => {
this.addIssue(new ListIssue(issueObj));
...
...
app/assets/javascripts/boards/services/board_service.js.es6
View file @
4d9f76c1
...
...
@@ -58,4 +58,12 @@ class BoardService {
to_list_id
});
}
newIssue (id, issue) {
return this.issues.save({ id }, {
issue: {
title: issue.title
}
});
}
};
app/controllers/projects/boards/issues_controller.rb
View file @
4d9f76c1
...
...
@@ -19,6 +19,15 @@ module Projects
}
end
def
create
list
=
project
.
board
.
lists
.
find
(
params
[
:list_id
])
issue
=
Issues
::
CreateService
.
new
(
project
,
current_user
,
issue_params
.
merge
(
request:
request
)).
execute
issue
.
labels
<<
list
.
label
render
json:
issue
.
to_json
end
def
update
service
=
::
Boards
::
Issues
::
MoveService
.
new
(
project
,
current_user
,
move_params
)
...
...
@@ -54,6 +63,10 @@ module Projects
def
move_params
params
.
permit
(
:id
,
:from_list_id
,
:to_list_id
)
end
def
issue_params
params
.
require
(
:issue
).
permit
(
:title
)
end
end
end
end
app/views/projects/boards/components/_board.html.haml
View file @
4d9f76c1
...
...
@@ -42,14 +42,16 @@
":data-board"
=>
"list.id"
}
-
if
can?
current_user
,
:create_issue
,
@project
%board-new-issue
{
"inline-template"
=>
true
,
":list"
=>
"list"
,
":show-issue-form.sync"
=>
"showIssueForm"
,
"v-
if
"
=>
"list.type !== 'done' && showIssueForm"
}
%li
.card
"v-
show
"
=>
"list.type !== 'done' && showIssueForm"
}
%li
.card
.board-new-issue-form
%form
{
"@submit"
=>
"submit($event)"
}
%label
.label-light
Title
%input
.form-control
{
type:
"text"
,
"v-model"
=>
"title"
}
"v-model"
=>
"title"
,
"v-el:input"
=>
true
}
.clearfix.prepend-top-10
%button
.btn.btn-success.pull-left
{
type:
"submit"
,
":disabled"
=>
"title === ''"
}
...
...
config/routes/project.rb
View file @
4d9f76c1
...
...
@@ -424,7 +424,7 @@ resources :namespaces, path: '/', constraints: { id: /[a-zA-Z.0-9_\-]+/ }, only:
post
:generate
end
resources
:issues
,
only:
[
:index
]
resources
:issues
,
only:
[
:index
,
:create
]
end
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