Commit graph

9 commits

Author SHA1 Message Date
Xavier Mouligneau 7a7f9e0ef3 rename secops to SIEM 2019-04-02 15:50:10 -04:00
Garrett Spong 36a00c543d
Merge branch 'master' of github.com:elastic/kibana into feature-secops 2019-03-11 18:30:54 -06:00
Clint Andrew Hall 3727b5355a
[Canvas] Storybook for testing and development (#29072)
## Summary

This PR adds [Storybook](https://storybook.js.org/) to our testing and development suite.

![screen shot 2019-01-21 at 4 35 32 pm](https://user-images.githubusercontent.com/297604/51502196-9f856780-1d9a-11e9-97bf-07c99c3f279b.png)

This will allow us to:

1. create a site outlining all components within Canvas, including their TS type information;
2. demonstrate usage of all components by example;
3. allow for individual component testing, both manually and by Jest;
4. iterate and fix bugs on individual components *without* having to start up Kibana, in a [HMR](https://webpack.js.org/concepts/hot-module-replacement/) environment;
5. automatically generate [snapshots](https://jestjs.io/docs/en/snapshot-testing) based on any examples written;

This PR also converts a few components to Typescript and adds examples.

## How this can help us, (with examples)

I was inspired to add this when I was fixing #25342.  In order to fix my changes, I had to run elasticsearch and kibana, as well as refresh my page whenever I needed to test a change.  Had I had a Storybook instance, I would have been done much faster.

In this PR, you'll see I converted `AdvancedFilter` from `renderers` and `FontPicker` and `ImageUpload` from `public/components`.  Would you believe I discovered and fixed bugs just by converting to Typescript and writing examples?

### `AdvancedFilter`

- `onChange` and `commit` are not marked as required in `propTypes`, but the component will error out if they're not supplied.
- `commit` was actually being called twice when 'Apply' was clicked.  This was shown in the 'Actions' panel when I was testing it.

### `FontPicker`

- The `fonts` collection was not strongly-typed, therefore any string could be passed to the `value` parameter without error.
- While the code allows for any font string to be given to the component, there is no way to currently select that value, nor type it in within the control.  This is likely a bug in design.
- The `aria-labeledby` attribute in the drop down includes `undefined`.  This is likely a bug in EUI:

![screen shot 2019-01-21 at 4 25 58 pm](https://user-images.githubusercontent.com/297604/51501908-5ed91e80-1d99-11e9-913a-ce1bb5f4e352.png)

## How to use

- `cd x-pack/plugins/canvas/`
- Run `node scripts/storybook` to start up a local development version, with HMR.
- Run `node scripts/storybook_build` to build a complete static version of the book.
- Run `node scripts/jest` which will run the Storyshots test; run `node scripts/jest --updateSnapshot` if source code has changed as expected.

## Future Work

- Adding Jest coverage and output to the info panels, ([this](https://www.npmjs.com/package/@storybook/addon-jest) is *sick* functionality).
- Adding automatic [a11y testing](https://www.npmjs.com/package/@storybook/addon-a11y), (currently [blocked](https://github.com/storybooks/storybook/issues/4889)).
- Adding generic knobs for stories
- Adding more example info, (e.g. who edited last, descriptions, etc).
2019-02-15 10:35:30 -06:00
Xavier Mouligneau 06be9aba69 Merge branch 'master' of github.com:elastic/kibana into feature-secops 2018-12-20 14:33:36 -05:00
Josh Dover a7e68755d1
Remove duplicate dep, x-pack/yarn.lock (#26642) 2018-12-04 12:04:39 -06:00
Xavier Mouligneau e565f0b0fd
Secops structure code (#24652)
* add basic structure for secops application
* finalize skeleton for secops
* fix type issue and hapi new version
* remove route home, not needed for now
* Add configuration + delete noise
* prepend elastic license to generated file
2018-12-04 09:50:55 -07:00
Felix Stürmer 36caa6badd
[Infra UI] Merge InfraOps feature branch (#24068) 2018-10-17 12:07:50 +02:00
Tim Sullivan cb67e6ce0d
[Gitignore/Test] Ignore test/functional/failure_debug (#19059) 2018-05-15 09:43:40 -07:00
Jenkins CI fe4609647d Migrate x-pack-kibana source to kibana 2018-04-24 13:48:10 -07:00