[App Search] Added all Document related routes and logic#83324
[App Search] Added all Document related routes and logic#83324JasonStoltz merged 10 commits intoelastic:masterfrom
Conversation
ecf42b1 to
d91ca4f
Compare
There was a problem hiding this comment.
This used to use a server generated message, but that is not i18n compliant so I moved the message inline here.
There was a problem hiding this comment.
Ooo, great call! I actually have a note buried somewhere in my backlog to figure out what to do with i18n and errors/messages coming in from the server 😬 For easy stuff like this I'm a huge +1 to pulling them out like this. For the more complex wildcard stuff, we'll have to ask the Kibana team for guidance I think
There was a problem hiding this comment.
The old code used a history.push to navigate back to the document list view after a successful delete.
I wonder if that is the way we should continue doing it or not.
There was a problem hiding this comment.
You can use KibanaLogic.values.navigateToUrl() to replace history.push() - it works correctly with Kibana's SPA history (doesn't rerender top-level app which resets Kea state) and also automatically prefixes our app route for us.
I'll try to write up a cheat sheet/reference list of conversions like that at some point soon for our migration QOL
There was a problem hiding this comment.
I will re-add this when I have the UI wired up with 404 handling. It will be easier to test.
There was a problem hiding this comment.
Future note to myself. We'll need to handle 404s somehow. It's not handled here.
d91ca4f to
2100770
Compare
cee-chen
left a comment
There was a problem hiding this comment.
Awesome stuff! Just a bunch of small nits and a quick note about my grand future plans for DocumentLogic and the creation modal (no change requested there, just a heads up).
x-pack/plugins/enterprise_search/server/routes/app_search/documents.test.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/server/routes/app_search/documents.test.ts
Outdated
Show resolved
Hide resolved
|
|
||
| export interface FieldDetails { | ||
| name: string; | ||
| value: string | string[]; |
There was a problem hiding this comment.
[not a change request, just me thinking out loud] Someday in a very distant future it might be nice to clean that up a bit more in a server transform - e.g. by doing isArray(value) ? value : [value] we know for sure we're always dealing w/ arrays
There was a problem hiding this comment.
💯 Yeah that would be ideal
There was a problem hiding this comment.
I made a simple fix for this at the Logic level for now. This could be refactored later, but I think it's worth at least this small amount of effort because it will greatly simplify things downstream in the UI: 772e801
There was a problem hiding this comment.
Oh awesome, love it! I have a very slight preference to storing / testing normalizeFields in a utils file to separate out the array logic from getDocumentDetails test (in theory a unit test is easier to follow if it handles 1 thing at a time), but it's a very slight preference and I'm fine with merging as-is.
There was a problem hiding this comment.
I reverted it. We actually need to know if it's an array or not on the front-end.
There was a problem hiding this comment.
Ahh no worries, I was hoping something like that wouldn't come up, but alas. Some day
...ins/enterprise_search/public/applications/app_search/components/documents/documents_logic.ts
Outdated
Show resolved
Hide resolved
...ins/enterprise_search/public/applications/app_search/components/documents/documents_logic.ts
Outdated
Show resolved
Hide resolved
...terprise_search/public/applications/app_search/components/documents/document_detail_logic.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Ooo, great call! I actually have a note buried somewhere in my backlog to figure out what to do with i18n and errors/messages coming in from the server 😬 For easy stuff like this I'm a huge +1 to pulling them out like this. For the more complex wildcard stuff, we'll have to ask the Kibana team for guidance I think
...se_search/public/applications/app_search/components/documents/documents_detail_logic.test.ts
Outdated
Show resolved
Hide resolved
...se_search/public/applications/app_search/components/documents/documents_detail_logic.test.ts
Outdated
Show resolved
Hide resolved
...se_search/public/applications/app_search/components/documents/documents_detail_logic.test.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Constance <constancecchen@users.noreply.github.com>
|
@constancecchen I made some changes, take a look! |
|
I think the only semi-blocking comment that I want to figure out before merging is #83324 (comment) - I'm pushing back against exporting our interfaces because I'm worried it may encourage overriding types / using |
This reverts commit 772e801.
|
Good points. Updated. |
💚 Build SucceededMetrics [docs]Distributable file count
History
To update your PR or re-run it, just comment with: |
* master: (51 commits) [ML] Persisted URL state for the Data frame analytics jobs and models pages (elastic#83439) adds xpack.security.authc.selector.enabled setting (elastic#83551) skip flaky suite (elastic#77279) [ML] Improve support for script and aggregation fields in anomaly detection jobs (elastic#81923) [Workplace Search] Migrate SourcesLogic from ent-search (elastic#83544) [ML] Add UI test for feature importance features (elastic#82677) [Maps] Improve icons for all layer types (elastic#83503) Replace experimental badge with Beta (elastic#83468) [Fleet][EPM] Unified install and archive (elastic#83384) Move src/legacy/server/keystore to src/cli (elastic#83483) Used SO for saving the API key IDs that should be deleted (elastic#82211) [Uptime] Mock implementation to account for math flakiness test (elastic#83535) [Workplace Search] Enable check for org context based on URL (elastic#83487) [App Search] Added all Document related routes and logic (elastic#83324) [Alerting UI] Fix console error when setting connector params (elastic#83333) [Discover] Allow custom name for fields via index pattern field management (elastic#70039) [Uptime] Fix monitor list down histogram (elastic#83411) remove headers timeout hack, rely on nodejs timeouts (elastic#83419) [ML] Update console autocomplete for ML data frame evaluate API (elastic#83151) [Lens] Color in dimension trigger (elastic#76871) ...
Summary
Adds all logic and routes for Document and Document Detail views
Checklist
Delete any items that are not applicable to this PR.
For maintainers