committed by
Julius Härtl
parent
ab73f58fd8
commit
f01cd506f7
@@ -346,11 +346,17 @@ app.controller('BoardController', function ($rootScope, $scope, $stateParams, St
|
||||
BoardService.getCurrent().labels.push(data);
|
||||
$scope.status.createLabel = false;
|
||||
$scope.newLabel = {};
|
||||
}).catch(err => {
|
||||
OC.Notification.showTemporary('Duplicate label name is not allowed');
|
||||
});
|
||||
};
|
||||
|
||||
$scope.labelUpdate = function (label) {
|
||||
label.edit = false;
|
||||
LabelService.update(label);
|
||||
LabelService.update(label).catch(err => {
|
||||
label.title('XXX');
|
||||
OC.Notification.showTemporary('Duplicate label name is not allowed');
|
||||
});
|
||||
|
||||
// update labels in UI
|
||||
var cards = CardService.data;
|
||||
|
||||
@@ -92,7 +92,14 @@ class LabelService {
|
||||
|
||||
$this->permissionService->checkPermission(null, $boardId, Acl::PERMISSION_MANAGE);
|
||||
|
||||
$this->checkDuplicateTitle($boardId, $title);
|
||||
//$this->checkDuplicateTitle($boardId, $title);
|
||||
$boardLabels = $this->labelMapper->findAll($boardId);
|
||||
foreach($boardLabels as $boardLabel) {
|
||||
if ($boardLabel->getTitle() === $title) {
|
||||
throw new BadRequestException('title must be unique');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->boardService->isArchived(null, $boardId)) {
|
||||
throw new StatusException('Operation not allowed. This board is archived.');
|
||||
@@ -157,7 +164,18 @@ class LabelService {
|
||||
$this->permissionService->checkPermission($this->labelMapper, $id, Acl::PERMISSION_MANAGE);
|
||||
|
||||
$label = $this->find($id);
|
||||
$this->checkDuplicateTitle($label->getBoardId(), $title);
|
||||
//$this->checkDuplicateTitle($label->getBoardId(), $title);
|
||||
|
||||
$boardLabels = $this->labelMapper->findAll($label->getBoardId());
|
||||
foreach($boardLabels as $boardLabel) {
|
||||
if ($boardLabel->getId() === $label->getId()) {
|
||||
continue;
|
||||
}
|
||||
if ($boardLabel->getTitle() === $title) {
|
||||
throw new BadRequestException('title must be unique');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->boardService->isArchived($this->labelMapper, $id)) {
|
||||
throw new StatusException('Operation not allowed. This board is archived.');
|
||||
|
||||
Reference in New Issue
Block a user