Fix error message for existing labels.

This commit is contained in:
Fatih Acet 2016-07-28 13:40:29 +03:00
parent 279c61f3cb
commit 5dffd21cd5
2 changed files with 10 additions and 5 deletions

View File

@ -112,6 +112,9 @@ v 8.10.3
- Fix importer for GitHub Pull Requests when a branch was removed. !5573
- Ignore invalid IPs in X-Forwarded-For when trusted proxies are configured. !5584
- Trim extra displayed carriage returns in diffs and files with CRLFs. !5588
- Fix label already exist error message in the right sidebar.
v 8.10.3 (unreleased)
v 8.10.2
- User can now search branches by name. !5144

View File

@ -70,13 +70,15 @@
name: newLabelField.val(),
color: newColorField.val()
}, function(label) {
var errors;
$newLabelCreateButton.enable();
if (label.message != null) {
errors = _.map(label.message, function(value, key) {
return key + " " + value[0];
});
return $newLabelError.html(errors.join("<br/>")).show();
var errorText = label.message;
if (_.isObject(label.message)) {
errorText = _.map(label.message, function(value, key) {
return key + " " + value[0];
}).join('<br/>');
}
return $newLabelError.html(errorText).show();
} else {
return $('.dropdown-menu-back', $dropdown.parent()).trigger('click');
}