|
1 | 1 | from __future__ import annotations |
2 | 2 |
|
3 | 3 | import copy |
4 | | -from html import escape as html_escape |
5 | 4 |
|
6 | 5 | from bloom_lims.bobjs import BloomObj |
7 | 6 |
|
8 | 7 |
|
9 | | -def _build_assay_selection_options(_bobdb: BloomObj) -> list[dict]: |
10 | | - """Workflow-backed assay selection is retired in queue-centric Bloom beta.""" |
11 | | - return [] |
12 | | - |
13 | | - |
14 | 8 | def _normalize_action_slug(action_data: dict) -> str: |
15 | 9 | method_name = str(action_data.get("method_name") or "").strip() |
16 | 10 | if method_name.startswith("do_action_"): |
@@ -66,27 +60,13 @@ def _default_ui_fields_for_action(action_data: dict) -> list[dict]: |
66 | 60 | return [] |
67 | 61 |
|
68 | 62 |
|
69 | | -def _build_assay_selection_html(options: list[dict]) -> str: |
70 | | - rendered_options = [] |
71 | | - for option in options: |
72 | | - option_value = html_escape(str(option.get("value", "")), quote=True) |
73 | | - option_label = html_escape(str(option.get("label", ""))) |
74 | | - rendered_options.append(f'<option value="{option_value}">{option_label}</option>') |
75 | | - |
76 | | - if not rendered_options: |
77 | | - rendered_options.append('<option value="" disabled selected>No assay workflows available</option>') |
78 | | - |
79 | | - return '<select name="assay_selection" required>' + "".join(rendered_options) + "</select>" |
80 | | - |
81 | | - |
82 | 63 | def hydrate_dynamic_action_groups(action_groups: dict, bobdb: BloomObj) -> dict: |
83 | | - """Hydrate dynamic UI bits inside action groups (assay dropdown, etc).""" |
| 64 | + """Hydrate dynamic UI bits for active action surfaces only.""" |
| 65 | + del bobdb # Legacy assay/workflow hydration is retired. |
84 | 66 | if not isinstance(action_groups, dict): |
85 | 67 | return {} |
86 | 68 |
|
87 | 69 | hydrated = copy.deepcopy(action_groups) |
88 | | - assay_selection_options = None |
89 | | - assay_selection_html = None |
90 | 70 |
|
91 | 71 | for group_data in hydrated.values(): |
92 | 72 | if not isinstance(group_data, dict): |
@@ -117,23 +97,14 @@ def hydrate_dynamic_action_groups(action_groups: dict, bobdb: BloomObj) -> dict: |
117 | 97 | ui_schema["fields"] = copy.deepcopy(default_fields) |
118 | 98 | fields = ui_schema["fields"] |
119 | 99 |
|
120 | | - if isinstance(captured, dict) and "___workflow/assay/" in captured: |
121 | | - if assay_selection_options is None: |
122 | | - assay_selection_options = _build_assay_selection_options(bobdb) |
123 | | - if assay_selection_html is None: |
124 | | - assay_selection_html = _build_assay_selection_html(assay_selection_options) |
125 | | - captured["___workflow/assay/"] = assay_selection_html |
126 | | - |
127 | | - for field in fields: |
128 | | - if not isinstance(field, dict): |
129 | | - continue |
130 | | - if field.get("options_source") == "workflow_assays": |
131 | | - if assay_selection_options is None: |
132 | | - assay_selection_options = _build_assay_selection_options(bobdb) |
133 | | - if assay_selection_html is None: |
134 | | - assay_selection_html = _build_assay_selection_html(assay_selection_options) |
135 | | - field["options"] = copy.deepcopy(assay_selection_options) |
136 | | - if field.get("name") == "assay_selection": |
137 | | - captured.setdefault("___workflow/assay/", assay_selection_html) |
| 100 | + # Hard-cut: remove retired assay/workflow-assay capture/UI selectors. |
| 101 | + captured.pop("___workflow/assay/", None) |
| 102 | + ui_schema["fields"] = [ |
| 103 | + field |
| 104 | + for field in fields |
| 105 | + if isinstance(field, dict) |
| 106 | + and field.get("options_source") != "workflow_assays" |
| 107 | + and field.get("name") != "assay_selection" |
| 108 | + ] |
138 | 109 |
|
139 | 110 | return hydrated |
0 commit comments