-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Dashboard] Remove modal for inter app from dashboard #198619
Conversation
…d' into disable-unsaved-changes-dashboard
if ( | ||
currentAppId === undefined || | ||
(currentAppId === 'dashboards' && | ||
(nextAppId === 'discover' || nextAppId === 'visualize' || nextAppId === 'lens')) | ||
) { |
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'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.
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.
Ah ok - refactored in 841b2a8
if (hasUnsavedChanges && !embeddableService.getStateTransfer().isTransferInProgress) { | ||
return actions.skip(); | ||
} else if ( |
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 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?
leaveConfirmStrings.getLeaveSubtitle(), | ||
leaveConfirmStrings.getLeaveTitle() |
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.
It looks like we aren't using leaveConfirmStrings
anymore - do you mind deleting them + all i18n
associated?
…d' into disable-unsaved-changes-dashboard
💔 Build Failed
Failed CI StepsHistory
cc @rshen91 |
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.
Code review + quick local test. LGTM, thanks so much for making this change 🙇 It should hopefully make the navigation experience much better
Starting backport for target branches: 8.15, 8.16, 8.x https://github.com/elastic/kibana/actions/runs/11712258047 |
## 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)
## 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)
💔 Some backports could not be created
Note: Successful backport PRs will be merged automatically after passing CI. Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
#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]>
…#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]>
## 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
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