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

Update actions menu after start/stop detector action for the selected detector #895

Conversation

amsiglan
Copy link
Collaborator

Description

When a detector is stopped using the action menu in the Detectors table, the action menu does not update for the selected item i.e. the menu item still says Stop detector even though the detector is stopped.
This PR fixes the issue by updating the selected items state maintained in the Detectors components after the action is complete and we load the updated list of detectors.

detector-status-action-menu-fix

Check List

  • 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.

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
@amsiglan amsiglan changed the title updated selected items state after action Update actions menu after start/stop detector action for the selected detector Feb 15, 2024
Copy link

codecov bot commented Feb 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 31.04%. Comparing base (3812afd) to head (362ef92).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #895      +/-   ##
==========================================
- Coverage   31.05%   31.04%   -0.01%     
==========================================
  Files         157      157              
  Lines        5230     5234       +4     
  Branches      981      982       +1     
==========================================
+ Hits         1624     1625       +1     
- Misses       3419     3422       +3     
  Partials      187      187              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@eirsep eirsep left a comment

Choose a reason for hiding this comment

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

can we add unit/integ test to verify behaviour of success from stop > start, start > stop and failure on start or stop?

@amsiglan
Copy link
Collaborator Author

can we add unit/integ test to verify behaviour of success from stop > start, start > stop and failure on start or stop?

Yes working on adding tests

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
@amsiglan
Copy link
Collaborator Author

can we add unit/integ test to verify behaviour of success from stop > start, start > stop and failure on start or stop?

Yes working on adding tests

Added cypress test for the toggle button

Copy link
Collaborator

@AWSHurneyt AWSHurneyt left a comment

Choose a reason for hiding this comment

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

Changes look good. Approving assuming CI passes.

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
@amsiglan amsiglan requested a review from eirsep March 14, 2024 07:59
@amsiglan amsiglan merged commit 8e2ae0a into opensearch-project:main Mar 14, 2024
7 of 9 checks passed
@amsiglan amsiglan added backport 2.x backport 2.11 PRs to be backported to 2.11 branch backport 2.12 labels Mar 14, 2024
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 14, 2024
… detector (#895)

* updated selected items state after action

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* added cypress test for detector toggle action

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* simplified code

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

---------

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
(cherry picked from commit 8e2ae0a)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 14, 2024
… detector (#895)

* updated selected items state after action

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* added cypress test for detector toggle action

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* simplified code

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

---------

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
(cherry picked from commit 8e2ae0a)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 14, 2024
… detector (#895)

* updated selected items state after action

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* added cypress test for detector toggle action

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* simplified code

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

---------

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
(cherry picked from commit 8e2ae0a)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
amsiglan added a commit that referenced this pull request Mar 16, 2024
… detector (#895) (#928)

* updated selected items state after action



* added cypress test for detector toggle action



* simplified code



---------


(cherry picked from commit 8e2ae0a)

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
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>
Co-authored-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 16, 2024
… detector (#895)

* updated selected items state after action

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* added cypress test for detector toggle action

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* simplified code

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

---------

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
(cherry picked from commit 8e2ae0a)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
amsiglan added a commit that referenced this pull request Apr 10, 2024
…or the selected detector (#957)

* Update actions menu after start/stop detector action for the selected detector (#895)

* updated selected items state after action

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* added cypress test for detector toggle action

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* simplified code

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

---------

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
(cherry picked from commit 8e2ae0a)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fixed cypress tests

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

---------

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
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>
Co-authored-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
amsiglan added a commit that referenced this pull request Apr 10, 2024
…for the selected detector (#930)

* Update actions menu after start/stop detector action for the selected detector (#895)

* updated selected items state after action

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* added cypress test for detector toggle action

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* simplified code

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

---------

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
(cherry picked from commit 8e2ae0a)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fixed cypress test

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

---------

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
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>
Co-authored-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants