Merge "Don't display 404 errors when using the "Jump to..." box"

This commit is contained in:
Zuul 2018-08-15 19:45:56 +00:00 committed by Gerrit Code Review
commit 84ddf0e53d
1 changed files with 14 additions and 1 deletions

View File

@ -22,7 +22,7 @@ angular.module('storyboard').controller('HeaderController',
function ($q, $scope, $rootScope, $state, $modal, NewStoryService,
Session, SessionState, CurrentUser, Criteria, Notification,
Priority, Project, Story, ProjectGroup, NewWorklistService,
NewBoardService, SessionModalService) {
NewBoardService, SessionModalService, Severity) {
'use strict';
function resolveCurrentUser() {
@ -174,11 +174,23 @@ angular.module('storyboard').controller('HeaderController',
searchString = searchString || '';
var searches = [];
var headerGET = false;
Notification.intercept(function(message) {
if (message.type === 'http' &&
message.severity === Severity.ERROR &&
message.message === 404 &&
headerGET
) {
return true;
}
});
if (searchString.match(/^[0-9]+$/)) {
var getProjectGroupDeferred = $q.defer();
var getProjectDeferred = $q.defer();
var getStoryDeferred = $q.defer();
headerGET = true;
ProjectGroup.get({id: searchString},
function (result) {
@ -216,6 +228,7 @@ angular.module('storyboard').controller('HeaderController',
searches.push(Story.criteriaResolver(searchString, 5));
}
$q.all(searches).then(function (searchResults) {
headerGET = false;
var criteria = [
Criteria.create('Text', searchString)
];