Przeglądaj źródła

HUE-4966 [metadata] Removing spinning forever on search

Romain Rigaux 9 lat temu
rodzic
commit
7e63d69
1 zmienionych plików z 5 dodań i 3 usunięć
  1. 5 3
      desktop/core/src/desktop/templates/assist.mako

+ 5 - 3
desktop/core/src/desktop/templates/assist.mako

@@ -1314,8 +1314,7 @@ from metadata.conf import has_navigator
             query_s: self.searchInput(),
             limit: 25,
             sources: ko.mapping.toJSON([self.visiblePanel().type])
-          })
-          .done(function (data) {
+          }, function (data) {
             data.entities.forEach(function (entity) {
               if (entity.type === 'DATABASE') {
                 entity.click = function () {
@@ -1341,7 +1340,10 @@ from metadata.conf import has_navigator
             });
             self.searchResult(data.entities);
             self.searching(false);
-          })
+          }).fail(function (xhr, textStatus, errorThrown) {
+            $(document).trigger("error", xhr.responseText);
+            self.searching(false);
+          });
         };
 
         self.visiblePanel = ko.observable(self.availablePanels[0]);