You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by er...@apache.org on 2015/05/20 07:10:19 UTC

svn commit: r1680457 - in /lucene/dev/trunk/solr/webapp/web/js/angular: app.js controllers/dataimport.js services.js

Author: erick
Date: Wed May 20 05:10:18 2015
New Revision: 1680457

URL: http://svn.apache.org/r1680457
Log:
SOLR-7568: Dataimport non-existence error lingers across new admin UI tabs

Modified:
    lucene/dev/trunk/solr/webapp/web/js/angular/app.js
    lucene/dev/trunk/solr/webapp/web/js/angular/controllers/dataimport.js
    lucene/dev/trunk/solr/webapp/web/js/angular/services.js

Modified: lucene/dev/trunk/solr/webapp/web/js/angular/app.js
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/webapp/web/js/angular/app.js?rev=1680457&r1=1680456&r2=1680457&view=diff
==============================================================================
--- lucene/dev/trunk/solr/webapp/web/js/angular/app.js (original)
+++ lucene/dev/trunk/solr/webapp/web/js/angular/app.js Wed May 20 05:10:18 2015
@@ -280,6 +280,9 @@ solrAdminApp.config([
   };
 
   var failed = function(rejection) {
+    if (rejection.config.params.doNotIntercept) {
+        return rejection;
+    }
     activeRequests--;
     if (activeRequests == 0) {
       $rootScope.$broadcast('loadingStatusInactive');

Modified: lucene/dev/trunk/solr/webapp/web/js/angular/controllers/dataimport.js
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/webapp/web/js/angular/controllers/dataimport.js?rev=1680457&r1=1680456&r2=1680457&view=diff
==============================================================================
--- lucene/dev/trunk/solr/webapp/web/js/angular/controllers/dataimport.js (original)
+++ lucene/dev/trunk/solr/webapp/web/js/angular/controllers/dataimport.js Wed May 20 05:10:18 2015
@@ -40,9 +40,14 @@ solrAdminApp.controller('DataImportContr
             });
 
             DataImport.config({core: $routeParams.core}, function (data) {
+                try {
+                    var xml = $.parseXML(data.config);
+                } catch (err) {
+                    $scope.hasHandlers = false;
+                    return;
+                }
                 $scope.config = data.config;
                 $scope.entities = [];
-                var xml = $.parseXML($scope.config);
                 $('document > entity', xml).each(function (i, element) {
                     $scope.entities.push($(element).attr('name'));
                 });
@@ -134,6 +139,10 @@ solrAdminApp.controller('DataImportContr
 
             $scope.isStatusLoading = true;
             DataImport.status({core: $routeParams.core}, function (data) {
+                if (data[0] == "<") {
+                    $scope.hasHandlers = false;
+                    return;
+                }
 
                 var now = new Date();
                 $scope.lastUpdate = now.toTimeString().split(' ').shift();

Modified: lucene/dev/trunk/solr/webapp/web/js/angular/services.js
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/webapp/web/js/angular/services.js?rev=1680457&r1=1680456&r2=1680457&view=diff
==============================================================================
--- lucene/dev/trunk/solr/webapp/web/js/angular/services.js (original)
+++ lucene/dev/trunk/solr/webapp/web/js/angular/services.js Wed May 20 05:10:18 2015
@@ -133,10 +133,12 @@ solrAdminServices.factory('System',
 .factory('DataImport',
   ['$resource', function($resource) {
     return $resource('/solr/:core/dataimport', {core: '@core', indent:'on', wt:'json', _:Date.now()}, {
-      "config": {params: {command: "show-config"}, transformResponse: function(data) {
-          return {config: data};
-      }},
-      "status": {params: {command: "status"}},
+      "config": {params: {command: "show-config", doNotIntercept: "true"},
+                 transformResponse: function(data) {
+                    return {config: data};
+                 }
+                },
+      "status": {params: {command: "status", doNotIntercept: "true"}},
       "reload": {params: {command: "reload-config"}},
       "post": {method: "POST",
                 headers: {'Content-type': 'application/x-www-form-urlencoded'},