Skip to content

Commit 9086dab

Browse files
Team filter fix (#196)
1 parent 874cb7a commit 9086dab

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

public/app/features/variables/pickers/OptionsPicker/OptionsPicker.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ export const optionPickerFactory = <Model extends VariableWithOptions | Variable
5353
};
5454
}
5555

56-
const isMfeTeamFilter = state.fnGlobalState.FNDashboard && state.fnGlobalState.metadata.teams.length;
56+
const p = getVariablesState(rootStateKey, state).optionsPicker;
57+
const isMfeTeamFilter =
58+
state.fnGlobalState.FNDashboard && state.fnGlobalState.metadata.teams.length && p.id === 'team';
5759

5860
const teamFilter = isMfeTeamFilter
5961
? state.fnGlobalState.metadata.teams.map((t) => ({
@@ -63,8 +65,6 @@ export const optionPickerFactory = <Model extends VariableWithOptions | Variable
6365
}))
6466
: [];
6567

66-
const p = getVariablesState(rootStateKey, state).optionsPicker;
67-
6868
return {
6969
picker: { ...p, ...(teamFilter.length && { options: [...p.options, ...teamFilter] }) },
7070
mfeState: state.fnGlobalState,

0 commit comments

Comments
 (0)