This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
Add toast notification to handle errors when updating a destination #232
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue #, if available:
Description of changes:
Reason for the change:
When user have both permissions of
cluster:admin/opendistro/alerting/destination/get
andcluster:monitor/state
, user can enter theEdit destination
page.There is no notifications to handle the backend errors, especially the permission error, when the user attempts to click the
Update
button in theEdit destination
page.Note:
When user only has
cluster:admin/opendistro/alerting/destination/get
permission, theEdit
button is greyed out. It's not because the user don't have the permission to update destinations, but because the user don't have the permission to check the cluster setting, especiallyopendistro.alerting.destination.allow_list
, thus no destinations is allowed for the user to edit.After the change:
A toast notification shows up when there is an error from backend, especially the permission error, occurs when clicking the
Update
button.Testing:
unit test result: (Actually there is no unit tests for the toast notifications😐)
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.