Skip to content

Commit

Permalink
Watch option changes
Browse files Browse the repository at this point in the history
  • Loading branch information
guerler committed Aug 26, 2023
1 parent 787961f commit 3c97f38
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
21 changes: 14 additions & 7 deletions client/src/components/Form/Elements/FormData/FormData.vue
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,17 @@ function handleIncoming(incoming: Record<string, unknown>, partial = true) {
}
}
/**
* Set initial value
*/
function initialValue() {
if ((isLDDA.value || isDCE.value) && props.value && props.value.values) {
setValue(matchValues(props.value.values));
} else {
setValue(currentValue.value);
}
}
/**
* Matches entries to available options
*/
Expand Down Expand Up @@ -425,20 +436,16 @@ onMounted(() => {
eventBus.$on("waiting", (value: boolean) => {
waiting.value = value;
});
if ((isLDDA.value || isDCE.value) && props.value && props.value.values) {
setValue(matchValues(props.value.values));
} else {
setValue(currentValue.value);
}
initialValue();
});
/**
* Watch and set current value if user switches to a different select field
*/
watch(
() => [currentLinked.value, currentVariant.value],
() => [props.options, currentLinked.value, currentVariant.value],
() => {
setValue(currentValue.value);
initialValue();
}
);
</script>
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy_test/selenium/test_tool_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def test_rerun_deleted_dataset(self):
error_input1 = self.components.tool_form.parameter_error(parameter="input1").wait_for_visible()
error_col = self.components.tool_form.parameter_error(parameter="col").wait_for_visible()
error_col_names = self.components.tool_form.parameter_error(parameter="col_names").wait_for_visible()
assert error_input1.text == "parameter 'input1': specify a dataset of the required format / build for parameter"
assert error_input1.text == "Please provide a value for this option."
assert error_col.text == "parameter 'col': requires a value, but no legal values defined"
assert error_col_names.text == "parameter 'col_names': requires a value, but no legal values defined"
# validate warnings when inputs are restored
Expand Down

0 comments on commit 3c97f38

Please sign in to comment.