Bug 1789434

Summary: Template editor not always allows refreshing of the preview pane
Product: Red Hat Satellite Reporter: Radovan Drazny <rdrazny>
Component: Provisioning TemplatesAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Roman Plevka <rplevka>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.7.0CC: asharvit, egolov, mhulan, oprazak
Target Milestone: 6.8.0Keywords: Triaged, UserExperience
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: foreman-2.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-10-27 12:59:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Video of the issue none

Description Radovan Drazny 2020-01-09 15:06:57 UTC
Created attachment 1650985 [details]
Video of the issue

Description of problem:
When you edit a template using the new integrated template editor, is is possible to get into a situation when the preview is not refreshed automatically, and the refresh button is not displayed. 

Version-Release number of selected component (if applicable):
Sat 6.7 Snap 7

How reproducible:
always

Steps to Reproduce:
1. Have a few managed hosts registered to a Sat 6.7 server
2. Go to Hosts->Provisioning templates page and create a clone of a template. I have used the "Kickstart default" template.
3. Check that template can be correctly previewed. You need a managed registered host for this.
4. Make the template invalid and unrenderable. The easiest way to achieve this is to make a typo in the name of a snippet to be included in the template. I have modified the line 245 of the template, adding an extra 's' to the 'remote_execution_ssh_keys' snipet name.
5. The change correctly activates the "Change" pane of the editor.
6. Go to the "Preview" pane of the editor. Use the "Preview is Outdated..." button if necessary. You will get an error, as the template cannot be rendered at the current state. Do not close the error widget.
7. Go back to the editor pane, and fix the typo (remove the extra "s"). The "Changes" pane will be correctly disabled, as there is no change in the template now. You can close the error widget now.
8. Go to the "Preview" pane. There is still a message "Error during rendering, Return to Editor tab." in the preview area, even if the template is already fixed. There is no "Preview is Outdated..." button to refresh the preview, and you are not going to get any preview.


Actual results:
Preview is not available, even if the template is correct and renderable


Expected results:
If the template is correct, a preview is always available, or at least the "Preview is Outdated..." button is available to do a manual refresh. 

Additional info:
To get out of this you can switch to a different host to force a preview refresh, or you can go back into the Editor pane and do some more changes. That is usually enough to get the "Preview is Outdated..." button displayed.
See the attached screen recording for a demo of the issue.

Comment 3 Bryan Kearney 2020-01-19 15:01:34 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/28731 has been resolved.

Comment 5 Roman Plevka 2020-07-16 09:35:26 UTC
VERIFIED
on sat6.8.0-9.0
the "preview is outdated" label is now correctly shown on reverting the change so it is possible to refresh the preview.

Comment 8 errata-xmlrpc 2020-10-27 12:59:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: Satellite 6.8 release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:4366