Bug 1460142

Summary: [trello aeh71wF7] The 'Cancel' button of the 'unsaved' prompt dosen't work on the environment edit page
Product: OpenShift Container Platform Reporter: shahan <hasha>
Component: Management ConsoleAssignee: Samuel Padgett <spadgett>
Status: CLOSED CURRENTRELEASE QA Contact: XiaochuanWang <xiaocwan>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.6.0CC: aos-bugs, jforrest, jokerman, mmccomas
Target Milestone: ---   
Target Release: ---   
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: 2017-08-14 18:29:47 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 shahan 2017-06-09 08:44:53 UTC
Description of problem:
After fill in some parameters on resources through Deploy Image, click other tab(Browse Catalog/Import YAML/JSON), will appear the 'unsaved' prompt. When click 'Cancel' button, will unexpectedly navigate away.

Version-Release number of selected component (if applicable):
OpenShift Master:v3.6.99
Kubernetes Master:v1.6.1+5115d708d7 

How reproducible:
Always

Steps to Reproduce:
1.Login in web console,create new project
2.Click 'Add to Project'-> 'Deploy Image', select 'Image Stream Tag '
3.fill in openshift/php:latest, update application name to php1
4.click Browse Catalog / Import YAML/JSON tab,will have the the 'unsaved' prompt
5.Click 'Cancel' on the dialog.

Actual results:
5. Will unexpectedly navigate away.

Expected results:
5. Should cancel the navigate away operation and stay on the current page 

Additional info:
1) The "Import YAML/JSON" tab has the same issue. When both Import YAML/JSON and  Deploy Image have unsaved changes, trying to enter 'Browse Catalog' tab,the "unsaved" prompt will show two times.
2) Noticed the changes still exist after unexpectedlly navigate away,so I thought this place no need to create the additional "unsaved" prompt.

Comment 1 shahan 2017-06-09 10:26:27 UTC
The free-int cluster has same issue
Version:
OpenShift Master: v3.6.100 (online version 3.5.0.20)
Kubernetes Master: v1.6.1+5115d708d7

Comment 2 openshift-github-bot 2017-06-09 20:43:25 UTC
Commit pushed to master at https://github.com/openshift/origin-web-console

https://github.com/openshift/origin-web-console/commit/0ae3bbfea6ba6c407afd390c809c4f5320289935
Bug 1460142 - Only use confirm-on-exit on some forms

Use confirm-on-exit only on forms where the left navigation is visible or
where you might have typed a lot of content, such as Edit YAML.

Comment 3 shahan 2017-06-16 04:42:30 UTC
Per https://bugzilla.redhat.com/show_bug.cgi?id=1460122#c3,I checked this issues on the edit environment variables page (like Environment tab of deployment page),still hit this problem.

Version(PR #1671 has merged into this version)
OpenShift Master: v3.6.109

Steps to Reproduce:
1.Login in web console, create new project and php app.
2.Enter 'Application'->'Deployment'->'php',click 'Environment' tab
3.Fill in some parameters
4.Try to navigate other tab, such as 'Configuration'/'History'
5.Click 'Cancel' on the dialog.

Actual results:
5. Will unexpectedly navigate away.

Expected results:
5. Should cancel the navigate away operation and stay on the current page

Comment 4 Samuel Padgett 2017-06-16 12:25:31 UTC
We didn't mean to prompt when switching tabs since that doesn't lose your edits. You might need to look at something on another tab to know what environment variables to set. You should now only be prompted when leaving the page entirely.

Fixed by https://github.com/openshift/origin-web-console/pull/1726

Comment 5 openshift-github-bot 2017-06-16 13:13:46 UTC
Commit pushed to master at https://github.com/openshift/origin-web-console

https://github.com/openshift/origin-web-console/commit/910e642c0f8abdbe140b24ac7d3b7078fedf3dbe
Bug 1460142 - Use $routeChangeStart for confirm-on-exit

Listen for `$routeChangeStart` instead of `$locationChangeStart` in the
`confirm-on-exit` directive. This prevents us from incorrectly prompting
when the user switches tabs with `persist-tab-state` on.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1460142

Comment 6 shahan 2017-06-21 06:49:38 UTC
Checked this issue on openshift v3.6.121, the bug was fixed. Please change bug status to ON_QA, thanks!