-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent asterism updates for executed observations, add undo/redo #4056
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,12 +11,12 @@ import crystal.react.* | |
import explore.components.Tile | ||
import explore.components.ui.ExploreStyles | ||
import explore.config.ObsTimeEditor | ||
import explore.model.AsterismIds | ||
import explore.model.GlobalPreferences | ||
import explore.model.ObsConfiguration | ||
import explore.model.ObsIdSet | ||
import explore.model.ObsTabTilesIds | ||
import explore.model.ObservationsAndTargets | ||
import explore.model.OnAsterismUpdateParams | ||
import explore.model.OnCloneParameters | ||
import explore.model.TargetEditObsInfo | ||
import explore.model.enums.TileSizeState | ||
|
@@ -42,14 +42,14 @@ object AsterismEditorTile: | |
userId: Option[User.Id], | ||
programId: Program.Id, | ||
obsIds: ObsIdSet, | ||
asterismIds: View[AsterismIds], | ||
obsAndTargets: UndoSetter[ObservationsAndTargets], | ||
configuration: Option[BasicConfiguration], | ||
vizTime: View[Option[Instant]], | ||
obsConf: ObsConfiguration, | ||
currentTarget: Option[Target.Id], | ||
setTarget: (Option[Target.Id], SetRouteVia) => Callback, | ||
onCloneTarget: OnCloneParameters => Callback, | ||
onAsterismUpdate: OnAsterismUpdateParams => Callback, | ||
obsInfo: Target.Id => TargetEditObsInfo, | ||
searching: View[Set[Target.Id]], | ||
title: String, | ||
|
@@ -59,6 +59,7 @@ object AsterismEditorTile: | |
backButton: Option[VdomNode] = none | ||
)(using FetchClient[IO, ObservationDB], Logger[IO]): Tile = { | ||
// Save the time here. this works for the obs and target tabs | ||
// It's OK to save the viz time for executed observations, I think. | ||
val vizTimeView = | ||
vizTime.withOnMod(t => ObsQueries.updateVisualizationTime[IO](obsIds.toList, t).runAsync) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This needs an update I think There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, it looks like it is still called There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lazy cquiroz |
||
|
||
|
@@ -79,13 +80,13 @@ object AsterismEditorTile: | |
uid, | ||
programId, | ||
obsIds, | ||
asterismIds, | ||
obsAndTargets, | ||
vizTime, | ||
obsConf, | ||
currentTarget, | ||
setTarget, | ||
onCloneTarget, | ||
onAsterismUpdate, | ||
obsInfo, | ||
searching, | ||
renderInTitle, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this guaranteed to work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, we reduce the transit time involved, but they still aren't real close together. That timing depends on when the database updates happen for the 2 mutations, I guess. Still seemed better than doing them individually. 🤷♂️