diff --git a/src/aind_qc_portal/panel/metric.py b/src/aind_qc_portal/panel/metric.py index 0610a9c..08dbd75 100644 --- a/src/aind_qc_portal/panel/metric.py +++ b/src/aind_qc_portal/panel/metric.py @@ -131,8 +131,13 @@ def metric_panel(self): for v in value.values() ] ): + auto_value = True df = pd.DataFrame(value) value_widget = pn.pane.DataFrame(df) + elif all([isinstance(v, str) or isinstance(v, int) or isinstance(v, float) for v in value.values()]): + auto_value = True + df = pd.DataFrame([value]) + value_widget = pn.pane.DataFrame(df) else: try: custom_value = CustomMetricValue( @@ -159,10 +164,14 @@ def metric_panel(self): options=["Pass", "Fail", "Pending"], name="Metric status", ) - if auto_state: + + if pn.state.user == "guest": self.state_selector.disabled = True else: - self.state_selector.param.watch(self.set_status, "value") + if auto_state: + self.state_selector.disabled = True + else: + self.state_selector.param.watch(self.set_status, "value") header = pn.pane.Markdown(md)