From 889369ca412ea1a882534065bccd23f21bdeae24 Mon Sep 17 00:00:00 2001 From: Todd Burnside Date: Mon, 4 Nov 2024 14:53:14 -0800 Subject: [PATCH] Hide unavailable states in ObsBadge dropdown --- .../explore/observationtree/ObsBadge.scala | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/explore/src/main/scala/explore/observationtree/ObsBadge.scala b/explore/src/main/scala/explore/observationtree/ObsBadge.scala index c7dae8f84..fd4cb26f5 100644 --- a/explore/src/main/scala/explore/observationtree/ObsBadge.scala +++ b/explore/src/main/scala/explore/observationtree/ObsBadge.scala @@ -176,11 +176,16 @@ object ObsBadge: renderEnumProgress(obs.workflow.state) ) - val validationTooltip = <.div( - obs.workflow.validationErrors - .toTagMod(ov => <.div(ov.code.name, <.ul(ov.messages.toList.toTagMod(<.li(_))))) - ) - val validationIcon = Tooltip.Fragment(content = validationTooltip)(<.span(Icons.ErrorIcon)) + val validationTooltip = + if (obs.hasConfigurationRequestError) + <.span(obs.workflow.validationErrors.head.messages.head) + else + <.div( + obs.workflow.validationErrors + .toTagMod(ov => <.div(ov.code.name, <.ul(ov.messages.toList.toTagMod(<.li(_))))) + ) + + val validationIcon = Tooltip.Fragment(content = validationTooltip)(<.span(Icons.ErrorIcon)) React.Fragment( <.div( @@ -213,7 +218,7 @@ object ObsBadge: clazz = ExploreStyles.ObsStateSelect, panelClass = ExploreStyles.ObsStateSelectPanel, disabled = props.isDisabled, - disabledItems = obs.disabledStates + exclude = obs.disabledStates ) )( // don't select the observation when changing the status