Bug 1952545

Summary: Selection issue when inserting YAML snippets
Product: OpenShift Container Platform Reporter: Christoph Jerolimov <cjerolim>
Component: Dev ConsoleAssignee: Christoph Jerolimov <cjerolim>
Status: CLOSED ERRATA QA Contact: Mohammed Saud <msaud>
Severity: low Docs Contact: Srivaralakshmi Ramani <srr>
Priority: low    
Version: 4.8CC: aos-bugs, hmishra, msaud, nmukherj
Target Milestone: ---Flags: srr: needinfo-
Target Release: 4.8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Previously, when users inserted a formatted *YAML* snippet in the *YAML* editor, the new selection did not match the new content in the snippet. The indentation was removed, and some random letters were seen in the selection. The current release fixes this issue. Now, the cursor remains in the position where it started and adds the missing indentation for the cursor end position. After inserting the *YAML* snippet, the new selection matches the new content. (link:https://bugzilla.redhat.com/show_bug.cgi?id=1952545[*BZ#1952545*])
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-07-27 23:02:56 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:

Description Christoph Jerolimov 2021-04-22 14:18:23 UTC
Clone of https://issues.redhat.com/browse/ODC-5777

Description of problem:
When the user inserts a YAML snippet the new snippet is tried to be selected but the selection doesn't match the new snippet.

Prerequisites (if any, like setup, operators/versions):
No additional prerequisites required

Steps to Reproduce
1. Open search
2. Search for resource Console, apiVersion operator.openshift.io/v1, select it
3. Select resource "cluster" and open the YAML tab (direct link: https://cluster/k8s/cluster/operator.openshift.io~v1~Console/cluster/yaml)
4. Open the sidebar and switch to the "Snippets" tab
5. Insert the available snippets at different intention levels

Actual results:
1. Selection after inserting the YAML snippet doesn't match the new content.
2. Multiple insertions change the YAML snippet and break the input.

Expected results:
1. Selection after inserting the YAML snippet should match the new content.
2. Multiple insertions should not change the YAML.

Reproducibility (Always/Intermittent/Only Once):
Always

Build Details:
OpenShift Console 4.7 or console master (tested with commit 2426fa124e8a7d59e80846c84ab69a6d6e2a0e9b)

Additional info:
None

Comment 2 Mohammed Saud 2021-04-30 12:25:52 UTC
Verified on:
Build: 4.8.0-0.nightly-2021-04-29-222100
Browser: Firefox 88

Comment 3 Srivaralakshmi Ramani 2021-06-03 14:12:51 UTC
Updated the Doc text field.

Comment 5 Srivaralakshmi Ramani 2021-06-09 12:18:55 UTC
Thanks Christoph for the LGTM.

Comment 8 errata-xmlrpc 2021-07-27 23:02:56 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 (Moderate: OpenShift Container Platform 4.8.2 bug fix and security update), 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-2021:2438