Commit graph

225 commits

Author SHA1 Message Date
Yulia Čech
e7746b24d5
[Guided onboarding] Register test guide in the example plugin (#147703)
This PR moves the test guide used for testing and dev work to the guided
onboarding package. It is now being registered when the guided
onboarding example plugin is being setup. For that a server side is
added to the example plugin.
Registering the test guide from the example plugin demonstrates how the
"register guide" function can be used for production guides. The test
config needs to be in the `kbn-guided-onboarding` package because
example plugins have some problems importing files from other plugins.
That way the test config is available to the example plugin and to the
guided onboarding plugin for unit and functional tests.

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-20 03:29:25 -07:00
Tiago Costa
e38350f7f9
chore(NA): upgrades uuid to v9.0.0 (#149135)
This PR upgrades uuid into its latest version `9.0.0`.
The previous default used version `v4` was kept where it was previously
used and places using `v1` or `v5` are still using it.

In this latest version they removed the deep import feature and as we
are not using tree shaking it increased our bundles by a significant
size. As such, I've moved this dependency into the `ui-shared-deps-npm`
bundle.

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-19 19:48:07 +00:00
Vadim Kibana
039ed991d8
Remove UiComponent and related code (#148037)
## Summary

- Removes `UiComponent` and its usages.
- Fixes UI Actions TypeScript types.


### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Anton Dosov <dosantappdev@gmail.com>
Co-authored-by: Dima Arnautov <arnautov.dima@gmail.com>
2023-01-09 15:34:33 -07:00
Nathan Reese
36a3d6915c
[controls] Edit and save example (#147897)
Part of https://github.com/elastic/kibana/issues/145428

PR does the following:
* Removes ControlsCallout
* Cleans up ControlGroupContainer API to avoid leaking Dashboard
implementation details
    * Removes getCreateControlButton method
    * Removes getCreateTimeSliderControlButton
    * Removes getToolbarButtons
    * Adds openAddDataControlFlyout
* Add Edit and save example  

<img width="600" alt="Screen Shot 2022-12-21 at 9 29 21 AM"
src="https://user-images.githubusercontent.com/373691/208928858-94984880-3fdb-45f4-bb2a-a086bfc440d0.png">

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-03 16:47:42 -05:00
Spencer
afb09ccf8a
Transpile packages on demand, validate all TS projects (#146212)
## Dearest Reviewers 👋 

I've been working on this branch with @mistic and @tylersmalley and
we're really confident in these changes. Additionally, this changes code
in nearly every package in the repo so we don't plan to wait for reviews
to get in before merging this. If you'd like to have a concern
addressed, please feel free to leave a review, but assuming that nobody
raises a blocker in the next 24 hours we plan to merge this EOD pacific
tomorrow, 12/22.

We'll be paying close attention to any issues this causes after merging
and work on getting those fixed ASAP. 🚀

---

The operations team is not confident that we'll have the time to achieve
what we originally set out to accomplish by moving to Bazel with the
time and resources we have available. We have also bought ourselves some
headroom with improvements to babel-register, optimizer caching, and
typescript project structure.

In order to make sure we deliver packages as quickly as possible (many
teams really want them), with a usable and familiar developer
experience, this PR removes Bazel for building packages in favor of
using the same JIT transpilation we use for plugins.

Additionally, packages now use `kbn_references` (again, just copying the
dx from plugins to packages).

Because of the complex relationships between packages/plugins and in
order to prepare ourselves for automatic dependency detection tools we
plan to use in the future, this PR also introduces a "TS Project Linter"
which will validate that every tsconfig.json file meets a few
requirements:

1. the chain of base config files extended by each config includes
`tsconfig.base.json` and not `tsconfig.json`
1. the `include` config is used, and not `files`
2. the `exclude` config includes `target/**/*`
3. the `outDir` compiler option is specified as `target/types`
1. none of these compiler options are specified: `declaration`,
`declarationMap`, `emitDeclarationOnly`, `skipLibCheck`, `target`,
`paths`

4. all references to other packages/plugins use their pkg id, ie:
	
	```js
    // valid
    {
      "kbn_references": ["@kbn/core"]
    }
    // not valid
    {
      "kbn_references": [{ "path": "../../../src/core/tsconfig.json" }]
    }
    ```

5. only packages/plugins which are imported somewhere in the ts code are
listed in `kbn_references`

This linter is not only validating all of the tsconfig.json files, but
it also will fix these config files to deal with just about any
violation that can be produced. Just run `node scripts/ts_project_linter
--fix` locally to apply these fixes, or let CI take care of
automatically fixing things and pushing the changes to your PR.

> **Example:** [`64e93e5`
(#146212)](64e93e5806)
When I merged main into my PR it included a change which removed the
`@kbn/core-injected-metadata-browser` package. After resolving the
conflicts I missed a few tsconfig files which included references to the
now removed package. The TS Project Linter identified that these
references were removed from the code and pushed a change to the PR to
remove them from the tsconfig.json files.

## No bazel? Does that mean no packages??
Nope! We're still doing packages but we're pretty sure now that we won't
be using Bazel to accomplish the 'distributed caching' and 'change-based
tasks' portions of the packages project.

This PR actually makes packages much easier to work with and will be
followed up with the bundling benefits described by the original
packages RFC. Then we'll work on documentation and advocacy for using
packages for any and all new code.

We're pretty confident that implementing distributed caching and
change-based tasks will be necessary in the future, but because of
recent improvements in the repo we think we can live without them for
**at least** a year.

## Wait, there are still BUILD.bazel files in the repo
Yes, there are still three webpack bundles which are built by Bazel: the
`@kbn/ui-shared-deps-npm` DLL, `@kbn/ui-shared-deps-src` externals, and
the `@kbn/monaco` workers. These three webpack bundles are still created
during bootstrap and remotely cached using bazel. The next phase of this
project is to figure out how to get the package bundling features
described in the RFC with the current optimizer, and we expect these
bundles to go away then. Until then any package that is used in those
three bundles still needs to have a BUILD.bazel file so that they can be
referenced by the remaining webpack builds.

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-12-22 19:00:29 -06:00
Nathan Reese
b5d3a63516
[controls] add filters, query, and timeRange props to ControlGroupRenderer and create search example (#147581)
Part of https://github.com/elastic/kibana/issues/145428

PR makes the following changes:
1) updates ControlGroupRenderer component with declarative properties
for filters, query, and timeRange.
2) creates a search example showing how to use controls to narrow
results
3) Updates redux example to use web logs sample data set
4) Updates existing uses of ControlGroupRenderer to use new props.

<img width="600" alt="Screen Shot 2022-12-14 at 4 29 58 PM"
src="https://user-images.githubusercontent.com/373691/207719012-28771203-27c3-45c0-a8ac-2bf96c10f641.png">

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-12-19 13:44:39 -05:00
Devon Thomson
f3af8e026a
[Portable Dashboards] Implementation Feature Branch (#144332)
This PR makes Dashboards **Portable**. Instead of being tightly coupled to the Dashboard App, the Dashboard Container can now be used in any plugin via the **Dashboard Container Renderer** component. The Dashboard Container renderer is one of the first examples of **Experience Building Blocks** in Kibana.
2022-12-15 10:17:23 -05:00
Yulia Čech
d1e7f50426
[Guided onboarding] Update guide IDs (#147348)
## Summary

Fixes https://github.com/elastic/kibana/issues/144452

This PR updates the guide IDs used in guided onboarding from generic
values (`observability` and `security`) to more specific values
(`kubernetes` and `siem`) which will allow us to add more guides for
observability and security in the future.


### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
2022-12-14 15:51:51 +01:00
Nathan Reese
15ed59d6f0
[controls] complete control input builder API (#146764)
ControlGroupRenderer API changes
* Added parameter `initialInput: Partial<ControlGroupInput>,` to
getCreationOptions method signature so consumers don't need to call
`getDefaultControlGroupInput`
* Rename prop onEmbeddableLoad -> onLoadComplete
* Rename prop getCreationOptions -> getInitialInput

controlGroupInputBuilder API changes
* Added `addOptionsListControl` method that allows users to pass
selectedOptions
* Added `addRangeSliderControl`
* Added `addTimeSliderControl`

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Devon Thomson <devon.thomson@elastic.co>
2022-12-01 16:38:43 -07:00
Yulia Čech
e7da574c5d
[Guided onboarding] Add guide config route (#146149)
## Summary
Fixes https://github.com/elastic/kibana/issues/145871
Fixes https://github.com/elastic/kibana/issues/145875
This PR adds an internal API endpoint that returns all existing config
guides. The client side code (api service) is updated to use the
endpoint instead of a guide configs file.

Note: This PR deletes the docs link for the kube-state-metrics from the
"Add data" step in the Kubernetes guide. I opened
https://github.com/elastic/kibana/issues/146404 to follow up on this.

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-12-01 09:44:20 +01:00
Ahmad Bamieh
1323fd8de6
[i18n] Fix ja-JP locale causing FATAL error when starting kibana (#146704)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Closes https://github.com/elastic/kibana/issues/146693
2022-11-30 21:28:28 +03:00
Jean-Louis Leysens
5a86b583df
[Files] Move <FileUpload /> and <FilePicker /> 👉🏻 packages/shared-ux/file (#146284)
## Summary

This is a refactor:

* Move `FilesContext`, `FilePicker` and `UploadFile` components to
`packages/shared-ux/file` as packages
* Renamed `UploadFile` to `FileUpload` for more consistency
* Also created `packages/shared-ux/file/types` and added
`useBehaviourSubject` to `packages/shared-ux/file/util` (we can consider
moving this elsewhere since that function is not necessarily tied to the
files domain).
* Removed the storybook config from `files` public plugin since there
are no more components there

## How to test

👉🏻 `yarn storybook shared_ux` to see the components in a lab environment

OR

👉🏻 `yarn start --run-examples` then "Developer examples" > "Files
example" to see the components being used in Kibana

Look out for any regressions: for example, in the `FileImage` component
importing `import bh from 'blurhash'` caused a regression because
blurhash does not expose a default export. This was fixed by doing:
`import * as bh from 'blurhash`.

## Notes

* With this change, we needed to move `FilesClient` interface to
packages since it is used by the components. However, we also wanted to
keep `FilesClient` interface as it is currently exported from `files`
plugin because it exposes methods that only the server of `files` plugin
should know about (e.g., the metrics endpoint). I created the
`BaseFilesClient` in the packages directory that is extended in the
`files` plugin as needed. This is a snapshot of the types as they are
provided from the server implementation and will need to be
updated/maintained by hand from here on out.
* With `BaseFilesClient` in `packages`, we lost the type check between
`files` server endpoints and the client methods. To re-establish this
link the `CreateRouteDefinition` type helper got a parameter where the
client method can be passed in to do checks that the server inputs
(query, param and body) as well as outputs (the responses) match what
the client expects using the `X extends Y ? X : unknown` capability of
TS. See this in action in, for example
`src/plugins/files/server/routes/find.ts`. DX will be: if these ever get
out of sync, the server values for `query`, `param` or `body` will map
to `unknown` causing a type issue when trying to use these values. This
can only be fixed by bringing the `FilesClient` types in sync with the
server types.
* Server endpoints that should match expected `FilesClient`
inputs/outputs should use the `CreateRouteDefinition` type helper, but
if the endpoint does not need to map to a client method we can always
skip using `CreateRouteDefinition`.

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-11-29 08:48:23 +01:00
Hannah Mudge
bb91749f0c
[Controls] [Portable Dashboards] Add control group renderer example plugin (#146189)
Closes https://github.com/elastic/kibana/issues/145429

## Summary

This PR expands on the control group building block by 
1. Replacing the old `input` declarative API and replacing it with a
`getCreationOptions` callback
2. Exposing the redux embeddable tools to the consumer

As part of this, I created an example plugin to demonstrate some of the
new functionality 👍

![Nov-23-2022
10-27-08](https://user-images.githubusercontent.com/8698078/203611035-a9633929-2a49-4d06-b38f-fcf90d8fa885.gif)


Also, to avoid some code duplication, I had to move some code to the
generic `control_group_helpers.tsx` so that both the controls plugin and
the new example plugin could use it.

### Checklist

- [x] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2022-11-24 14:00:49 -07:00
Jean-Louis Leysens
95c4d73a13
[Files] Move <Image /> component to @kbn/shared-ux package (#145995)
## Summary

* Creates new packages `@kbn/shared-ux-file-image`,
`@kbn/shared-ux-file-image-types`, `@kbn/shared-ux-file-image-mocks`
* Replace all instance of usage to import from package (for now, just
files example plugin)
* Created a `@kbn/shared-ux-file-util` package for the helpers shared
across components


## How to test

See `yarn storbook shared_ux`'s new section "Files"

## Additional notes

First step just focussed on moving `Image` component, we still need to
move `FilePicker` and `UploadFile`

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-11-24 16:56:32 +01:00
Jean-Louis Leysens
a166fba83d
[Files] Files management (#144425)
## Summary

Files management UI that rounds out the files MVP. This is UI is
intended to be progressively enhanced and provides a way for system
administrators get some insight and manage the files created and stored
in Kibana.

## To reviewers

* This is UI for retrieval and deletion of files (the R+D of CRUD)
* Creating and deleting tags to be supported in a future version
* This UI is intended to form part of the broader content management
experience
* We use the `TableListView` component as far as possible

## How to test

1. Start Kibana with `yarn start --run-examples`
2. Go to the "Developer Examples" from the left nav menu
3. Go to the "Files example" plugin
4. Click the "Upload file" button, upload a few different image types
(PNG, JPG and WEBP)
5. Go to "Stack management" > "Files"
6. Behold your files in the management UI
7. (Bonus) check that the UI and API `GET /api/files/find`, `GET
/api/files/metrics` and `DELETE /api/files/blobs` are not accessible to
non-admin or appropriately privileged users (i.e., those with "Files
management" access).

## List of functionality

 - [x] List all saved objects (scoped to admin)
 - [x] Is able to bulk-delete files
 - [x] Shows basic storage diagnostics
 - [x] Is able to search and filter files

## Screenshots

<details>
<summary>screenshots</summary>

<img width="1545" alt="Screenshot 2022-11-08 at 13 56 54"
src="https://user-images.githubusercontent.com/8155004/200570783-cfefdbf3-c5ff-4ece-ba24-48a455fcca75.png">

<img width="910" alt="Screenshot 2022-11-10 at 12 52 35"
src="https://user-images.githubusercontent.com/8155004/201083812-bc9f25f5-b423-43a6-9229-5e2a4cdd943a.png">

<img width="451" alt="Screenshot 2022-11-10 at 12 37 07"
src="https://user-images.githubusercontent.com/8155004/201081039-832a1980-684c-4abb-bb05-0c7c6a849d4d.png">

<img width="959" alt="Screenshot 2022-11-08 at 13 57 15"
src="https://user-images.githubusercontent.com/8155004/200570797-f122cff5-7043-4e01-9b51-d5663c1b26d6.png">

<img width="500" alt="Screenshot 2022-11-08 at 13 57 38"
src="https://user-images.githubusercontent.com/8155004/200570801-35cdbd99-0256-4dee-9f78-2f6ad853305f.png">

</details>

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-11-17 05:53:31 -07:00
Spencer
12aeaa8101
[ts/checkProjects] validate extends of all ts projects (#145176)
Fixes https://github.com/elastic/kibana/issues/145129

In order to make our TS setup in the repo far more efficient we needed
to make it a little more complicated than it used to be. This includes a
few rules that all tsconfig files need to follow which were currently
assumed to be true, but with this PR will now be validated:

1. No tsconfig.json files are allowed to extend the `tsconfig.json`
file. This file is used to produce types for the root of the repo, and
include the `package.json` file in a project so it can be referenced in
projects directly. Files which violate this rule were updated to point
to the root `tsconfig.base.json` file.
2. Every tsconfig.json file must extend the `tsconfig.base.json` file,
either directly or indirectly.
2022-11-16 08:57:51 -07:00
Anton Dosov
768a56a388
[Files] Files components to return whole fileJSON instead of just id (#145126)
Changes files components (`FileUpload`, `FilePicker`) so that
their API returns the whole `fileJSON` instead of just and `id` (and
`kind`)

This is needed, for example, in image emebeddable to also get an
blurHash after uploading or picking an image without fetching the whole
file again.
2022-11-15 05:04:49 -07:00
Yulia Čech
879b101669
[Guided onboarding] Update header button logic (#144634)
## Summary
Fixes https://github.com/elastic/kibana/issues/141129
Fixes https://github.com/elastic/kibana/issues/144515

This PR introduces a new state to the guided onboarding plugin. The
state keeps track of the `creationDate` and of the overall `status` of
the plugin. The creation date allows us to detect an "active" period
during which the header button will be displayed more prominently in the
header. Currently, the active period is set to 30 days. During this
time, if the user has not started any guide, has quit a guide before
completion or skipped the guide on the landing page, the header button
will be displayed and when clicked, redirect the user to the landing
page to start/continue a guide.
Also this PR adds a check for Cloud deployments and prevents the code
from sending any API requests when not on Cloud, because guided
onboarding is disabled on prem.

#### Screenshot 
<img width="298" alt="Screenshot 2022-11-10 at 18 42 18"
src="https://user-images.githubusercontent.com/6585477/201168414-391a7cd4-0709-492b-9001-1432b5bed3c8.png">



### Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-11-14 16:50:10 -07:00
Thom Heymann
a7976e57aa
Add the ability to limit the number of users you can select (#144618) 2022-11-07 12:39:30 +00:00
Michael Dokolin
92251b2567
[Expressions] Add a flag to opt out of the partial results in the expressions (#144241)
* Add a flag to opt out of the partial results in the expressions
* Align the partial results flag with the expression loader
* Move the partial results throttling to the execution service
2022-11-04 13:20:46 +01:00
Jean-Louis Leysens
4a44fd31bb
[Files] Copy updates and file picker single select (#144398)
* implement copy updates

* move rename file and update empty state copy

* update title to respect multi select vs single select

* added test for single select behaviour

* implement single select behaviour

* introduce and use multiple prop, default true

* pass multiple flag to state

* pass multiple upload flag to UI

* added single select story

* update files example to still support multiple select

* uploadMultiple -> selectMultiple

* remove use of non-existent i18n

* update filepicker react component tests
2022-11-03 10:11:43 +01:00
Yulia Čech
92db69cce5
[Guided onboarding] Search guide copy (#144234)
* [Guided onboarding] Update the search guide config to use the correct copy

* [Guided onboarding] Remove the docs link, not needed in 8.6

* [Guided onboarding] Delete the step id type for the removed search step

* Update src/plugins/guided_onboarding/public/constants/guides_config/search.ts

Co-authored-by: Kelly Murphy <kelly.murphy@elastic.co>

* Update src/plugins/guided_onboarding/public/constants/guides_config/search.ts

Co-authored-by: Kelly Murphy <kelly.murphy@elastic.co>

* Update src/plugins/guided_onboarding/public/constants/guides_config/search.ts

Co-authored-by: Kelly Murphy <kelly.murphy@elastic.co>

* Update src/plugins/guided_onboarding/public/constants/guides_config/search.ts

Co-authored-by: Kelly Murphy <kelly.murphy@elastic.co>

* Update src/plugins/guided_onboarding/public/constants/guides_config/search.ts

Co-authored-by: Kelly Murphy <kelly.murphy@elastic.co>

* Update src/plugins/guided_onboarding/public/constants/guides_config/search.ts

Co-authored-by: Kelly Murphy <kelly.murphy@elastic.co>

* [Guided onboarding] Update step description and description list

* Update src/plugins/guided_onboarding/public/constants/guides_config/search.ts

Co-authored-by: Casey Zumwalt <casey@zumwa.lt>

* Update src/plugins/guided_onboarding/public/constants/guides_config/search.ts

Co-authored-by: Casey Zumwalt <casey@zumwa.lt>

* Update src/plugins/guided_onboarding/public/constants/guides_config/search.ts

Co-authored-by: Casey Zumwalt <casey@zumwa.lt>

* [Guided onboarding] Update the copy

Co-authored-by: Kelly Murphy <kelly.murphy@elastic.co>
Co-authored-by: Casey Zumwalt <casey@zumwa.lt>
2022-11-02 07:46:31 -07:00
Jean-Louis Leysens
1ed2ec8e57
[Files] move to src (#144044) 2022-10-31 06:46:52 -07:00
spalger
52f2b33a07
[auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
Yulia Čech
460cf89d5f
[Guided onboarding] Add a config for test guide (#143973)
* [Guided onboarding] Add a guide config for testing and update the example plugin to use it instead of search

* [Guided onboarding] Update the API tests with the test guide config

* [Guided onboarding] Address CR comments

* [Guided onboarding] Delete unneeded code in examples

* Update src/plugins/guided_onboarding/public/constants/guides_config/test_guide.ts

Co-authored-by: Alison Goryachev <alisonmllr20@gmail.com>

Co-authored-by: Alison Goryachev <alisonmllr20@gmail.com>
2022-10-27 06:19:01 -07:00
Yulia Čech
9c0dd18577
[Guided onboarding] Landing page updates (#143194)
* [Guided onboarding] Updated landing page

* [Guided onboarding] Finished landing page changes

* [Guided onboarding] Fixed card for completed guides

* [Guided onboarding] Fixed types errors

* [Guided onboarding] Fixed i18n issues

* Update src/plugins/home/public/application/components/guided_onboarding/use_case_card.tsx

Co-authored-by: Cindy Chang  <cindyisachang@gmail.com>

* Update src/plugins/home/public/application/components/guided_onboarding/use_case_card.tsx

Co-authored-by: Cindy Chang  <cindyisachang@gmail.com>

* Update src/plugins/home/public/application/components/guided_onboarding/use_case_card.tsx

Co-authored-by: Cindy Chang  <cindyisachang@gmail.com>

* [Guided onboarding] Added CR comments

* [Guided onboarding] Added view guide button to the completed guide

* [Guided onboarding] Fixed the typo in kibana services

* [Guided onboarding] Started moving the components out of home plugin into the guided onboarding package

* [Guided onboarding] Fix the imports in the plugin

* [Guided onboarding] Fix the tests in the new package

* [CI] Auto-commit changed files from 'node scripts/generate codeowners'

* [Guided onboarding] Fix the package file and the yarn.lock file

* [Guided onboarding] Fix the build

* [Guided onboarding] More refactoring

* [Guided onboarding] More refactoring

* [Guided onboarding] More refactoring

* [Guided onboarding] More refactoring of types

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* [Guided onboarding] More refactoring of types

* [Guided onboarding] Fix the types issues

* [Guided onboarding] Update the tests for the api

* [Guided onboarding] Fixed the i18n errors

* [Guided onboarding] Fixed the i18n errors

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* [Guided onboarding] Fixed the jest tests

* [Guided onboarding] Home changes

* Update packages/kbn-guided-onboarding/src/components/landing_page/observability_link_card.tsx

Co-authored-by: Kelly Murphy <kelly.murphy@elastic.co>

* [Guided onboarding] Address copy feedback

* [Guided onboarding] Address CR feedback

Co-authored-by: Cindy Chang  <cindyisachang@gmail.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Kelly Murphy <kelly.murphy@elastic.co>
2022-10-20 11:36:04 +02:00
Alison Goryachev
048b11d274
[Guided onboarding] Update observability tour (#143006) 2022-10-19 08:16:49 -04:00
Walter Rafelsberger
b38bbbcea3
[ML] Explain Log Rate Spikes: Fix uncompressed streams and backpressure handling. (#142970)
- Adds a flag for `compressResponse` and `flushFix` to the request body to be able to overrule compression settings inferred from headers.
- Updates the developer examples with a toggle to run requests with compression enabled or disabled.
- Adds support for backpressure handling for response streams.
- The backpressure update includes a fix where uncompressed streams would never start streaming to the client.
- The analysis endpoint for Explain Log Rate Spikes now includes a ping every 10 seconds to keep the stream alive.
- Integration tests were updated to test both uncompressed and compressed streaming.
2022-10-14 15:30:34 +02:00
Alison Goryachev
059fecd311
[Guided onboarding] State management improvements (#141278) 2022-10-03 15:46:07 -04:00
Thom Heymann
44b38630e6
Added user avatar tooltip (#142162)
* Added user avatar tooltip

* Updated js docs
2022-10-03 15:30:04 +01:00
Yulia Čech
85c8d37925
[Guided onboarding] Updated the examples to only use the Observable for the active step check (#141265) 2022-09-26 06:22:35 -07:00
Alison Goryachev
5fe44708a6
[Guided onboarding] Update solution guide configs (#141233) 2022-09-21 12:07:18 -04:00
Yulia Čech
c713550e17
[Guided onboarding] Added plugin's README (#141219)
* [Guided onboarding] Documentation

* [Guided onboarding] Examples readme link

* [CI] Auto-commit changed files from 'node scripts/build_plugin_list_docs'

* Update src/plugins/guided_onboarding/README.md

Co-authored-by: Alison Goryachev <alisonmllr20@gmail.com>

* [CI] Auto-commit changed files from 'node scripts/build_plugin_list_docs'

* [Guided onboarding] Short info about config files

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Alison Goryachev <alisonmllr20@gmail.com>
2022-09-21 07:44:06 -07:00
Yulia Čech
081f53a220
[Guided onboarding] Added api functions for the active step (#141045)
* [Guided onboarding] Initial service function to check if the step is active and to complete a step

* [Guided onboarding] Added unit tests for api and helpers

* [Guided onboarding] Added jsdoc comments to the api methods
2022-09-21 14:02:29 +02:00
Yulia Čech
95086f4365
[Onboarding] Create guided_onboarding plugin (#138611)
* [Guided onboarding] Smashed commit of all POC work for guided onboarding and guided onboarding example plugins

* [Guided onboarding] Fixed type errors

* [Guided onboarding] Removed guidedOnboardingExample limit

* [Guided onboarding] Fixed a functonal test for exposed configs

* [Guided onboarding] Fixed plugin limit

* [Guided onboarding] Added more information to the example plugin

* [Guided onboarding] Fixed no-console error

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* [Guided onboarding] Fixed snake case errors

* move guided_onboarding out of x-pack

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Alison Goryachev <alison.goryachev@elastic.co>
2022-09-15 11:35:35 +02:00
Thom Heymann
40b1a67ae5
Add no assignees option to user profiles selectable (#140036)
* Add no assignees option to user profiles selectable

* Allow simultaneous selection of no users option and user profiles

* Update filters demo

* Fixing tests because of it getting split into components

* Added suggestions from code review

Co-authored-by: Jonathan Buttner <jonathan.buttner@elastic.co>
2022-09-14 16:52:34 +01:00
Rudolf Meijering
191bfbc97e
Saved objects: improve typesafety (#140099)
* Remove SavedObjectAttributes from examples

* Remove SavedObjectAttributes from dev_docs

* Deprecate SavedObjectAttributes type

* Remove SavedObjectAttributes from kibana_usage_collection plugin

* Remove low hanging SavedObjectAttributes in security_solution

* Remove low hanging SavedObjectAttributes in upgrade_assistant

* Remove low hanging SavedObjectAttributes in lens

* Stricter types for SavedObjectsServiceSetup.registerType

* Review feedback

* Some more low hanging fruit

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-09-13 09:56:29 +02:00
Tim Sullivan
95c3893e28
[Search] Re-enable test on example search app (#139961)
* [Search] Unskip ex-flaky example app test

* comment out flaky test code

* use es.transport.request to downsample the test index

* uncomment blocked test code

* remove browser refresh in beforeEach

* fix ts
2022-09-09 10:25:36 -07:00
Constance
98f73d674a
Upgrade EUI to v63.0.6 - updates to new EuiPageTemplate and deprecates old page components (#139524)
* Update all usages of EuiPageTemplate to EuiPageTemplate_Deprecated

* EuiPageContent_Deprecated as EuiPageContent

* EuiPageContentBody_Deprecated as EuiPageContentBody

* EuiPageContentHeader_Deprecated as EuiPageContentHeader

* EuiPageContentHeaderSection_Deprecated as EuiPageContentHeaderSection

* EuiPageSideBar_Deprecated as EuiPageSideBar

* EuiPageContent__Deprecated to EuiPageContent_Deprecated

* Fix rogue semi-colons

* WIP: NoDataConfigPage & NoDataPage converted to new template

- `withSolutionNav` not yet handled

* WIP: KibanaPageTemplateInner converted to use new template

- Pushes existing `pageHeader` prompts onto created EuiPageTemplate.PageHeader
- Uses `isEmptyState` to push `pageHeader` props to EuiPageTemplate.EmptyPrompt instead (if `children` are not supplied)

* WIP: `withSolutionNav` now renders the sidebar content properly

- Collapsing isn’t working (minWidth isn’t updating)

* Fixing stickiness of sidebar

* [Security] Fixed SecuritySolutionTemplateWrapper’s usage

- Moved `bottomBar` to EuiPageTemplate.BottomBar (now contained in just the page contents)
- Change EuiPanel children wrapper with EuiPageTemplate.Section

* [O11y] Wrap `children` with EuiPageTemplate.Section

* Fix getting_started usage

* WIP: Fixing types

* Removing `template` pass through

* Set EUI to 63.0.0

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* More import fixes

* Sidebar component update

* Expand `KibanaPageTemplate` to all namespaced EUI counterparts

- Updated `docs/tutorials` mdx page
- Fixed SolutionNav prop types

* Updated the tutorial mdx page

* [Stack Management] Updated app layout to new template

- Some temporary props applied for BWC until all other pages can be converted
- Converted `API Keys` page’s layout (and especially prompt usags) to new paradigm

* Fix circular dep

* Fix new circular dependency

- copying and pasting types from KibanaPageTemplateProps, but ah well

* [Security Solution] Remove `template` prop - no longer a prop on Kibana/EuiPageTemplate

* [O11y] Allow customizing EuiPageTemplate.Section wrapper

- converts pageBodyProps
- fixes non-centered loading template

* [Enterprise Search] Update page templates

- fix layouts by auto-wrapping an EuiPageSection for padding, while adding a `customPageSections` prop for more custom sections/layouts

- re-center 404 errors

- update tests

* Update KibanaPageTemplate tests

* Update snapshots

* Fix FTR test with removed EUI classNames

* Fix FTR tests with changed kbn classNames

* Update failing dashboard snapshots

- drop shadow changed slightly in EUI

* Fix failing Security Cypress test

* [O11y] Fix Inventory page using deprecated CSS hooks

* [O11y][Uptime] Fix missing bottom bars

- Modifies ObservabilityPageTemplate to accept a `bottomBar` prop (a la the old EuiPageTemplate behavior)

NOTE: This opinionated page layout structure is starting to feel like it could be potentially limiting / have all the same pitfalls the previous EuiPageTemplate did. If so, consider something closer to the Enterprise Search page template conversion (`customPageSections`).

- Misc cleanup: Use `KibanaPageTemplate` over `EuiPageTemplate`

* [O11y] Fix route template typing

- Since theObservabilityPageTemplate is using the new Eui/KibanaPageTemplate, its child templates and types need to be updated accordingly

* Fix broken minWidth behavior

- was an EUI issue that required a patch release
+ update snapshots

* [Security Solution] Type fixes, restore empty state

- Fix empty state logic removed in a previous commit
- bogarts KibanaPageTemplate's `isEmptyState` prop instead of using `template="noData"`

- extend template wrappers to past ...rest to underlying Kibana/EuiPageTemplate

+ replace EuiPageTemplate with KibanaPageTemplate for consistency

* Fix failing synthetics selector

* Grab EUI v63.0.6

- for deprecation tags and section tag support

* Fix Kibana Overview plugin layout

- needs to use KibanaPageTemplate.Section to get padding back

- use `bottomBorder` prop over horizontal rules

- restore previous page color via panelled=false

* Convert Home plugin to new KibanaPageTemplate

- use KibanaPageTemplate.Section instead to preserve page width/paddings

- use `bottomBorder` instead of `EuiHorizontalRule`

- NOTE: This causes margins to decrease slightly from xxl to xl (largest padding available for EuiPageSection) - this can be restored by CSS overrides if desired

- update CSS to preserve previous looks, + convert to logical properties

* [O11y] Fix non-centered empty/loading states

* [O11y] Restore subdued background on various empty state prompts

* [O11y] Fix all instances of views that require a scrollable full-height child

+ restore comment for inventory view

* [O11y][ux] Fix broken sidebar

- The entire app was missing a wrapping EuiProvider, and as such breakpoint utils were not working, and the sidebar was missing

+ misc cleanup
  - remove unnecessary fragment
  - remove role="main" attr - now that EuiPageTemplate sets a `main` tag, they'll conflict
  - add isEmptyState to center loading component

* [APM Cypress tests] harden flaky test

* [APM Cypress tests] Fix failing Cypress test, again

Co-authored-by: cchaos <caroline.horn@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-09-07 15:35:23 -05:00
Tim Sullivan
160058a8c1
[search/public] expose showWarnings(inspector) method on search service (#138342)
* add showWarning to search service

* add comments

* add unit tests

* test foo

* cleanup

* add s to property name in test

* comments for api items

* use the warnings when calling showWarnings

* change showWarning to just show a single warning

* put handleWarnings on the request adapter

* comment

* simplify 1

* fix lens unit test

* remove underscoring for unused variables

* revert inspector changes, extract the response warnings in the search service

* fix bug

* remove console.log

* re-apply typescript fixes to app test code

* declutter

* add test, improve comments

* fix some unexported public api items

* include rawResponse in the warning structure

* fix lint

* tweak clean up example app

* SearchResponseWarnings and SearchResponseWarningNotification

* fix export bug

* not include shardStats if there are no warnings

* Update src/plugins/data/common/search/types.ts

* simplify SearchResponseWarnings interface

* remove array copying

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* comments for api_docs

* simplify per feedback

* Pass callback to handleResponse in showWarnings

* export more public types

* update example to make possible to show shard failure

* pr cleanup

* eslint fix

* allow example app to not show default warnings

* move extractWarning and related types to inspector plugin

* wip functional test of example app

* fix test references

* finish functional test

* relocate extractWarnings back to search/fetch

* fix test

* remove need for isTimeout, isShardFailure

* ts fix

* improve test

* Change showWarnings to accept the RequestAdapter

* use showWarnings in vis_types/timeseries

* more tests

* use handle_warning name

* fix ts

* add reason field to SearchResponseWarning

* fix component snapshot

* update comments

* test cleanup

* fix test

* ensure notification appears only once

* fix and cleanup

* fix ts

* fix response.json bug

* use top-level type, and lower-level reason.type

* cleanup

* fix shard failure warning in tsvb per feedback

cc @flash1293

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Joe Reuter <johannes.reuter@elastic.co>
2022-08-31 11:22:24 -07:00
Pierre Gayvallet
383d8fab58
Move client-side application service to packages (#139502)
* deletes unused utils file

* just some fix while I see it

* creating empty packages

* moving all the things

* package build success

* start fixing usages

* fix the scoped history type issue

* export internal utils

* add default for mock

* fix test import

* fix external import

* start fixing external usages

* more usages

* more usages

* more usages

* More usages

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* fix integration test imports

* fix more test types

* remove public/utils from the core bundle

* trying to import from the package

* updating README's

* remove unused test types from mock package

* cleanup test types

* use import type

* add author to packages

* more import type

* remove dead path from some config

* remove src/core/utils/index.ts (and pray)

* update tsdoc

* fix new file usage

* fix paths

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-08-30 10:08:44 -07:00
Aleh Zasypkin
c868daad50
Sync UserProfile interface in kbn/user-profile-components package with the one in Security plugin. (#138704) 2022-08-12 12:56:13 -07:00
Thom Heymann
a0731f139e
Add user profile selectable (#137424)
* Add reusable user profile selector component

* Move to package and add examples

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* Add server side example

* CI Fixes

* fix tests

* Addd tests

* Addressed suggestions from code review

* Fix types

* Updated user avatar component

* Tweak styling and copy

* Add missing jsdoc comments

* .

* .

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-08-04 22:09:01 +01:00
Walter Rafelsberger
70efbf0ea3
[ML] Explain Log Rate Spikes: Fix error handling. (#137947)
- Errors on the application level were not correctly surfaced in the UI. This PR fixes it by combining "transport" stream errors and application errors in a callout above the analysis results table.
- This also fixes the problem where a partly populated results table would turn empty again when used with the error prop of EUI's table. We now keep the table on display an show the errors above it in the callout.
2022-08-04 15:23:36 +02:00
Christiane (Tina) Heiligers
44738f2439
Migrates search example mountReactNode to kibana-react toMountPoint (#137633)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-08-01 07:52:20 -07:00
Spencer
bebec37f04
[eslint] fix and skip violations for cross-boundary imports (#136911) 2022-07-29 13:57:55 -05:00
Spencer
36260fb358
[expressions] remove root-level redirect, import from common (#136997)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-07-25 08:07:43 -07:00
Tim Sullivan
0b8b66f73f
[Data views] Add pre-configuration options to runtime field editor fly-out (#136769)
* [Data views] Add pre-configuration options to runtime field editor fly-out

* fix test

* more polish

* update example app functional test

* fix functional test

* improve comment

* fix unexported public apis

* comments for public apis

* restrict runaway metrics changes

* more comments for public api

* fix fn test

* revert updates to api_docs

* more public api comments in data_view_field_editor

* fix api comments

* add public api export

* clean up FieldFormatConfig types

* cleanup

* allow checkbox to be visually checked
2022-07-22 10:30:01 -07:00
Tiago Costa
302bd423f3
chore(NA): eslint rule for disallowing naked eslint-disable (#136408)
* chore(NA): eslint rule for disallowing naked eslint-disable

* chore(NA): export new rule and update docs

* chore(NA): creation of rule in ts

* chore(NA): new corrected rule in ts

* refact(NA): remove old logic from older plugin

* docs(NA): update documentation

* docs(NA): update documentation

* docs(NA): update documentation

* refact(NA): include edge cases for better locating errors

* chore(NA): changed regex name

* docs(NA): correct name rule on docs

* refact(NA): use dedent in the template literals

* refact(NA): check for undefined

* fix(NA): introduces support for eslint-disable-line

* chore(NA): fix extra space

* test(NA): created more test cases

* chore(NA): rename plugin to eslint-plugin-disable

* docs(NA): update nav and operations landing page ids for eslint rule

* test(NA): use messageIds on test

* chore(NA): complete naked eslint disables with specific rules

* chore(NA): specific rules for a few naked eslint disable

* chore(NA): add focused eslint disable on big reindex_operation_with_large_error_message.ts file

* chore(NA): changes according PR feedback

* chore(NA): include specific eslint rules on latest naked eslint disable

* chore(NA): missing eslint disable specific rule

* fix(NA): remove comment for js annotator

* chore(NA): re add eslint focused disable rule to x-pack/plugins/osquery/cypress/support/coverage.ts

* chore(NA): re add eslint focused disable rule to x-pack/plugins/osquery/cypress/support/coverage.ts

* chore(NA): re add eslint focused disable rule to x-pack/plugins/osquery/cypress/support/coverage.ts

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-07-19 17:11:04 +01:00
Tim Sullivan
ca2d1d6975
[DataViews] Remove some usage of any (#135767)
* fix editor warning

* use UrlFormatEditorFormatParams

* remove unnecessary any

* remove any from FieldFormatEditorFactory

* remove usage of any from src/plugins/data_view_field_editor

* remove usage of any from data_views/server/fetcher

* fix ts

* fix more ts

* back off changes in src/plugins/data_views/server/fetcher/

* pretty

* remove some unknown

* pretty

* fix ts

* retain null-ability

* fix lint

* fix test

* cleanup

* fixes in FieldFormatEditorFactory

* cleanup

* fix FieldFormatEditorStart

* revert functional diff

* knock out a few small any

* fix lint

* set up generic FieldFormatParams, SerializedFieldFormat, FormatFactory

* revert comment

* fix mistake

* use FormatEditorServiceSetup, FormatEditorServiceStart

* make defaultFieldFormatEditorFactories more type safe

* simplify types

* type fixes

* roll back re-leveling of fieldFormatEditors

* review feedback item

* public api correction

Co-authored-by: Matt Kime <matt@mattki.me>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-07-13 08:55:06 -07:00