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: disable top input when no access #87

Merged

Conversation

wanglam
Copy link
Collaborator

@wanglam wanglam commented Dec 27, 2023

Description

Disable top input when user no access

Before:
image

After:
image

Issues Resolved

[List any issues this PR will resolve]

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc 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: Lin Wang <wonglam@amazon.com>
Copy link

codecov bot commented Dec 27, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (510b685) 93.26% compared to head (810d5fe) 93.27%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #87      +/-   ##
==========================================
+ Coverage   93.26%   93.27%   +0.01%     
==========================================
  Files          46       46              
  Lines        1218     1220       +2     
  Branches      291      292       +1     
==========================================
+ Hits         1136     1138       +2     
  Misses         80       80              
  Partials        2        2              

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

@@ -179,6 +182,7 @@ export const HeaderChatButton = (props: HeaderChatButtonProps) => {
)}
</span>
}
disabled={!props.userHasAccess}
Copy link
Member

Choose a reason for hiding this comment

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

Have you tested if the click handler on line 161 is also disabled?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We only disable the chat input in this PR. Do we need to disable the dashboard assistant icon? I think the icon still can be clicked before the chat input added.

Copy link
Member

Choose a reason for hiding this comment

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

Then user can still click the icon to display the flyout, that also makes sense to me.

@wanglam wanglam merged commit 468830b into opensearch-project:main Dec 29, 2023
21 of 22 checks passed
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