Przeglądaj źródła

Merge pull request #14099 from alexanderzobnin/fix-14098

fix datasource testing
Torkel Ödegaard 7 lat temu
rodzic
commit
907c84f7d8
1 zmienionych plików z 4 dodań i 4 usunięć
  1. 4 4
      public/app/features/plugins/ds_edit_ctrl.ts

+ 4 - 4
public/app/features/plugins/ds_edit_ctrl.ts

@@ -118,7 +118,7 @@ export class DataSourceEditCtrl {
   }
 
   testDatasource() {
-    this.datasourceSrv.get(this.current.name).then(datasource => {
+    return this.datasourceSrv.get(this.current.name).then(datasource => {
       if (!datasource.testDatasource) {
         return;
       }
@@ -126,7 +126,7 @@ export class DataSourceEditCtrl {
       this.testing = { done: false, status: 'error' };
 
       // make test call in no backend cache context
-      this.backendSrv
+      return this.backendSrv
         .withNoBackendCache(() => {
           return datasource
             .testDatasource()
@@ -161,8 +161,8 @@ export class DataSourceEditCtrl {
       return this.backendSrv.put('/api/datasources/' + this.current.id, this.current).then(result => {
         this.current = result.datasource;
         this.updateNav();
-        this.updateFrontendSettings().then(() => {
-          this.testDatasource();
+        return this.updateFrontendSettings().then(() => {
+          return this.testDatasource();
         });
       });
     } else {