Skip to content

Conversation

@Fingel
Copy link
Contributor

@Fingel Fingel commented Nov 20, 2025

This is how this flow works:

User is at the TOM:

  1. The facility class constructs a URL that points to the OCS. This URL contains query parameters that correspond to the chosen Target's attributes.
  2. The facility class also constructs a callback url, which points to the internal tom_observations:callback view. This callback url contains query parameters for the facility class name, the target id, but leaves the observation id blank (this is to be provided by the observation portal)
  3. The facility class simply presents a the combined link to the OCS (with the callback url appended as a query parameter). User clicks on the link to the OCS.

Now at the OCS:

  1. The OCS presents the observation create form, and pre-fills in the target fields based on the query params.
  2. The user submits the observation.
  3. Instead of doing whatever the OCS does, it redirects to the callback url created in the previous step 2 with the newly created observation_id appended.

Now back at the TOM:

  1. The callback url creates an ObservationRecord object from the query parameters passed in from the OCS: target_id, facility, and observation_id.
  2. The user is sent to the ObservationRecord detail view of the newly created observation record. There is no distinction between records created using the built in OCS form or those created via the redirect flow.

@Fingel Fingel linked an issue Nov 20, 2025 that may be closed by this pull request
@jchate6 jchate6 moved this to Needs Review in TOM Toolkit Nov 20, 2025
@jchate6 jchate6 requested a review from rachel3834 November 21, 2025 18:45
@jchate6
Copy link
Contributor

jchate6 commented Dec 1, 2025

@Fingel is there a branch of the OCS that this relies on to work?

The redirection to the OCS looks good, but I'm guessing this relies on OCS changes to be fully functional. It would be nice to have something running locally before merging this.

@Fingel
Copy link
Contributor Author

Fingel commented Dec 3, 2025

OCS PR here: LCOGT/observation-portal-frontend#130

@jchate6
Copy link
Contributor

jchate6 commented Dec 4, 2025

Screencast-2025-12-03-13_02.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs Review

Development

Successfully merging this pull request may close these issues.

Integrate LCO observing portal into the TOMToolkit workflow

3 participants