ソースを参照

Making sure we do not pass a long invalid queries and save to state

Hugo Häggmark 7 年 前
コミット
08f5a3338a

+ 1 - 0
public/app/features/explore/state/actions.ts

@@ -538,6 +538,7 @@ export function runQueries(exploreId: ExploreId) {
 
 
     if (!hasNonEmptyQuery(modifiedQueries)) {
     if (!hasNonEmptyQuery(modifiedQueries)) {
       dispatch({ type: ActionTypes.RunQueriesEmpty, payload: { exploreId } });
       dispatch({ type: ActionTypes.RunQueriesEmpty, payload: { exploreId } });
+      dispatch(stateSave()); // Remember to saves to state and update location
       return;
       return;
     }
     }
 
 

+ 2 - 1
public/app/plugins/datasource/loki/language_provider.ts

@@ -173,8 +173,9 @@ export default class LokiLanguageProvider extends LanguageProvider {
         })
         })
       );
       );
     }
     }
+    // Return a cleaned LokiQuery
     return queries.map(query => ({
     return queries.map(query => ({
-      ...query,
+      refId: query.refId,
       expr: '',
       expr: '',
     }));
     }));
   }
   }