Commit c052abed by Hugo Häggmark Committed by GitHub

Variables: hides dropdown before refreshing starts (#28112)

parent 3b442765
...@@ -192,9 +192,9 @@ describe('options picker actions', () => { ...@@ -192,9 +192,9 @@ describe('options picker actions', () => {
toggleOption({ option: options[1], forceSelect: true, clearOthers }), toggleOption({ option: options[1], forceSelect: true, clearOthers }),
setCurrentVariableValue(toVariablePayload(variable, { option })), setCurrentVariableValue(toVariablePayload(variable, { option })),
changeVariableProp(toVariablePayload(variable, { propName: 'queryValue', propValue: '' })), changeVariableProp(toVariablePayload(variable, { propName: 'queryValue', propValue: '' })),
hideOptions(),
setCurrentVariableValue(toVariablePayload(variable, { option })), setCurrentVariableValue(toVariablePayload(variable, { option })),
updateLocation({ query: { 'var-Constant': ['B'] } }), updateLocation({ query: { 'var-Constant': ['B'] } })
hideOptions()
); );
}); });
}); });
...@@ -265,9 +265,9 @@ describe('options picker actions', () => { ...@@ -265,9 +265,9 @@ describe('options picker actions', () => {
tester.thenDispatchedActionsShouldEqual( tester.thenDispatchedActionsShouldEqual(
setCurrentVariableValue(toVariablePayload(variable, { option })), setCurrentVariableValue(toVariablePayload(variable, { option })),
changeVariableProp(toVariablePayload(variable, { propName: 'queryValue', propValue: '' })), changeVariableProp(toVariablePayload(variable, { propName: 'queryValue', propValue: '' })),
hideOptions(),
setCurrentVariableValue(toVariablePayload(variable, { option })), setCurrentVariableValue(toVariablePayload(variable, { option })),
updateLocation({ query: { 'var-Constant': [] } }), updateLocation({ query: { 'var-Constant': [] } })
hideOptions()
); );
}); });
}); });
...@@ -297,9 +297,9 @@ describe('options picker actions', () => { ...@@ -297,9 +297,9 @@ describe('options picker actions', () => {
tester.thenDispatchedActionsShouldEqual( tester.thenDispatchedActionsShouldEqual(
setCurrentVariableValue(toVariablePayload(variable, { option })), setCurrentVariableValue(toVariablePayload(variable, { option })),
changeVariableProp(toVariablePayload(variable, { propName: 'queryValue', propValue: 'C' })), changeVariableProp(toVariablePayload(variable, { propName: 'queryValue', propValue: 'C' })),
hideOptions(),
setCurrentVariableValue(toVariablePayload(variable, { option })), setCurrentVariableValue(toVariablePayload(variable, { option })),
updateLocation({ query: { 'var-Constant': [] } }), updateLocation({ query: { 'var-Constant': [] } })
hideOptions()
); );
}); });
}); });
......
...@@ -82,14 +82,15 @@ export const commitChangesToVariable = (): ThunkResult<void> => { ...@@ -82,14 +82,15 @@ export const commitChangesToVariable = (): ThunkResult<void> => {
dispatch(setCurrentVariableValue(toVariablePayload(existing, currentPayload))); dispatch(setCurrentVariableValue(toVariablePayload(existing, currentPayload)));
dispatch(changeVariableProp(toVariablePayload(existing, searchQueryPayload))); dispatch(changeVariableProp(toVariablePayload(existing, searchQueryPayload)));
const updated = getVariable<VariableWithMultiSupport>(picker.id, getState()); const updated = getVariable<VariableWithMultiSupport>(picker.id, getState());
dispatch(hideOptions());
if (getCurrentText(existing) === getCurrentText(updated)) { if (getCurrentText(existing) === getCurrentText(updated)) {
return dispatch(hideOptions()); return;
} }
const adapter = variableAdapters.get(updated.type); const adapter = variableAdapters.get(updated.type);
await adapter.setValue(updated, updated.current, true); await adapter.setValue(updated, updated.current, true);
return dispatch(hideOptions()); return;
}; };
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment