File tree Expand file tree Collapse file tree 2 files changed +30
-2
lines changed
lib/galaxy/tool_util_models
test/functional/tools/parameters Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Original file line number Diff line number Diff line change @@ -921,14 +921,14 @@ def validate_color_str_or_connected_value(value) -> str:
921921
922922 def pydantic_template (self , state_representation : StateRepresentationT ) -> DynamicModelInformation :
923923 py_type = self .py_type
924- initialize : Any = ...
924+ requires_value = self .request_requires_value
925+ initialize = ... if requires_value else None
925926 if state_representation == "workflow_step_linked" :
926927 py_type = allow_connected_value (py_type )
927928 validators = {
928929 "color_format" : field_validator (self .name )(ColorParameterModel .validate_color_str_or_connected_value )
929930 }
930931 elif state_representation == "workflow_step" :
931- initialize = None
932932 validators = {"color_format" : field_validator (self .name )(ColorParameterModel .validate_color_str_if_value )}
933933 else :
934934 validators = {"color_format" : field_validator (self .name )(ColorParameterModel .validate_color_str )}
Original file line number Diff line number Diff line change 1+ <tool id =" gx_color_optional" name =" gx_color_optional" version =" 1.0.0" >
2+ <command >
3+ echo "$parameter" > $out_file1;
4+ </command >
5+ <inputs >
6+ <param name =" parameter" type =" color" value =" #aabbcc" optional =" true" />
7+ </inputs >
8+ <outputs >
9+ <data name =" out_file1" format =" txt" />
10+ </outputs >
11+ <tests >
12+ <test >
13+ <param name =" parameter" value =" #aaaaaa" />
14+ <output name =" out_file1" >
15+ <assert_contents >
16+ <has_line line =" #aaaaaa" />
17+ </assert_contents >
18+ </output >
19+ </test >
20+ <test >
21+ <output name =" out_file1" >
22+ <assert_contents >
23+ <has_line line =" #aabbcc" />
24+ </assert_contents >
25+ </output >
26+ </test >
27+ </tests >
28+ </tool >
You can’t perform that action at this time.
0 commit comments