Skip to content

Commit fb1829a

Browse files
authored
Fix button enabling (#74)
Enable copy button when any row selected Enable cancel in jobs table when there is a pipeline
1 parent 00b6dfb commit fb1829a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

aurora_cycler_manager/visualiser/db_view.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ def cleanup_temp_folder() -> None:
172172
"protocol-container",
173173
]
174174
BUTTONS = [
175+
"copy-button",
175176
"load-button",
176177
"eject-button",
177178
"submit-button",
@@ -193,6 +194,7 @@ def cleanup_temp_folder() -> None:
193194
},
194195
"pipelines": {
195196
"table-container",
197+
"copy-button",
196198
"load-button",
197199
"eject-button",
198200
"submit-button",
@@ -206,12 +208,14 @@ def cleanup_temp_folder() -> None:
206208
},
207209
"jobs": {
208210
"table-container",
211+
"copy-button",
209212
"cancel-button",
210213
"snapshot-button",
211214
"upload-button",
212215
},
213216
"results": {
214217
"table-container",
218+
"copy-button",
215219
"view-button",
216220
"label-button",
217221
"create-batch-button",
@@ -220,6 +224,7 @@ def cleanup_temp_folder() -> None:
220224
},
221225
"samples": {
222226
"table-container",
227+
"copy-button",
223228
"view-button",
224229
"batch-button",
225230
"delete-button",
@@ -863,7 +868,7 @@ def enable_buttons(selected_rows: list, table: str) -> tuple[bool, ...]:
863868
elif table == "jobs":
864869
if all(s.get("Server label") in accessible_servers for s in selected_rows):
865870
enabled |= {"snapshot-button"}
866-
if all(s.get("Status") in ["r", "q", "qw"] for s in selected_rows):
871+
if all(s.get("Job ID") for s in selected_rows):
867872
enabled |= {"cancel-button"}
868873
elif table == "results" and all(s.get("Sample ID") is not None for s in selected_rows):
869874
enabled |= {"label-button", "create-batch-button"}

0 commit comments

Comments
 (0)