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

feat: take index pattern and user input to t2viz from discover #349

Conversation

ruanyl
Copy link
Member

@ruanyl ruanyl commented Oct 15, 2024

Description

[Describe what this change achieves]

Screen.Recording.2024-10-15.at.13.34.35.mov

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.

public/plugin.tsx Outdated Show resolved Hide resolved
public/plugin.tsx Outdated Show resolved Hide resolved
Comment on lines +346 to +352
const queryAssistInputEle = document.getElementsByClassName('queryAssist__input')[0];
if (queryAssistInputEle instanceof HTMLInputElement) {
const input = queryAssistInputEle.value;
if (input) {
url.searchParams.set(ASSISTANT_INPUT_URL_SEARCH_KEY, input);
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we get the value from the place triggered this action? If so, we can use context to pass the value.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's a bit tricky, the context menu is updated based on data.query.queryString.getUpdates$(), but the query assistant input is not part of it. Didn't find a way to easily update the context when the input changes. I have a todo to refactor this when we moved query assistant to dashboards-assistant plugin.

@ruanyl ruanyl added the backport 2.x Trigger the backport flow to 2.x label Oct 17, 2024
@ruanyl ruanyl merged commit 98bf315 into opensearch-project:main Oct 17, 2024
11 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Oct 17, 2024
* feat: take index pattern and user input to t2viz from discover

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

* import data set type INDEX_PATTERN from data plugin

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

* chore: update CHANGELOG

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

---------

Signed-off-by: Yulong Ruan <[email protected]>
(cherry picked from commit 98bf315)
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 Oct 17, 2024
…#353)

* feat: take index pattern and user input to t2viz from discover

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

* import data set type INDEX_PATTERN from data plugin

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

* chore: update CHANGELOG

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

---------

Signed-off-by: Yulong Ruan <[email protected]>
(cherry picked from commit 98bf315)
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants