admin: fix handling of description in claims

This commit is contained in:
nemunaire 2020-01-30 18:48:28 +01:00
parent 83ba3b88a5
commit 5849648c70
2 changed files with 8 additions and 7 deletions

View File

@ -1266,7 +1266,8 @@ angular.module("FICApp")
else
$scope.fields = ["subject", "priority", "id_exercice", "id_assignee", "id_team", "creation", "state"];
$scope.assignees = ClaimAssignee.query();
$scope.whoami = Math.floor(getCookie("myassignee"));
$scope.comm = { ndescription: ""};
$scope.whoami = Math.floor(getCookie("myassignee"));
$scope.teams = Teams.get();
$scope.exercices = Exercice.query();
$scope.namedFields = {
@ -1326,7 +1327,7 @@ angular.module("FICApp")
method: "POST",
data: {
"id_assignee": $scope.whoami,
"content": $scope.ndescription
"content": $scope.comm.ndescription
}
}).then(function(response) {
$location.url("/claims/" + $scope.claim.id + "/");
@ -1342,7 +1343,7 @@ angular.module("FICApp")
if (this.claim.id) {
this.claim.$update(function(v) {
v.id_team = "" + v.id_team;
if ($scope.ndescription)
if ($scope.comm.ndescription)
$scope.saveDescription();
else if (backToList)
$location.url("/claims/");
@ -1355,8 +1356,8 @@ angular.module("FICApp")
});
} else {
this.claim.$save(function() {
if (!$scope.ndescription)
$scope.ndescription = "Création de la tâche";
if (!$scope.comm.ndescription)
$scope.comm.ndescription = "Création de la tâche";
$scope.saveDescription();
}, function(response) {
$rootScope.newBox('danger', 'An error occurs when trying to save claim:', response.data.errmsg);

View File

@ -54,10 +54,10 @@
<div class="col-lg-5">
<div class="form-group" ng-if="whoami">
<textarea class="form-control form-control-sm" placeholder="Ajouter un commentaire" rows="1" id="ndescription" ng-model="ndescription" autofocus></textarea>
<textarea class="form-control form-control-sm" placeholder="Ajouter un commentaire" rows="1" id="ndescription" ng-model="comm.ndescription"></textarea>
</div>
<div class="form-group text-right" ng-show="claim.id && ndescription.length">
<div class="form-group text-right" ng-show="claim.id && comm.ndescription.length">
<button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-save" aria-hidden="true"></span> Ajouter commentaire</button>
</div>