Handle default external id in SelectInput component (#1637) - #1691
Handle default external id in SelectInput component (#1637)#1691jochenklar wants to merge 8 commits into
Conversation
There was a problem hiding this comment.
we have an issue with this search definition in a (collection) question with an Optionset Provider plugin and multiple stored values. When the page opens it will make a lot of GET requests with a search, but those are not needed because a value is already there. So could we change this to:
const search = searchTextonly?
PS, some infos by Codex:
getValueOption()already creates a temporary option from the storedvalue.external_idandvalue.text, so an existing value can be displayed without loading it again. The newuseEffectin this PR would still explicitly load defaults that have anexternal_idbut no text. Typed user searches would continue to work normally.
value.textis the persisted display label returned by the provider when the value was selected. Its main purpose here appears to have been reconstructing the selected option, butgetValueOption()already handles that case.
|
It works, for example with the ROR Provider, when I set |
|
No, wait. Adding a value to a collection question seemingly replaces the first entry of the default value instead of adding another entry to the collection. 🙄 |
Signed-off-by: David Wallace <david.wallace@tu-darmstadt.de>
Signed-off-by: David Wallace <david.wallace@tu-darmstadt.de>
Signed-off-by: David Wallace <david.wallace@tu-darmstadt.de>
…-id+fixes 2.5.2/fix/default external id+fixes
|
thanks for including part of the fixes! |
This PR adds the handling of default
external_ids in SelectInput component.Resolves: #1637 .