-
Notifications
You must be signed in to change notification settings - Fork 356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Call miqCheckForChanges
before changing tabs.
#6431
Call miqCheckForChanges
before changing tabs.
#6431
Conversation
miqObserveRequest(url + urlParams, {beforeSend: true}) | ||
.catch(function (err) { | ||
add_flash(__('Error requesting data from server'), 'error'); | ||
console.log(err); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest to replace this console.log
with console.error
or console.warn
cc @himdel
What happens in forms with tabs? |
@himdel good point, trying that now |
miqCheckForChanges
before changing tabs.miqCheckForChanges
before changing tabs.
This will force user to save any unsaved changes in the form before changing the tab. Issue ManageIQ#6213
e11a7df
to
6b3f64d
Compare
Tweaked changes from previous commit to avoid abandon changes prompt when switching between tabs within the form(for the tabs that tabs are part of form) Issue ManageIQ#6213
9b5b12e
to
0feea60
Compare
Checked commits h-kataria/manageiq-ui-classic@6b3f64d~...b47aa19 with ruby 2.5.5, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0 |
@himdel fixed code to address tab change in the two forms with tabs that send transaction upto the server when tabs are switched. Ready to test/review. |
miqCheckForChanges
before changing tabs.miqCheckForChanges
before changing tabs.
LGTM, tested in server settings (each tab is its own form, checks when switching & unsaved), 👍 :) |
This will force user to save any unsaved changes in the form before changing the tab.
Issue #6213
Prompts user if they want to abandon changes after they have made changes to the form and trying to change the tabs in Configuration explorer. Tested this on several screens in OPS explorer, tried several other screens with tabs, seems to be working fine now. @hstastna please test