-
Notifications
You must be signed in to change notification settings - Fork 916
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
[Discover] Add Footer Bar for Single Line Editor #8565
Conversation
❌ Empty Changelog SectionThe Changelog section in your PR description is empty. Please add a valid changelog entry or entries. If you did add a changelog entry, check to make sure that it was not accidentally included inside the comment block in the Changelog section. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8565 +/- ##
==========================================
- Coverage 60.86% 60.86% -0.01%
==========================================
Files 3793 3793
Lines 90447 90480 +33
Branches 14203 14209 +6
==========================================
+ Hits 55053 55069 +16
- Misses 31906 31922 +16
- Partials 3488 3489 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Sean Li <[email protected]>
Signed-off-by: Sean Li <[email protected]>
Signed-off-by: Sean Li <[email protected]>
Signed-off-by: Sean Li <[email protected]>
Signed-off-by: Sean Li <[email protected]>
Signed-off-by: Sean Li <[email protected]>
This reverts commit 64b5969.
Signed-off-by: Sean Li <[email protected]>
@@ -215,3 +215,40 @@ | |||
display: block; | |||
} | |||
} | |||
|
|||
.queryEditor__footer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sejli lets fix this in a fast follow
|
||
.euiFormControlLayout--group .osdQuerEditor__singleLine .euiText { | ||
background-color: unset !important; | ||
line-height: 21px !important; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discover as a whole has a lot of overrides. This was an accepted deviation given the timelines. we will need to discuss how much of this needs to move to OUI vs stay custom long term
@@ -22,10 +22,9 @@ export interface QueryStatus { | |||
status: ResultStatus; | |||
body?: { | |||
error?: { | |||
reason?: string; | |||
details: string; | |||
statusCode?: number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we have this here? We dont want to show the user the status code, but rather the error and the reason
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR is good, has some follow up work though. Lets follow up on how we display the error. I think for now this is better than what we have, but we need to fix:
- Error when the editor is not focussed
- How the error is displayed
- Loading state when the query is run after the initial load
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving. There are some open questions, but none are blocking
return res.custom({ | ||
statusCode: err.name, | ||
statusCode: error.status, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all error types above won't necessarily have status, right? Is that okay?
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch-Dashboards/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch-Dashboards/backport-2.x
# Create a new branch
git switch --create backport/backport-8565-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 c11a801410fff1ea19f1debeb517cd9c5018b7c6
# Push it to GitHub
git push --set-upstream origin backport/backport-8565-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch-Dashboards/backport-2.x Then, create a pull request where the |
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch-Dashboards/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch-Dashboards/backport-2.x
# Create a new branch
git switch --create backport/backport-8565-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 c11a801410fff1ea19f1debeb517cd9c5018b7c6
# Push it to GitHub
git push --set-upstream origin backport/backport-8565-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch-Dashboards/backport-2.x Then, create a pull request where the |
…8565) * initial commit for single line editor footer Signed-off-by: Sean Li <[email protected]> * fixing styling and functionality Signed-off-by: Sean Li <[email protected]> * Changeset file for PR opensearch-project#8565 created/updated * fixing bug with error not showing up in footer Signed-off-by: Sean Li <[email protected]> * fixing loading state thanks ashwinpc Signed-off-by: Sean Li <[email protected]> * trying to surface errors Signed-off-by: Sean Li <[email protected]> * adding new error for error state Signed-off-by: Sean Li <[email protected]> * Revert "fixing loading state thanks ashwinpc" This reverts commit 64b5969. * correctly passing async search strat errors Signed-off-by: Sean Li <[email protected]> --------- Signed-off-by: Sean Li <[email protected]> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
…opensearch-project#8565) Backport PR: opensearch-project#8565 From the original PR: * initial commit for single line editor footer Signed-off-by: Sean Li <[email protected]> * fixing styling and functionality Signed-off-by: Sean Li <[email protected]> * Changeset file for PR opensearch-project#8565 created/updated * fixing bug with error not showing up in footer Signed-off-by: Sean Li <[email protected]> * fixing loading state thanks ashwinpc Signed-off-by: Sean Li <[email protected]> * trying to surface errors Signed-off-by: Sean Li <[email protected]> * adding new error for error state Signed-off-by: Sean Li <[email protected]> * Revert "fixing loading state thanks ashwinpc" This reverts commit 64b5969. * correctly passing async search strat errors Signed-off-by: Sean Li <[email protected]> --------- Signed-off-by: Sean Li <[email protected]> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
…#8565) (#8691) * [2.x-manual-backport][Discover] Add Footer Bar for Single Line Editor (#8565) Backport PR: #8565 From the original PR: * initial commit for single line editor footer Signed-off-by: Sean Li <[email protected]> * fixing styling and functionality Signed-off-by: Sean Li <[email protected]> * Changeset file for PR #8565 created/updated * fixing bug with error not showing up in footer Signed-off-by: Sean Li <[email protected]> * fixing loading state thanks ashwinpc Signed-off-by: Sean Li <[email protected]> * trying to surface errors Signed-off-by: Sean Li <[email protected]> * adding new error for error state Signed-off-by: Sean Li <[email protected]> * Revert "fixing loading state thanks ashwinpc" This reverts commit 64b5969. * correctly passing async search strat errors Signed-off-by: Sean Li <[email protected]> --------- Signed-off-by: Sean Li <[email protected]> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> * fix snapshot Signed-off-by: Anan Zhuang <[email protected]> --------- Signed-off-by: Sean Li <[email protected]> Signed-off-by: Anan Zhuang <[email protected]> Co-authored-by: Sean Li <[email protected]> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
…8565) * initial commit for single line editor footer Signed-off-by: Sean Li <[email protected]> * fixing styling and functionality Signed-off-by: Sean Li <[email protected]> * Changeset file for PR opensearch-project#8565 created/updated * fixing bug with error not showing up in footer Signed-off-by: Sean Li <[email protected]> * fixing loading state thanks ashwinpc Signed-off-by: Sean Li <[email protected]> * trying to surface errors Signed-off-by: Sean Li <[email protected]> * adding new error for error state Signed-off-by: Sean Li <[email protected]> * Revert "fixing loading state thanks ashwinpc" This reverts commit 64b5969. * correctly passing async search strat errors Signed-off-by: Sean Li <[email protected]> --------- Signed-off-by: Sean Li <[email protected]> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
@@ -85,8 +85,14 @@ export function defineSearchStrategyRouteProvider(logger: Logger, router: IRoute | |||
const queryRes: IDataFrameResponse = await searchStrategy.search(context, req as any, {}); | |||
return res.ok({ body: { ...queryRes } }); | |||
} catch (err) { | |||
let error; | |||
try { | |||
error = JSON.parse(err.message); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the status code might be in err object, not in err.message. If err.message is a valid json string, then status code is lost
return res.custom({ | ||
statusCode: err.name, | ||
statusCode: error.status, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is error.status
coming from?
Description
Issues Resolved
Screenshot
Testing the changes
Changelog
Check List
yarn test:jest
yarn test:jest_integration