Skip to content

Commit

Permalink
#1564 Sort responders by name
Browse files Browse the repository at this point in the history
  • Loading branch information
nadouani committed Oct 20, 2020
1 parent 772d387 commit f8959cf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
12 changes: 6 additions & 6 deletions ui/app/scripts/controllers/case/CaseObservablesCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@
$scope.showReport = function(observable, analyzerId) {
CortexSrv.getJobs($scope.caseId, observable.id, analyzerId, 1)
.then(function(response) {
return CortexSrv.getJob(response.data[0].id)
return CortexSrv.getJob(response.data[0].id);
})
.then(function(response){
var job = response.data;
Expand Down Expand Up @@ -684,8 +684,8 @@
})
.catch(function(err) {
NotificationSrv.error('Unable to fetch the analysis report');
})
}
});
};

$scope.getObsResponders = function(observableId, force) {
if(!force && $scope.obsResponders !== null) {
Expand All @@ -698,8 +698,8 @@
$scope.obsResponders = responders;
})
.catch(function(err) {
NotificationSrv.error('observablesList', response.data, response.status);
})
NotificationSrv.error('observablesList', err.data, err.status);
});
};

$scope.runResponder = function(responderId, responderName, artifact) {
Expand All @@ -721,7 +721,7 @@
this.observable = observable;
this.close = function() {
$uibModalInstance.dismiss();
}
};
});

})();
3 changes: 1 addition & 2 deletions ui/app/scripts/services/CortexSrv.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,9 @@
};

this.getResponders = function(type, id) {
//return $http.get(baseUrl + '/responder')
return $http.get(baseUrl + '/responder/' + type + '/' + id)
.then(function(response) {
return $q.resolve(response.data);
return $q.resolve(_.sortBy(response.data, 'name'));
})
.catch(function(err) {
return $q.reject(err);
Expand Down

0 comments on commit f8959cf

Please sign in to comment.