BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
2f53a8d0
Commit
2f53a8d0
authored
Oct 05, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Shows error if response returns an error
Added validation so the user shouldnt be able to submit the form without the title present
parent
a68f1fdd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
2 deletions
+22
-2
board_new_issue.js.es6
...sets/javascripts/boards/components/board_new_issue.js.es6
+19
-2
_board.html.haml
app/views/projects/boards/components/_board.html.haml
+3
-0
No files found.
app/assets/javascripts/boards/components/board_new_issue.js.es6
View file @
2f53a8d0
...
...
@@ -8,7 +8,8 @@
},
data() {
return {
title: ''
title: '',
error: false
};
},
watch: {
...
...
@@ -19,6 +20,10 @@
methods: {
submit(e) {
e.preventDefault();
if (this.title.trim() === '') return;
this.error = false;
const labels = this.list.label ? [this.list.label] : [];
const issue = new ListIssue({
title: this.title,
...
...
@@ -26,9 +31,21 @@
});
this.list.newIssue(issue)
.then(() => {
.then((data) => {
// Need this because our jQuery very kindly disables buttons on ALL form submissions
$(this.$els.submitButton).enable();
})
.catch(() => {
// Need this because our jQuery very kindly disables buttons on ALL form submissions
$(this.$els.submitButton).enable();
// Remove issue with no ID
const issue = this.list.findIssue(undefined);
this.list.removeIssue(issue);
// Show error message
this.error = true;
this.showIssueForm = true;
});
this.cancel();
...
...
app/views/projects/boards/components/_board.html.haml
View file @
2f53a8d0
...
...
@@ -46,6 +46,9 @@
"v-show"
=>
"list.type !== 'done' && showIssueForm"
}
.card.board-new-issue-form
%form
{
"@submit"
=>
"submit($event)"
}
.flash-container
{
"v-if"
=>
"error"
}
.flash-alert
An error occured. Please try again.
%label
.label-light
{
":for"
=>
"list.id + '-title'"
}
Title
%input
.form-control
{
type:
"text"
,
...
...
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