mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Variables: enables cancel for slow query variables queries (#24430)
* Refactor: initial commit * Tests: updates tests * Tests: updates snapshots * Chore: updates after PR comments * Chore: renamed initVariablesBatch * Tests: adds transactionReducer tests * Chore: updates after PR comments * Refactor: renames cancelAllDataSourceRequests * Refactor: reduces cancellation complexity * Tests: adds tests for cancelAllInFlightRequests * Tests: adds initVariablesTransaction tests * Tests: adds tests for cleanUpVariables and cancelVariables * Always cleanup dashboard on unmount, even if init is in progress. Check if init phase has changed after services init is completed * fixed failing tests and added some more to test new scenario. Co-authored-by: Torkel Ödegaard <torkel@grafana.com> Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
This commit is contained in:
@@ -3,17 +3,22 @@ import { optionsPickerReducer, OptionsPickerState } from '../pickers/OptionsPick
|
||||
import { variableEditorReducer, VariableEditorState } from '../editor/reducer';
|
||||
import { variablesReducer } from './variablesReducer';
|
||||
import { VariableModel } from '../../templating/types';
|
||||
import { transactionReducer, TransactionState } from './transactionReducer';
|
||||
|
||||
export interface TemplatingState {
|
||||
variables: Record<string, VariableModel>;
|
||||
optionsPicker: OptionsPickerState;
|
||||
editor: VariableEditorState;
|
||||
transaction: TransactionState;
|
||||
}
|
||||
|
||||
export const templatingReducers = combineReducers({
|
||||
editor: variableEditorReducer,
|
||||
variables: variablesReducer,
|
||||
optionsPicker: optionsPickerReducer,
|
||||
transaction: transactionReducer,
|
||||
});
|
||||
|
||||
export default {
|
||||
templating: combineReducers({
|
||||
editor: variableEditorReducer,
|
||||
variables: variablesReducer,
|
||||
optionsPicker: optionsPickerReducer,
|
||||
}),
|
||||
templating: templatingReducers,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user