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

[Dashboard] Remove modal for inter app from dashboard #198619

Merged
merged 19 commits into from
Nov 6, 2024

Conversation

rshen91
Copy link
Contributor

@rshen91 rshen91 commented Oct 31, 2024

Summary

Closes #184257
This PR removes the modal warning users that unsaved changes would be lost when navigating away from dashboard to other apps within Kibana. The modal is not necessary since unsaved changes are saved in session storage. The benefit is that this removes the unnecessary click for users.

This does not impact the modal for switching to view mode from edit mode with unsaved changes as shown below.

Nov-04-2024.09-36-49.mp4

Checklist

  • Update tests

@rshen91 rshen91 self-assigned this Oct 31, 2024
@rshen91 rshen91 added release_note:enhancement backport:all-open Backport to all branches that could still receive a release papercut Small "burr" in the product that we should fix. labels Nov 4, 2024
@rshen91 rshen91 marked this pull request as ready for review November 4, 2024 18:28
@rshen91 rshen91 requested review from a team as code owners November 4, 2024 18:28
@Heenawter Heenawter self-requested a review November 4, 2024 18:33
Comment on lines 409 to 413
if (
currentAppId === undefined ||
(currentAppId === 'dashboards' &&
(nextAppId === 'discover' || nextAppId === 'visualize' || nextAppId === 'lens'))
) {
Copy link
Contributor

@Heenawter Heenawter Nov 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is the best solution - having all of these hard-coded values seems... risky 🙈 Is there a reason you didn't implement this change via the app leave handler in src/plugins/dashboard/public/dashboard_top_nav/internal_dashboard_top_nav.tsx?

The attached issue was specifically meant to remove this behaviour from dashboard entirely, regardless of the destination app - so I think we should be able to keep the code changes local to the Dashboard plugin.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok - refactored in 841b2a8

Comment on lines 198 to 200
if (hasUnsavedChanges && !embeddableService.getStateTransfer().isTransferInProgress) {
return actions.skip();
} else if (
Copy link
Contributor

@Heenawter Heenawter Nov 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the skip action is also overkill. Can you come up with a situation where we ever hit the else if condition with this code?

@rshen91 rshen91 requested a review from a team as a code owner November 4, 2024 19:31
@rshen91 rshen91 removed request for a team November 4, 2024 19:39
@Heenawter Heenawter changed the title [Presentation] Disable modal for inter app from dashboard [Dashboard] Disable modal for inter app from dashboard Nov 4, 2024
@rshen91 rshen91 requested a review from Heenawter November 5, 2024 16:28
@rshen91 rshen91 added backport:prev-major Backport to (8.x, 8.17, 8.16) the previous major branch and other branches in development and removed backport:all-open Backport to all branches that could still receive a release labels Nov 6, 2024
Comment on lines -204 to -205
leaveConfirmStrings.getLeaveSubtitle(),
leaveConfirmStrings.getLeaveTitle()
Copy link
Contributor

@Heenawter Heenawter Nov 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like we aren't using leaveConfirmStrings anymore - do you mind deleting them + all i18n associated?

@elasticmachine
Copy link
Contributor

elasticmachine commented Nov 6, 2024

💔 Build Failed

Failed CI Steps

History

cc @rshen91

@rshen91 rshen91 requested a review from Heenawter November 6, 2024 20:11
Copy link
Contributor

@Heenawter Heenawter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review + quick local test. LGTM, thanks so much for making this change 🙇 It should hopefully make the navigation experience much better

@Heenawter Heenawter changed the title [Dashboard] Disable modal for inter app from dashboard [Dashboard] Remove modal for inter app from dashboard Nov 6, 2024
@rshen91 rshen91 enabled auto-merge (squash) November 6, 2024 20:41
@rshen91 rshen91 merged commit 4f14c4a into elastic:main Nov 6, 2024
23 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.15, 8.16, 8.x

https://github.com/elastic/kibana/actions/runs/11712258047

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 6, 2024
## Summary

Closes elastic#184257
This PR removes the modal warning users that unsaved changes would be
lost when navigating away from dashboard to other apps within Kibana.
The modal is not necessary since unsaved changes are saved in session
storage. The benefit is that this removes the unnecessary click for
users.

This does not impact the modal for switching to view mode from edit mode
with unsaved changes as shown below.

https://github.com/user-attachments/assets/c5bdb0ec-b040-40b0-a511-fd16ad084b90

### Checklist

 - [x] Update tests

(cherry picked from commit 4f14c4a)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 6, 2024
## Summary

Closes elastic#184257
This PR removes the modal warning users that unsaved changes would be
lost when navigating away from dashboard to other apps within Kibana.
The modal is not necessary since unsaved changes are saved in session
storage. The benefit is that this removes the unnecessary click for
users.

This does not impact the modal for switching to view mode from edit mode
with unsaved changes as shown below.

https://github.com/user-attachments/assets/c5bdb0ec-b040-40b0-a511-fd16ad084b90

### Checklist

 - [x] Update tests

(cherry picked from commit 4f14c4a)
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
8.15 Backport failed because of merge conflicts
8.16
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Manual backport

To create the backport manually run:

node scripts/backport --pr 198619

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Nov 6, 2024
#199234)

# Backport

This will backport the following commits from `main` to `8.16`:
- [[Dashboard] Remove modal for inter app from dashboard
(#198619)](#198619)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Rachel
Shen","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-06T21:33:25Z","message":"[Dashboard]
Remove modal for inter app from dashboard (#198619)\n\n##
Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/184257\r\nThis PR removes the
modal warning users that unsaved changes would be\r\nlost when
navigating away from dashboard to other apps within Kibana.\r\nThe modal
is not necessary since unsaved changes are saved in session\r\nstorage.
The benefit is that this removes the unnecessary click
for\r\nusers.\r\n\r\n\r\nThis does not impact the modal for switching to
view mode from edit mode\r\nwith unsaved changes as shown
below.\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/c5bdb0ec-b040-40b0-a511-fd16ad084b90\r\n\r\n\r\n###
Checklist\r\n\r\n - [x] Update
tests","sha":"4f14c4af416ca5010f9db0ec699c4f8541539f6f","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","v9.0.0","backport:prev-major","papercut"],"title":"[Dashboard]
Remove modal for inter app from
dashboard","number":198619,"url":"https://github.com/elastic/kibana/pull/198619","mergeCommit":{"message":"[Dashboard]
Remove modal for inter app from dashboard (#198619)\n\n##
Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/184257\r\nThis PR removes the
modal warning users that unsaved changes would be\r\nlost when
navigating away from dashboard to other apps within Kibana.\r\nThe modal
is not necessary since unsaved changes are saved in session\r\nstorage.
The benefit is that this removes the unnecessary click
for\r\nusers.\r\n\r\n\r\nThis does not impact the modal for switching to
view mode from edit mode\r\nwith unsaved changes as shown
below.\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/c5bdb0ec-b040-40b0-a511-fd16ad084b90\r\n\r\n\r\n###
Checklist\r\n\r\n - [x] Update
tests","sha":"4f14c4af416ca5010f9db0ec699c4f8541539f6f"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/198619","number":198619,"mergeCommit":{"message":"[Dashboard]
Remove modal for inter app from dashboard (#198619)\n\n##
Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/184257\r\nThis PR removes the
modal warning users that unsaved changes would be\r\nlost when
navigating away from dashboard to other apps within Kibana.\r\nThe modal
is not necessary since unsaved changes are saved in session\r\nstorage.
The benefit is that this removes the unnecessary click
for\r\nusers.\r\n\r\n\r\nThis does not impact the modal for switching to
view mode from edit mode\r\nwith unsaved changes as shown
below.\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/c5bdb0ec-b040-40b0-a511-fd16ad084b90\r\n\r\n\r\n###
Checklist\r\n\r\n - [x] Update
tests","sha":"4f14c4af416ca5010f9db0ec699c4f8541539f6f"}}]}] BACKPORT-->

Co-authored-by: Rachel Shen <[email protected]>
kibanamachine added a commit that referenced this pull request Nov 6, 2024
…#199235)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Dashboard] Remove modal for inter app from dashboard
(#198619)](#198619)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Rachel
Shen","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-06T21:33:25Z","message":"[Dashboard]
Remove modal for inter app from dashboard (#198619)\n\n##
Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/184257\r\nThis PR removes the
modal warning users that unsaved changes would be\r\nlost when
navigating away from dashboard to other apps within Kibana.\r\nThe modal
is not necessary since unsaved changes are saved in session\r\nstorage.
The benefit is that this removes the unnecessary click
for\r\nusers.\r\n\r\n\r\nThis does not impact the modal for switching to
view mode from edit mode\r\nwith unsaved changes as shown
below.\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/c5bdb0ec-b040-40b0-a511-fd16ad084b90\r\n\r\n\r\n###
Checklist\r\n\r\n - [x] Update
tests","sha":"4f14c4af416ca5010f9db0ec699c4f8541539f6f","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","v9.0.0","backport:prev-major","papercut"],"title":"[Dashboard]
Remove modal for inter app from
dashboard","number":198619,"url":"https://github.com/elastic/kibana/pull/198619","mergeCommit":{"message":"[Dashboard]
Remove modal for inter app from dashboard (#198619)\n\n##
Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/184257\r\nThis PR removes the
modal warning users that unsaved changes would be\r\nlost when
navigating away from dashboard to other apps within Kibana.\r\nThe modal
is not necessary since unsaved changes are saved in session\r\nstorage.
The benefit is that this removes the unnecessary click
for\r\nusers.\r\n\r\n\r\nThis does not impact the modal for switching to
view mode from edit mode\r\nwith unsaved changes as shown
below.\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/c5bdb0ec-b040-40b0-a511-fd16ad084b90\r\n\r\n\r\n###
Checklist\r\n\r\n - [x] Update
tests","sha":"4f14c4af416ca5010f9db0ec699c4f8541539f6f"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/198619","number":198619,"mergeCommit":{"message":"[Dashboard]
Remove modal for inter app from dashboard (#198619)\n\n##
Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/184257\r\nThis PR removes the
modal warning users that unsaved changes would be\r\nlost when
navigating away from dashboard to other apps within Kibana.\r\nThe modal
is not necessary since unsaved changes are saved in session\r\nstorage.
The benefit is that this removes the unnecessary click
for\r\nusers.\r\n\r\n\r\nThis does not impact the modal for switching to
view mode from edit mode\r\nwith unsaved changes as shown
below.\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/c5bdb0ec-b040-40b0-a511-fd16ad084b90\r\n\r\n\r\n###
Checklist\r\n\r\n - [x] Update
tests","sha":"4f14c4af416ca5010f9db0ec699c4f8541539f6f"}}]}] BACKPORT-->

Co-authored-by: Rachel Shen <[email protected]>
mgadewoll pushed a commit to mgadewoll/kibana that referenced this pull request Nov 7, 2024
## Summary

Closes elastic#184257
This PR removes the modal warning users that unsaved changes would be
lost when navigating away from dashboard to other apps within Kibana.
The modal is not necessary since unsaved changes are saved in session
storage. The benefit is that this removes the unnecessary click for
users.


This does not impact the modal for switching to view mode from edit mode
with unsaved changes as shown below.



https://github.com/user-attachments/assets/c5bdb0ec-b040-40b0-a511-fd16ad084b90


### Checklist

 - [x] Update tests
@rshen91 rshen91 deleted the disable-unsaved-changes-dashboard branch November 7, 2024 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-major Backport to (8.x, 8.17, 8.16) the previous major branch and other branches in development papercut Small "burr" in the product that we should fix. release_note:enhancement v8.16.0 v8.17.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Dashboard] Stop warning users on inter-app navigation
4 participants