From 2148311b81fe3b74300683d55c08867f10dfa42a Mon Sep 17 00:00:00 2001 From: David Butenhof Date: Fri, 11 Oct 2024 15:40:00 -0400 Subject: [PATCH] Support for per-iteration parameters. (And `/api/v1/ilab/runs` reports iterations in numerical order.) --- backend/app/services/crucible_svc.py | 1 + .../src/components/templates/ILab/index.jsx | 54 +++++++++++++++---- 2 files changed, 44 insertions(+), 11 deletions(-) diff --git a/backend/app/services/crucible_svc.py b/backend/app/services/crucible_svc.py index f509830..a50632b 100644 --- a/backend/app/services/crucible_svc.py +++ b/backend/app/services/crucible_svc.py @@ -1158,6 +1158,7 @@ def get_runs( "params": iparams, } ) + run["iterations"].sort(key=lambda i: i["iteration"]) run["params"] = common.render() try: run["begin_date"] = self._format_timestamp(run["begin"]) diff --git a/frontend/src/components/templates/ILab/index.jsx b/frontend/src/components/templates/ILab/index.jsx index 7949eb1..3502535 100644 --- a/frontend/src/components/templates/ILab/index.jsx +++ b/frontend/src/components/templates/ILab/index.jsx @@ -220,19 +220,51 @@ const ILab = () => { - {item?.iterations && - item.iterations.forEach((i) => { - i?.params && ( - - ); - })} + {item.iterations.length > 1 && ( +
+ + + { + onToggle("bordered-toggle3"); + }} + isExpanded={expanded.includes( + "bordered-toggle3" + )} + id="bordered-toggle3" + > + {`Unique parameters for ${item.iterations.length} Iterations`} + + + {item.iterations.map((i) => ( + !(i[0] in item.params) + )} + /> + ))} + + + +
+ )}