Bug 2015472

Summary: Form and YAML view switch button should have distinguishable status
Product: OpenShift Container Platform Reporter: Yadan Pei <yapei>
Component: Management ConsoleAssignee: mmensahs <mmensahs>
Status: CLOSED ERRATA QA Contact: Yadan Pei <yapei>
Severity: low Docs Contact:
Priority: unspecified    
Version: 4.10CC: aos-bugs, jhadvig, yapei
Target Milestone: ---Keywords: Reopened
Target Release: 4.10.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-03-10 16:20:14 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 Yadan Pei 2021-10-19 10:00:34 UTC
Description of problem:
hard to differentiate the switch status of 'Form view' and 'YAML view' button on operand creation page

Version-Release number of selected component (if applicable):
4.10.0-0.nightly-2021-10-16-173656

How reproducible:
Always

Steps to Reproduce:
1. Check the switch status of 'Form view' and 'YAML view' on operand creation page
2.
3.

Actual results:
No matter which view is selected, the Xpath expression $x("//input[@data-test='YAML view-radio-input' and @checked]") always return true since the 'checked' property doesn't reveal the real status  
<input type="radio" data-test="Form view-radio-input" value="form">
<input type="radio" data-test="YAML view-radio-input" value="yaml" checked="">

Expected results:
`checked` property should reveal the real status,  it should only be added when the input is checked and removed when the input is unchecked

Additional info:
https://github.com/openshift/console/blob/22c6951efe7c4bca87f3f934063b9f4dcb0a4058/frontend/packages/console-shared/src/components/synced-editor/editor-toggle.tsx#L11~L33

Comment 1 mmensahs 2021-11-30 14:02:23 UTC
Based on the Patternfly documentation for radio buttons and what is shown when the radio example is inspected in DevTools, this is working as intended.

Comment 2 mmensahs 2021-11-30 14:04:25 UTC
(In reply to mmensahs from comment #1)
> Based on the Patternfly documentation for radio buttons and what is shown
> when the radio example is inspected in DevTools, this is working as intended.

https://www.patternfly.org/v4/components/radio

Comment 3 Yadan Pei 2021-12-14 01:45:57 UTC
Hi mmensahs

Can we make `checked` property reveal its real status?

Comment 5 Yadan Pei 2021-12-20 06:59:44 UTC
Now we have `data-checked-state` attribute which can be used to distinguish which radio button is checked 

<input type="radio" data-test="Form view-radio-input" data-checked-state="false" value="form" checked="">
<input type="radio" data-test="YAML view-radio-input" data-checked-state="true" value="yaml"> 



Verified on 4.10.0-0.nightly-2021-12-18-034942

Comment 10 errata-xmlrpc 2022-03-10 16:20:14 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.10.3 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-2022:0056