-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[App Search] Added Sample Response section to Result Settings #95971
Conversation
7c53f7f
to
73532cf
Compare
73532cf
to
b2b11ab
Compare
...cations/app_search/components/result_settings/result_settings_table/non_text_fields_body.tsx
Show resolved
Hide resolved
...ublic/applications/app_search/components/result_settings/sample_response/sample_response.tsx
Show resolved
Hide resolved
.../applications/app_search/components/result_settings/sample_response/sample_response_logic.ts
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/server/routes/app_search/sample_response_search.test.ts
Outdated
Show resolved
Hide resolved
.../applications/app_search/components/result_settings/sample_response/sample_response_logic.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/server/routes/app_search/sample_response_search.test.ts
Outdated
Show resolved
Hide resolved
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, but I think it could be worth discussing the error/empty messaging for the response with design/prod. I have my own opinions (left in a comment) but don't feel strongly, I think this approach improves some things, and could be updated in a future design pass.
.../applications/app_search/components/result_settings/sample_response/sample_response_logic.ts
Show resolved
Hide resolved
// 4XX Validation errors are expected, as a user could enter something like 2 as a size, which is out of valid range. | ||
// In this case, we simply render the message from the server as the response. | ||
// | ||
// 5xx Server errors are unexpected, and need to be reported in a flash 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.
+1 for this comment
.../applications/app_search/components/result_settings/sample_response/sample_response_logic.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/server/routes/app_search/sample_response_search.test.ts
Outdated
Show resolved
Hide resolved
...cations/app_search/components/result_settings/result_settings_table/non_text_fields_body.tsx
Outdated
Show resolved
Hide resolved
...cations/app_search/components/result_settings/result_settings_table/non_text_fields_body.tsx
Outdated
Show resolved
Hide resolved
.../applications/app_search/components/result_settings/sample_response/sample_response_logic.ts
Outdated
Show resolved
Hide resolved
); | ||
}); | ||
|
||
it('does nothing if an empty object is passed for the resultFields parameter', async () => { |
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.
Just for my edification, what's the real world scenario where this would be the case? When an engine has no documents?
I tried testing the current view on an empty engine and the entire UI looked a bit odd. I'm kinda wondering if there are no fields, if we should just return early on the entire view with a "You have no documents/fields/schema" type empty prompt and not bother showing the sample response.
EDIT: I want to add this is not a change request, as I don't mind overly this extra catch for safety, but I do think we could address this scenario better in the UI in a redesign
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.
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.
Right yeah sorry for being unclear - I'm suggesting changing the Kibana UI from the screenshotted standalone UI to hide the sample response column entirely if the engine has no schema/fields (i.e., an early return EuiEmptyPrompt). That way we don't run into the need for this check (although to clarify I'm also fine having it just in case).
Edit for even more clarification: I'm also super fine with suggesting this change in the upcoming work where you implement said empty state, and leaving this alone for now!
.../applications/app_search/components/result_settings/sample_response/sample_response_logic.ts
Show resolved
Hide resolved
.../applications/app_search/components/result_settings/sample_response/sample_response_logic.ts
Show resolved
Hide resolved
.../applications/app_search/components/result_settings/sample_response/sample_response_logic.ts
Show resolved
Hide resolved
...ublic/applications/app_search/components/result_settings/sample_response/sample_response.tsx
Outdated
Show resolved
Hide resolved
...ublic/applications/app_search/components/result_settings/sample_response/sample_response.tsx
Outdated
Show resolved
Hide resolved
This overall looks good and QA's great! Most of my comments are fairly minor in the grand scheme of things, feel free to shout at me if it's unclear if something is a change request or not |
…h/components/result_settings/result_settings_table/non_text_fields_body.tsx Co-authored-by: Constance <[email protected]>
…h/components/result_settings/sample_response/sample_response.tsx Co-authored-by: Constance <[email protected]>
…h/components/result_settings/sample_response/sample_response.tsx Co-authored-by: Constance <[email protected]>
...pplications/app_search/components/result_settings/result_settings_table/text_fields_body.tsx
Outdated
Show resolved
Hide resolved
...pplications/app_search/components/result_settings/result_settings_table/text_fields_body.tsx
Outdated
Show resolved
Hide resolved
...pplications/app_search/components/result_settings/result_settings_table/text_fields_body.tsx
Outdated
Show resolved
Hide resolved
Changes look super great - just 3 quick aria label spelling nits. If no objection I'll batch commit them on your behalf since they're so minor and approve |
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.
🎉 This looks great - thanks Jason!
Thanks for the fixes, I'm just a really big fan of the font. |
💚 Build SucceededMetrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: |
#96234) Co-authored-by: Jason Stoltzfus <[email protected]>
…-nav * 'master' of github.com:elastic/kibana: (106 commits) [Lens] don't use eui variables for zindex (elastic#96117) Remove /src/legacy (elastic#95510) skip flaky suite (elastic#95899) [Dashboard] Fix Lens and TSVB chart tooltip positioning relative to global headers (elastic#94247) fixes a skipped management x-pack test (elastic#96178) [App Search] API logs: Add log detail flyout (elastic#96162) [tech-debt] Remove defunct opacity parameters from EUI shadow functions (elastic#96191) Add Input Controls project configuration (elastic#96238) [file upload] document file upload privileges and provide actionable UI when failures occur (elastic#95883) Revert "TS Incremental build exclude test files (elastic#95610)" (elastic#96223) [App Search] Added Sample Response section to Result Settings (elastic#95971) [Maps] Safe-erase text-field (elastic#94873) [RAC][Alert Triage][TGrid] Update the Alerts Table (TGrid) API to implement `renderCellValue` (elastic#96098) [Maps] Enable all zoom levels for all users (elastic#96093) Use plugin version in its publicPath (elastic#95945) [Enterprise Search] Expose core.chrome.setIsVisible for use in Workplace Search (elastic#95984) [Workplace Search] Add sub nav and fix rendering bugs in Personal dashboard (elastic#96100) [OBS]home page is showing incorrect value of APM throughput (tpm) (elastic#95991) [Observability] Exploratory View initial skeleton (elastic#94426) [KQL] Fixed styles of KQL textarea for the K8 theme (elastic#96190) ... # Conflicts: # x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/restore_snapshot.helpers.ts
Summary
This PR adds the Sample Response preview section to the Result Settings page.
Testing:
Checklist
Delete any items that are not applicable to this PR.
For maintainers