mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Variables: move state tree into a keyed state (#44642)
* Variables: move state tree into a keyed state * Update public/app/features/variables/state/transactionReducer.ts Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com> * Chore: fix prettier error * Chore: renamed slices and lastUid * Chore: rename toUidAction * Chore: rename dashboardVariableReducer * Chore: rename state prop back to templating * Chore renames variable.dashboardUid * Chore: rename toDashboardVariableIdentifier * Chore: rename getDashboardVariable * Chore: rename getDashboardVariablesState * Chore: rename getDashboardVariables * Chore: some more renames * Chore: small clean up * Chore: small rename * Chore: removes unused function * Chore: rename VariableModel.stateKey * Chore: rename KeyedVariableIdentifier.stateKey * user essentials mob! 🔱 * user essentials mob! 🔱 * user essentials mob! 🔱 * user essentials mob! 🔱 Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com> Co-authored-by: kay delaney <kay@grafana.com> Co-authored-by: Alexandra Vargas <alexa1866@gmail.com> Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
This commit is contained in:
@@ -34,7 +34,6 @@ import { updateTimeZoneForSession } from 'app/features/profile/state/reducers';
|
||||
import { toggleTableView } from './state/reducers';
|
||||
|
||||
import { getPanelEditorTabs } from './state/selectors';
|
||||
import { getVariables } from 'app/features/variables/state/selectors';
|
||||
|
||||
import { StoreState } from 'app/types';
|
||||
import { DisplayMode, displayModes, PanelEditorTab } from './types';
|
||||
@@ -55,6 +54,7 @@ import { notifyApp } from '../../../../core/actions';
|
||||
import { PanelEditorTableView } from './PanelEditorTableView';
|
||||
import { PanelModelWithLibraryPanel } from 'app/features/library-panels/types';
|
||||
import { getPanelStateForModel } from 'app/features/panel/state/selectors';
|
||||
import { getVariablesByKey } from '../../../variables/state/selectors';
|
||||
|
||||
interface OwnProps {
|
||||
dashboard: DashboardModel;
|
||||
@@ -62,7 +62,7 @@ interface OwnProps {
|
||||
tab?: string;
|
||||
}
|
||||
|
||||
const mapStateToProps = (state: StoreState) => {
|
||||
const mapStateToProps = (state: StoreState, ownProps: OwnProps) => {
|
||||
const panel = state.panelEditor.getPanel();
|
||||
const panelState = getPanelStateForModel(state, panel);
|
||||
|
||||
@@ -73,7 +73,7 @@ const mapStateToProps = (state: StoreState) => {
|
||||
initDone: state.panelEditor.initDone,
|
||||
uiState: state.panelEditor.ui,
|
||||
tableViewEnabled: state.panelEditor.tableViewEnabled,
|
||||
variables: getVariables(state),
|
||||
variables: getVariablesByKey(ownProps.dashboard.uid, state),
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user