Unverified Commit 7186563e authored by John Chilton's avatar John Chilton Committed by GitHub
Browse files

Merge pull request #19895 from mvdbeek/skip_data_meta_filter_run_form_restriction

[24.2] Skip ``data_meta`` filter in run form
parents 1a2f9ab5 4f1509c0
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -190,6 +190,9 @@ class DataMetaFilter(Filter):

    def filter_options(self, options: Sequence[ParameterOption], trans, other_values):
        options = list(options)
        if trans.workflow_building_mode is workflow_building_modes.USE_HISTORY:
            # We're in the run form, can't possibly apply a data_meta filter.
            return options

        def _add_meta(meta_value, m):
            if isinstance(m, list):
+21 −0
Original line number Diff line number Diff line
@@ -6841,6 +6841,27 @@ steps:
            hda2 = self.dataset_populator.get_history_dataset_details(history_id, hid=2)
            assert hda2["validated_state"] == "invalid"

    @skip_without_tool("dbkey_filter_input")
    def test_value_restriction_with_data_meta_filter(self):
        workflow_id = self.workflow_populator.upload_yaml_workflow(
            """
class: GalaxyWorkflow
inputs:
  select_text:
     type: text
     restrictOnConnections: true
steps:
  select:
    tool_id: dbkey_filter_input
    in:
      index: select_text
"""
        )
        with self.dataset_populator.test_history() as history_id:
            run_workflow = self._download_workflow(workflow_id, style="run", history_id=history_id)
        options = run_workflow["steps"][0]["inputs"][0]["options"]
        assert len(options) >= 1

    def test_value_restriction_with_select_and_text_param(self):
        workflow_id = self.workflow_populator.upload_yaml_workflow(
            """