Bug 1797652 - Service has "Edit" action that results in runtime error when clicked
Summary: Service has "Edit" action that results in runtime error when clicked
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Dev Console
Version: 4.4
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 4.4.0
Assignee: Jeff Phillips
QA Contact: Gajanan More
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-02-03 14:59 UTC by Samuel Padgett
Modified: 2020-05-13 21:58 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:72.0) Gecko/20100101 Firefox/72.0
Last Closed: 2020-05-13 21:58:37 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
There is no "Edit" option in the drop down menu and clicking on any option doesn't redirect to blank screen. (132.65 KB, image/png)
2020-02-18 08:11 UTC, Gajanan More
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github openshift console pull 4207 0 None closed Bug 1797652: Fix crash on Edit of applications 2020-05-07 13:10:50 UTC
Red Hat Product Errata RHBA-2020:0581 0 None None None 2020-05-13 21:58:38 UTC

Description Samuel Padgett 2020-02-03 14:59:01 UTC
The Service resource has an "Edit" action. This label is probably too generic since there is already an "Edit Service" action. It's unclear what I'm editing.

When I click it, I get a white screen with the stack trace below in the JS console. This could be related to Bug 1796150, although I still see the problem running with fix https://github.com/openshift/console/pull/4150

TypeError: "resource is undefined"
    getResourcesType edit-application-utils.ts:17
    getRouteData edit-application-utils.ts:79
    getCommonInitialValues edit-application-utils.ts:220
    getInitialValues edit-application-utils.ts:355
    EditApplication EditApplication.tsx:38
    React 17
    Redux 7
    incrementallyLoad k8s.ts:177
    incrementallyLoad k8s.ts:177
    step main-ef15355c581bef01c346.js:20356
    verb main-ef15355c581bef01c346.js:20337
    fulfilled main-ef15355c581bef01c346.js:20328

Comment 1 Samuel Padgett 2020-02-03 14:59:53 UTC
This is a standard k8s Service resource.

Comment 3 Serena 2020-02-03 23:24:45 UTC
Sam, we took the approach to have a generic "EDIT" which would bring you back through the "ADD" flow, assuming that's how it was created.

We left the "EDIT <kind>" menu item alone so that will always bring you to the YAML Editor.

The only other think I can imagine would be to change "EDIT <kind>" to Edit YAML and then have the Edit be the menu item for the form (associated with the Add flow).

Thoughts?

Comment 4 Samuel Padgett 2020-02-03 23:45:05 UTC
The approach we've taken in other places like secrets is to make the `Edit ${kind}` link take you to a form editor -- when we have a form -- then add an `Edit YAML` link in the upper right of the form if you want to get to the YAML. That way there's only one edit action. What do you think?

I assume this action should only show up when you created the resource through the `Add` flow? (I believe this was the console service, so it wasn't created that way.)

Comment 5 Samuel Padgett 2020-02-03 23:47:39 UTC
I guess the difference here is that you're not editing a single resource, but the entire application? Maybe `Edit Application`? Or `Edit Application my-app`?

Comment 6 Serena 2020-02-04 13:30:09 UTC
Hey Sam, Can you point me to a place where you are doing that?  I think that's an awesome approach, but didn't see that was a current convention! "The approach we've taken in other places like secrets is to make the `Edit ${kind}` link take you to a form editor -- when we have a form -- then add an `Edit YAML` link in the upper right of the form if you want to get to the YAML. That way there's only one edit action. What do you think?"

And yes, this would only occur if creation was via the Add flow.

Edit App doesn't work, because there's actually an Application Grouping which makes it more confusing

Comment 7 Samuel Padgett 2020-02-04 14:08:38 UTC
I'm mistaken. I thought we did it for secrets, but we didn't add the "Edit YAML" link. "Edit Secret" just takes you to the form with no "Edit YAML" action.

We do it for some creation forms like create route, which takes you to a form, but has an "Edit YAML" link. I think it would work well for the edit case, too, and would be easy to add to the secret form. Let us know what you think.

Comment 8 Serena 2020-02-05 13:31:56 UTC
After a bunch of slack discussions, the suggestion is to use "Edit ${resource-name}", right under the Edit Application Grouping menu item.  The resource-name should be truncated in the middle, and the max length should be 20.

Comment 9 cvogt 2020-02-05 19:52:32 UTC
I see a long discussion about menu labels. But this bug is showing a new `Edit` action on a k8s `Service` that is throwing an error. I do not believe that there should be such an action here and the fix should remove this action from the k8s `Service` resources.

Comment 11 Gajanan More 2020-02-18 08:11:05 UTC
I have validated this bug on
Build: 4.4.0-0.nightly-2020-02-18-
Browser: Google Chrome Version 78.0.3904.108
Please have a look at the shared screenshot.

Comment 12 Gajanan More 2020-02-18 08:11:58 UTC
Created attachment 1663668 [details]
There is no "Edit" option in the drop down menu and clicking on any option doesn't redirect to blank screen.

Comment 14 errata-xmlrpc 2020-05-13 21:58:37 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, 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/RHBA-2020:0581


Note You need to log in before you can comment on or make changes to this bug.