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

T2viz ux improvements #330

Merged
merged 5 commits into from
Sep 27, 2024
Merged

Conversation

ruanyl
Copy link
Member

@ruanyl ruanyl commented Sep 27, 2024

Description

  1. Allow to customize the AI assistant logo via config
  2. Display a more precise message when the generate PPL returns no result
  3. Only pre-select index pattern that is not disabled
  4. When no index pattern is selected, disabled nature language input and the submit button

Issues Resolved

[List any issues this PR will resolve]

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test.
  • 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.

1. Only preselect index pattern that is enabled
2. Display an error toast when PPL query returns no result
3. Disable nature language input if no index pattern was selected

Signed-off-by: Yulong Ruan <[email protected]>
Signed-off-by: Yulong Ruan <[email protected]>
@@ -342,16 +343,17 @@ export const Text2Viz = () => {
onChange={(e) => setInput(e.target.value)}
fullWidth
compressed
prepend={<EuiIcon type={chatIcon} />}
prepend={<EuiIcon type={config.branding.logo || chatIcon} />}
Copy link
Collaborator

Choose a reason for hiding this comment

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

will config.branding.logo supports svg file?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, url to svg is supported

@@ -31,6 +31,7 @@ export const ActionContextMenu = (props: Props) => {
trigger: AI_ASSISTANT_QUERY_EDITOR_TRIGGER as any,
})),
closeMenu: () => setOpen(false),
title: '',
Copy link
Collaborator

Choose a reason for hiding this comment

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

does this empty title is needed here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, the default title is Options but we don't need a title, so set it to ''

Comment on lines +66 to +68
if (res.rawResponse.total === 0) {
throw new Error(`There is no result with the generated query: '${value.ppl}'.`);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

would there a place to show this error on page?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, in text2viz.tsx line 110

@ruanyl ruanyl added backport 2.x Trigger the backport flow to 2.x t2viz labels Sep 27, 2024
@ruanyl ruanyl merged commit 3cdd0e2 into opensearch-project:main Sep 27, 2024
12 of 13 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Sep 27, 2024
* fix(t2viz): UI fix and improvements

1. Only preselect index pattern that is enabled
2. Display an error toast when PPL query returns no result
3. Disable nature language input if no index pattern was selected

Signed-off-by: Yulong Ruan <[email protected]>

---------

Signed-off-by: Yulong Ruan <[email protected]>
(cherry picked from commit 3cdd0e2)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
ruanyl pushed a commit that referenced this pull request Sep 27, 2024
* fix(t2viz): UI fix and improvements

1. Only preselect index pattern that is enabled
2. Display an error toast when PPL query returns no result
3. Disable nature language input if no index pattern was selected

Signed-off-by: Yulong Ruan <[email protected]>

---------

Signed-off-by: Yulong Ruan <[email protected]>
(cherry picked from commit 3cdd0e2)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md

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
Labels
backport 2.x Trigger the backport flow to 2.x t2viz
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants