Skip to content

Commit

Permalink
Merge pull request #1399 from gemini-hlsw/filter-by-generated-step-id
Browse files Browse the repository at this point in the history
Show execution status tags in completed steps
  • Loading branch information
rpiaggio authored Dec 23, 2024
2 parents 0da86c0 + a919644 commit 149711f
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 2 deletions.
12 changes: 11 additions & 1 deletion modules/ui/src/main/resources/lucuma-css/lucuma-ui-sequence.scss
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,20 @@ table tr {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
padding-left: 5%;

.lucuma-sequence-visit-extraRow-datetime {
width: 20%;
width: 10%;
}

.lucuma-sequence-visit-extraRow-status {
width: 10%;

.p-tag {
padding-top: 0;
padding-bottom: 0;
}
}

.lucuma-sequence-visit-extraRow-datasets {
Expand Down
10 changes: 9 additions & 1 deletion modules/ui/src/main/scala/lucuma/ui/sequence/SequenceRow.scala
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,15 @@ object SequenceRow:
val instrumentConfig = stepRecord.instrumentConfig.some
val stepConfig = stepRecord.stepConfig.some
val telescopeConfig = stepRecord.telescopeConfig.some
export stepRecord.{created, datasets, id => stepId, interval, qaState}
export stepRecord.{
created,
datasets,
executionState,
generatedId,
id => stepId,
interval,
qaState
}

object ExecutedStep:
given [D]: Eq[ExecutedStep[D]] = Eq.by(_.id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ trait SequenceRowBuilder[D]:
.map(_.start.toInstant)
.fold("---")(start => UtcFormatter.format(start))
),
<.span(SequenceStyles.VisitStepExtraStatus)(
step.executionState.renderVdom
),
<.span(SequenceStyles.VisitStepExtraDatasets)(
step.datasets
.map: dataset =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ object SequenceStyles:
val VisitHeader = Css("lucuma-sequence-visit-header")
val VisitStepExtra = Css("lucuma-sequence-visit-extraRow")
val VisitStepExtraDatetime = Css("lucuma-sequence-visit-extraRow-datetime")
val VisitStepExtraStatus = Css("lucuma-sequence-visit-extraRow-status")
val VisitStepExtraDatasets = Css("lucuma-sequence-visit-extraRow-datasets")
val VisitStepExtraDatasetItem = Css("lucuma-sequence-visit-extraRow-dataset-item")
val VisitStepExtraDatasetQAStatus = Css("lucuma-sequence-visit-extraRow-dataset-qaStatus")
Expand Down
17 changes: 17 additions & 0 deletions modules/ui/src/main/scala/lucuma/ui/sequence/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ import lucuma.core.model.sequence.gmos.DynamicConfig
import lucuma.core.util.NewType
import lucuma.react.SizePx
import lucuma.react.common.*
import lucuma.react.primereact.Tag
import lucuma.react.primereact.Tooltip
import lucuma.react.primereact.tooltip.*
import lucuma.react.syntax.*
import lucuma.schemas.model.enums.StepExecutionState
import lucuma.ui.LucumaIcons
import lucuma.ui.LucumaStyles
import lucuma.ui.utils.*
Expand Down Expand Up @@ -53,6 +55,21 @@ given Render[Option[DatasetQaState]] = Render.by: qaState =>
case Some(DatasetQaState.Fail) => LucumaStyles.IndicatorFail
case None => LucumaStyles.IndicatorUnknown

given Render[StepExecutionState] = Render.by:
case StepExecutionState.NotStarted | StepExecutionState.Ongoing | StepExecutionState.Completed =>
EmptyVdom
case other @ (StepExecutionState.Aborted | StepExecutionState.Stopped |
StepExecutionState.Abandoned) =>
Tag(
other match
case StepExecutionState.Aborted => "Aborted"
case StepExecutionState.Stopped => "Stopped Early"
case StepExecutionState.Abandoned => "Abandoned",
severity = other match
case StepExecutionState.Stopped => Tag.Severity.Info
case _ => Tag.Severity.Danger
)

extension [D, R <: SequenceRow[D]](list: List[R])
/* Zip list with `StepIndex` and return the indexed list and the next index */
def zipWithStepIndex(
Expand Down

0 comments on commit 149711f

Please sign in to comment.