Skip to content

Commit

Permalink
fix parameters inputs function
Browse files Browse the repository at this point in the history
  • Loading branch information
ElectronicBlueberry committed Dec 5, 2024
1 parent fa384b7 commit d0da7e7
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 22 deletions.
7 changes: 4 additions & 3 deletions client/src/components/Panels/InputPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ const emit = defineEmits<{
<button
v-for="(input, index) in props.inputs"
:key="index"
:data-id="input.id ?? input.moduleId"
class="workflow-input-button"
@click="emit('insertModule', input.id, input.title, input.stateOverwrites)">
@click="emit('insertModule', input.moduleId, input.title, input.stateOverwrites)">
<FontAwesomeIcon class="input-icon" fixed-width :icon="input.icon" />
<span class="input-title">{{ input.title }}</span>
<span class="input-description">{{ input.description }}</span>
<span class="input-title"> {{ input.title }} </span>
<span class="input-description"> {{ input.description }} </span>
</button>
</div>
</ActivityPanel>
Expand Down
24 changes: 15 additions & 9 deletions client/src/components/Workflow/Editor/modules/inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { faPencilAlt } from "@fortawesome/free-solid-svg-icons";
import { type IconDefinition } from "font-awesome-6";

export interface WorkflowInput {
id: string;
id?: string; // unique ID. defaults to module ID
moduleId: string;
title: string;
description: string;
stateOverwrites?: {
Expand All @@ -15,19 +16,19 @@ export interface WorkflowInput {
export function getWorkflowInputs(): WorkflowInput[] {
return [
{
id: "data_input",
moduleId: "data_input",
title: "Input Dataset",
description: "Single dataset input",
icon: faFile,
},
{
id: "data_collection_input",
moduleId: "data_collection_input",
title: "Input Dataset Collection",
description: "Input for a collection of datasets",
icon: faFolder,
},
{
id: "parameter_input",
moduleId: "parameter_input",
title: "Text Input",
description: "Text parameter used for workflow logic",
icon: faPencilAlt,
Expand All @@ -36,7 +37,8 @@ export function getWorkflowInputs(): WorkflowInput[] {
},
},
{
id: "parameter_input",
id: "parameter_input_integer",
moduleId: "parameter_input",
title: "Integer Input",
description: "Whole number parameter used for workflow logic",
icon: faPencilAlt,
Expand All @@ -45,7 +47,8 @@ export function getWorkflowInputs(): WorkflowInput[] {
},
},
{
id: "parameter_input",
id: "parameter_input_float",
moduleId: "parameter_input",
title: "Float Input",
description: "Imprecise decimal number parameter used for workflow logic",
icon: faPencilAlt,
Expand All @@ -54,7 +57,8 @@ export function getWorkflowInputs(): WorkflowInput[] {
},
},
{
id: "parameter_input",
id: "parameter_input_boolean",
moduleId: "parameter_input",
title: "Boolean Input",
description: "True / False parameter used for workflow logic",
icon: faPencilAlt,
Expand All @@ -63,7 +67,8 @@ export function getWorkflowInputs(): WorkflowInput[] {
},
},
{
id: "parameter_input",
id: "parameter_input_color",
moduleId: "parameter_input",
title: "Color Input",
description: "Color parameter used for workflow logic",
icon: faPencilAlt,
Expand All @@ -72,7 +77,8 @@ export function getWorkflowInputs(): WorkflowInput[] {
},
},
{
id: "parameter_input",
id: "parameter_input_directory_uri",
moduleId: "parameter_input",
title: "Directory Input",
description: "Directory parameter used for workflow logic",
icon: faPencilAlt,
Expand Down
5 changes: 5 additions & 0 deletions client/src/utils/navigation/navigation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,11 @@ workflow_editor:
freehand_comment: ".freehand-workflow-comment"
freehand_path: ".freehand-workflow-comment path"
delete: "button[title='Delete comment']"
inputs:
selectors:
activity_button: "#activity-workflow-editor-inputs"
activity_panel: ".activity-panel[data-description='Inputs']"
input: ".workflow-input-button[data-id='${id}']"
selectors:
node_inspector: '.tool-inspector'
node_inspector_close: ".tool-inspector [title='close']"
Expand Down
9 changes: 4 additions & 5 deletions lib/galaxy/selenium/navigates_galaxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1209,12 +1209,11 @@ def workflow_editor_add_input(self, item_name="data_input"):
# Make sure we're on the workflow editor and not clicking the main tool panel.
editor.canvas_body.wait_for_visible()

self.open_toolbox()
editor.tool_menu_section_link(section_name="inputs").wait_for_and_click()
editor.tool_menu_item_link(item_name=item_name).wait_for_and_click()
if editor.inputs.activity_panel.is_absent:
editor.inputs.activity_button.wait_for_and_click()

def workflow_editor_add_parameter_input(self):
self.workflow_editor_add_input(item_name="parameter_input")
editor.inputs.input(id=item_name).wait_for_and_click()
self.sleep_for(self.wait_types.UX_RENDER)

def workflow_editor_set_license(self, license: str) -> None:
license_selector = self.components.workflow_editor.license_selector
Expand Down
8 changes: 3 additions & 5 deletions lib/galaxy_test/selenium/test_workflow_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def test_parameter_regex_validation(self):

parameter_name = "text_param"
name = self.create_and_wait_for_new_workflow_in_editor()
self.workflow_editor_add_parameter_input()
self.workflow_editor_add_input("parameter_input_text")
editor.label_input.wait_for_and_send_keys(parameter_name)
# this really should be parameterized with the repeat name
self.components.tool_form.repeat_insert.wait_for_and_click()
Expand Down Expand Up @@ -131,7 +131,7 @@ def test_int_parameter_minimum_validation(self):

parameter_name = "int_param"
name = self.create_and_wait_for_new_workflow_in_editor()
self.workflow_editor_add_parameter_input()
self.workflow_editor_add_input("parameter_input_text")
editor.label_input.wait_for_and_send_keys(parameter_name)
select_field = self.components.tool_form.parameter_select(parameter="parameter_definition|parameter_type")
self.select_set_value(select_field, "integer")
Expand All @@ -157,10 +157,8 @@ def test_float_parameter_maximum_validation(self):

parameter_name = "float_param"
name = self.create_and_wait_for_new_workflow_in_editor()
self.workflow_editor_add_parameter_input()
self.workflow_editor_add_input("parameter_input_float")
editor.label_input.wait_for_and_send_keys(parameter_name)
select_field = self.components.tool_form.parameter_select(parameter="parameter_definition|parameter_type")
self.select_set_value(select_field, "float")
self.components.tool_form.parameter_input(parameter="parameter_definition|max").wait_for_and_send_keys("3.14")
self.save_after_node_form_changes()

Expand Down

0 comments on commit d0da7e7

Please sign in to comment.