Skip to content
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

Fix job editor switches to the snapshot version when body is changed #2319

Merged
merged 2 commits into from
Jul 22, 2024

Conversation

midigofrank
Copy link
Collaborator

Description

This PR fixes the bug on the inspector that switches the job editor back to the snapshot version whenever the user types anything in. You can check the issue #2306 for a video on this

Closes #2306
Closes #2308

Validation steps

In order to validate this, we'll need to have a workflow with at least one job in it.
We'll create a manual work order using the job as it is, then later update the job body to have something else.
This way, we'll have a work order with an older version of the job body.

These instructions assume you've done the the above

  1. Open up the inspector from the executed step of the work order in the history page
  2. The inspector will open up in "snapshot mode". Now toggle to switch to the latest version
  3. Notice that the job editor content gets updated to the latest job body.
  4. If you try changing the job body, the content gets updated and the editor doesn't switch back to the snapshot version

Pre-submission checklist

  • I have performed a self-review of my code.
  • I have implemented and tested all related authorization policies. (e.g., :owner, :admin, :editor, :viewer)
  • I have updated the changelog.

@midigofrank midigofrank self-assigned this Jul 22, 2024
Copy link

codecov bot commented Jul 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.72%. Comparing base (be6970f) to head (8946386).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2319      +/-   ##
==========================================
- Coverage   89.73%   89.72%   -0.01%     
==========================================
  Files         298      298              
  Lines       10039    10038       -1     
==========================================
- Hits         9008     9007       -1     
  Misses       1031     1031              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@midigofrank midigofrank marked this pull request as ready for review July 22, 2024 14:52
Copy link
Contributor

@elias-ba elias-ba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@midigofrank this is looking good to me, great job 👏. I left a comment but up to you to handle it or not.

@@ -78,6 +78,8 @@ defmodule LightningWeb.WorkflowLive.EditorPane do
{:noreply, socket}
end

# NOTE: This is dead code and should probably be removed. All events are
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should remove it in this work, what do you think ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't feel confident enough to remove it at this time. I was thinking of removing it as a follow-up when everything is tested and works fine

Copy link

@christad92 christad92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Loooooveeee eeeeeett!!

Thanks mate!

@taylordowns2000 taylordowns2000 merged commit c9027ff into main Jul 22, 2024
8 checks passed
@taylordowns2000 taylordowns2000 deleted the fix-inspector-qa branch July 22, 2024 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: New Issues
4 participants