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

fix: error toast message while configuring trigger while creating a monitor #1178

Merged
merged 4 commits into from
Jan 2, 2025

Conversation

vikhy-aws
Copy link
Contributor

Description

This PR fixes the issue of an unnecessary error popup appearing while creation of a monitor. The error popup is raised because the config index is not been before a monitor is created, but is created automatically when the monitor is created. So, the error popup is redundant when creating a monitor.

image

Check List

  • Bug fix tested locally.
  • Added new unit test cases.
  • All tests passed.
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

package.json Outdated
@@ -34,7 +34,7 @@
"@babel/plugin-transform-modules-commonjs": "^7.22.9",
"@elastic/elastic-eslint-config-kibana": "link:../../packages/opensearch-eslint-config-opensearch-dashboards",
"@elastic/eslint-import-resolver-kibana": "link:../../packages/osd-eslint-import-resolver-opensearch-dashboards",
"cypress": "9.5.4",
"cypress": "12.17.4",
Copy link
Collaborator

Choose a reason for hiding this comment

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

why are we changing this? Have other plugins updated it as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So, the version of cypress in OpenSearch-Dashboards and the version of cypress in all the plugins should match for the frontend to run. So, set them to the same value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

LMK if this needs to be updated or not?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reverted back

@vikhy-aws vikhy-aws requested a review from amsiglan December 21, 2024 00:25
amsiglan
amsiglan previously approved these changes Dec 21, 2024
@@ -182,8 +182,9 @@ class ConfigureActions extends React.Component {
type: toChannelType(destination.type),
description: '',
}));
} else {
backendErrorNotification(notifications, 'load', 'destinations', response.err);
} else if (response.totalMonitors !== 0) {
Copy link
Member

Choose a reason for hiding this comment

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

Am hazy on my JS but are you intending to check response.totalMonitor > 0

if yes, why are we checking for >0 and then code comment says config index not created?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So, the config index will be created automatically when the monitor is created. So, when the totalMonitors is 0 it is expected that the config index has not been created, and we don't want to show that error popup to the user.

@vikhy-aws vikhy-aws requested review from amsiglan and eirsep December 23, 2024 21:01
@riysaxen-amzn riysaxen-amzn merged commit ad86031 into opensearch-project:main Jan 2, 2025
9 of 11 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jan 2, 2025
…onitor (#1178)

* fix: error toast message while configuring trigger while creating a monitor

Signed-off-by: vikhy-aws <[email protected]>

* fix: gracefully handle exceptions related to config index not created

Signed-off-by: vikhy-aws <[email protected]>

* fix: gracefully handle exceptions related to config index not created

Signed-off-by: vikhy-aws <[email protected]>

* fix: fix unit test to conform to code changes

Signed-off-by: vikhy-aws <[email protected]>

---------

Signed-off-by: vikhy-aws <[email protected]>
(cherry picked from commit ad86031)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
AWSHurneyt pushed a commit that referenced this pull request Jan 9, 2025
…onitor (#1178) (#1179)

* fix: error toast message while configuring trigger while creating a monitor



* fix: gracefully handle exceptions related to config index not created



* fix: gracefully handle exceptions related to config index not created



* fix: fix unit test to conform to code changes



---------


(cherry picked from commit ad86031)

Signed-off-by: vikhy-aws <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants