Skip to content
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

Merged

Conversation

h-kataria
Copy link
Contributor

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

miqObserveRequest(url + urlParams, {beforeSend: true})
.catch(function (err) {
add_flash(__('Error requesting data from server'), 'error');
console.log(err);
Copy link
Member

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

@himdel
Copy link
Contributor

himdel commented Nov 20, 2019

What happens in forms with tabs?

@h-kataria
Copy link
Contributor Author

@himdel good point, trying that now

@h-kataria h-kataria added the wip label Nov 20, 2019
@h-kataria h-kataria changed the title Call miqCheckForChanges before changing tabs. [WIP] Call miqCheckForChanges before changing tabs. Nov 20, 2019
This will force user to save any unsaved changes in the form before changing the tab.

Issue ManageIQ#6213
@h-kataria h-kataria force-pushed the abandon_changes_prompt_in_forms_with_tabs branch from e11a7df to 6b3f64d Compare November 20, 2019 16:39
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
@h-kataria h-kataria force-pushed the abandon_changes_prompt_in_forms_with_tabs branch from 9b5b12e to 0feea60 Compare November 20, 2019 17:12
@miq-bot
Copy link
Member

miq-bot commented Nov 20, 2019

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
0 files checked, 0 offenses detected
Everything looks fine. 👍

@h-kataria
Copy link
Contributor Author

@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.

@h-kataria h-kataria changed the title [WIP] Call miqCheckForChanges before changing tabs. Call miqCheckForChanges before changing tabs. Nov 20, 2019
@h-kataria h-kataria removed the wip label Nov 20, 2019
@himdel
Copy link
Contributor

himdel commented Nov 21, 2019

LGTM,

tested in server settings (each tab is its own form, checks when switching & unsaved),
in report editor (one multi-tab form, never checks when switching),

👍 :)

@himdel himdel merged commit c78235c into ManageIQ:master Nov 21, 2019
@himdel himdel added this to the Sprint 125 Ending Nov 25, 2019 milestone Nov 21, 2019
@himdel himdel self-assigned this Nov 21, 2019
@h-kataria h-kataria deleted the abandon_changes_prompt_in_forms_with_tabs branch February 25, 2020 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants