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

[Lens] Add toast notification when visualization is saved #80788

Merged

Conversation

lykims
Copy link
Contributor

@lykims lykims commented Oct 16, 2020

Summary

Resolves #59406

When a Lens visualization is saved, there should be a toast notification that indicates that the visualization has been saved successfully. This behaviour is present in other basic visualizations.

kibana-bug-lens-save-toast-notif

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@lykims lykims requested a review from a team October 16, 2020 00:15
@kibanamachine
Copy link
Contributor

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

@cla-checker-service
Copy link

cla-checker-service bot commented Oct 16, 2020

💚 CLA has been signed

@flash1293 flash1293 added Feature:Lens release_note:skip Skip the PR/issue when compiling release notes v7.11.0 v8.0.0 Team:Visualizations Visualization editors, elastic-charts and infrastructure labels Oct 16, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@flash1293 flash1293 self-assigned this Oct 16, 2020
Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

Thanks for working on this! Left a small comment in the code.

@@ -425,6 +425,14 @@ export function App({
isSaveModalVisible: false,
isLinkedToOriginatingApp: false,
}));
notifications.toasts.addSuccess(
Copy link
Contributor

Choose a reason for hiding this comment

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

You put the same notification in this conditional branch and in the main one (https://github.com/elastic/kibana/pull/80788/files#diff-62b4eca6ab93c938023295869419d9b3031fd1c11470d5a3fec89f0012bbf036R451-R458) - it seems like putting just a single invocation in front of the branched code (line 413 of this file) would achieve the same result. Is there any reason I'm missing you didn't do this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right! I was actually following where isSaveModalVisible: false was to display the toast notification when the save modal is closed. I just tried your suggestion, and it indeed achieves the same result. I also did a manual test and ran node scripts/jest lens to verify the suggested change.

@flash1293
Copy link
Contributor

Jenkins, test this.

@@ -411,6 +411,15 @@ export function App({
return;
}

notifications.toasts.addSuccess(
i18n.translate('visualize.topNavMenu.saveVisualization.successNotificationText', {
Copy link
Contributor

@flash1293 flash1293 Oct 16, 2020

Choose a reason for hiding this comment

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

@lykims As this is a separate plugin, you need a separate i18n id - I suggest xpack.lens.app.saveVisualization.successNotificationText

You don't need to add translations manually, this is handled in a separate process

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done! Interesting. I was wondering how the translation was done.

@flash1293
Copy link
Contributor

@elasticmachine merge upstream

@flash1293
Copy link
Contributor

Jenkins, test this

@flash1293
Copy link
Contributor

@elasticmachine merge upstream

Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

Tested in Chrome, works as expected, LGTM

Thanks a lot for taking care of this! I'll wait for the CI and merge it in afterwards.

@flash1293
Copy link
Contributor

Jenkins, test this

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

async chunks size

id before after diff
lens 1.0MB 1.0MB +215.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@flash1293 flash1293 merged commit 08a6ddf into elastic:master Oct 20, 2020
flash1293 pushed a commit to flash1293/kibana that referenced this pull request Oct 20, 2020
gmmorris added a commit to gmmorris/kibana that referenced this pull request Oct 20, 2020
* master: (64 commits)
  Rename Security Solution Bug Template (elastic#81187)
  Update links (elastic#81125)
  Specify format for date range query (elastic#81025)
  [Alerting] Improve toast when alert is created (elastic#80327)
  [UX] Add empty states (elastic#80904)
  Add TS config for kibana_legacy (elastic#80992)
  [Telemetry] Add method to enable endpoint security data usage example (elastic#80940)
  [Alerting] Add scoped cluster client to alerts and actions services (elastic#80794)
  Fix reactRouterNavigate when used with a string (elastic#80520)
  [Security Solution] [Detections] Read privileges for dependencies (elastic#80852)
  [ML] Fixing exclude frequent in advanced wizard (elastic#81121)
  Fix security solution template label (elastic#80976)
  [DOCS] Update index management docs (elastic#80893)
  [APM] Error rate on service list page is not in sync with the value at the transaction page (elastic#80814)
  skip flaky suite (elastic#81072)
  [Task Manager] Cleans up legacy plugin structure (elastic#80381)
  Support unsigned_long fields (elastic#81115)
  [Form lib] Export internal state instead of raw state (elastic#80842)
  [Lens] Add toast notification when visualization is saved (elastic#80788)
  Index pattern edit field formatter API (elastic#78352)
  ...
@lykims
Copy link
Contributor Author

lykims commented Oct 20, 2020

Thank you for reviewing and merging this, @flash1293 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💝community Feature:Lens release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.11.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Lens] Add toast notification when visualization is saved
4 participants