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: data source picker is remounted multiple times in alerts card #1131

Merged
merged 1 commit into from
Oct 23, 2024

Conversation

SuZhou-Joe
Copy link
Member

@SuZhou-Joe SuZhou-Joe commented Oct 23, 2024

Description

[Describe what this change achieves]
The DataSourceSelector is generated in every render and React recognizes the component as a new component thus unmount the old element and mount an new element with the new DataSourceSelector.

This PR is to fix this behavior by adding a useMemo to ensure only single instance of DataSourceSelector will be generated.

image

Issues Resolved

[List any issues this PR will resolve]

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • 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: SuZhou-Joe <suzhou@amazon.com>
@AWSHurneyt AWSHurneyt merged commit 7deec89 into opensearch-project:main Oct 23, 2024
11 of 15 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Oct 23, 2024
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
(cherry picked from commit 7deec89)
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 Oct 23, 2024
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
(cherry picked from commit 7deec89)
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 Oct 23, 2024
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
(cherry picked from commit 7deec89)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
riysaxen-amzn pushed a commit that referenced this pull request Oct 23, 2024
(cherry picked from commit 7deec89)

Signed-off-by: SuZhou-Joe <suzhou@amazon.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>
riysaxen-amzn pushed a commit that referenced this pull request Oct 23, 2024
(cherry picked from commit 7deec89)

Signed-off-by: SuZhou-Joe <suzhou@amazon.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>
riysaxen-amzn pushed a commit that referenced this pull request Oct 23, 2024
(cherry picked from commit 7deec89)

Signed-off-by: SuZhou-Joe <suzhou@amazon.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>
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.

3 participants