Add globalSearch x-pack plugin#66293
Conversation
|
Pinging @elastic/kibana-platform (Team:Platform) |
|
Pinging @elastic/kibana-core-ui (Team:Core UI) |
|
|
||
| import { of, throwError } from 'rxjs'; | ||
| import supertest from 'supertest'; | ||
| import { UnwrapPromise } from '@kbn/utility-types'; |
There was a problem hiding this comment.
a side note: Finally we will get rid of this microsoft/TypeScript#27711
| const factory = getContextFactory(coreStart); | ||
| const context = factory(request); | ||
|
|
||
| expect(coreStart.savedObjects.getScopedClient).toHaveBeenCalledTimes(1); |
There was a problem hiding this comment.
I don't know if it's worth adding such a detailed test. The only logic in the factory that uiSettings.client uses the same soClient instance. Which can be considered an implementation detail.
| export default { | ||
| rootDir: '../../', | ||
| roots: [ | ||
| '<rootDir>/plugins', |
There was a problem hiding this comment.
is this file used? x-pack/scripts/jest uses another config file
There was a problem hiding this comment.
It is, but only by the integration test config. The jest command in xpack does not, and use the file you linked instead 🙈
kibana/x-pack/test_utils/jest/config.integration.js
Lines 8 to 11 in bf04235
mshustov
left a comment
There was a problem hiding this comment.
LGTM. The last pending question is #66293 (comment)
|
|
||
| ```ts | ||
| startDeps.globalSearch.find('some term').subscribe( | ||
| ({ results }) => { |
There was a problem hiding this comment.
Optional: while this form is completely fine in the code when IDE gives you hints, it's not reader-friendly when used in the docs. What if we provide a verbose example:
startDeps.globalSearch.find('some term').subscribe({
next ({ results }) {
addNewResultsToList(results);
},
error(){},
complete() {
showAsyncSearchIndicator(false);
}
});| }); | ||
| ``` | ||
|
|
||
| ## Known limitations |
There was a problem hiding this comment.
You can link the RFC for more details provided
| ): string => { | ||
| if (typeof url === 'string') { | ||
| // relative path | ||
| if (url.indexOf('/') === 0) { |
There was a problem hiding this comment.
optional: url.startsWith('/') is a bit clearer
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
* add skeleton for global_search plugin * base implementation of the server-side service * add utils tests * add server-side mocks * move take_in_array to common folder * implements base of client-side plugin * add tests for server-side service * fix server plugin tests * implement `navigateToUrl` core API * extract processResults for the client-side * fetch server results from the client side * factorize process_results * fix plugin start params * move things around * move all server types to single file * fix types imports * add basic FTR tests * add client-side service tests * add tests for addNavigate * add getDefaultPreference & tests * use optional for RequestHandlerContext * add registerRoutes test * add base test for context * resolve TODO * common nits/doc * common nits/doc on public * update CODEOWNERS * add import for declare statement * add license check on the server-side * add license check on the client-side * eslint * address some review comments * use properly typed errors for obs * add integration tests for the find endpoint * fix unit tests * use licensing start contract * translate the error message * fix eslint rule for test_utils * fix test_utils imports * remove NavigableGlobalSearchResult, use `application.navigateToUrl` instead. * use coreProvider plugin in FTR tests * nits * fix service start params * fix service start params, bis * I really need to fix this typecheck oom error * add README, update missing jsdoc * nits on doc # Conflicts: # .github/CODEOWNERS # rfcs/text/0011_global_search.md
* add skeleton for global_search plugin * base implementation of the server-side service * add utils tests * add server-side mocks * move take_in_array to common folder * implements base of client-side plugin * add tests for server-side service * fix server plugin tests * implement `navigateToUrl` core API * extract processResults for the client-side * fetch server results from the client side * factorize process_results * fix plugin start params * move things around * move all server types to single file * fix types imports * add basic FTR tests * add client-side service tests * add tests for addNavigate * add getDefaultPreference & tests * use optional for RequestHandlerContext * add registerRoutes test * add base test for context * resolve TODO * common nits/doc * common nits/doc on public * update CODEOWNERS * add import for declare statement * add license check on the server-side * add license check on the client-side * eslint * address some review comments * use properly typed errors for obs * add integration tests for the find endpoint * fix unit tests * use licensing start contract * translate the error message * fix eslint rule for test_utils * fix test_utils imports * remove NavigableGlobalSearchResult, use `application.navigateToUrl` instead. * use coreProvider plugin in FTR tests * nits * fix service start params * fix service start params, bis * I really need to fix this typecheck oom error * add README, update missing jsdoc * nits on doc # Conflicts: # .github/CODEOWNERS # rfcs/text/0011_global_search.md
Summary
First stage of #61657
Implementation of #64284
globalSearchx-pack pluginChecklist