Skip to content

Commit

Permalink
Hide unavailable states in ObsBadge dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
toddburnside committed Nov 4, 2024
1 parent 5cae632 commit 889369c
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions explore/src/main/scala/explore/observationtree/ObsBadge.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 889369c

Please sign in to comment.