Commit graph

2371 commits

Author SHA1 Message Date
Spencer
90e2aa001b
[savedObjects] Use index template (#14271)
* [es][savedObjects/index] put template on each savedObject write

The elasticsearch plugin currently checks for the Kibana index on each iteration of the healthCheck, and creates it if it does not exist. This removes that step from the healthCheck and instead, before each savedObject is written to elasticsearch, ensures that Elasticsearch has the necessary index template should the write result in index creation.

The healthCheck still has the `patchKibanaIndex()` logic, which checks the type in the Kibana index and adds any missing types. This step now does nothing when the Kibana index does not exist, and does what it has always done when it does.

* [ftr] remove unused kibanaIndex service

(cherry picked from commit b1ef897dafeb6d43fe279776e44a9d793a389dc3)

* [savedObjects/integration] create now creates kibana index

* [es/healthCheck] remove use of format()

* [es/healthCheck/tests] use sinon assertions

* [es/patchKibanaIndex] test for kibana index missing behavior

* [savedObjects/errors] add tests for EsAutoCreateIndexError

* [savedObjects/config] deprecate and remove savedObjects.indexCheckTimeout config

* use dangling commas consistently

* [ui/error_auto_create_index] fix class names

* [ui/savedObjectsClient] no need to specify basePath

* [eslint] fix linting issue
2017-11-21 17:05:46 -07:00
Stacey Gammon
45eaa09b9a
add some new tests that the uiState migration in the url will benefit from (#15063) 2017-11-21 15:07:58 -05:00
Tim Roes
d4442e78d7
Fix Kibana crashing when resizing a tag cloud too small (#15001)
* Don't allow d3-cloud to run on 0 size, fix #14833

* Add test that validates correct resizing
2017-11-21 20:48:26 +01:00
Peter Pisljar
f22cd98825
removing more tile map tests which are flaky (#15082) 2017-11-21 19:59:30 +01:00
Spencer
319832774a
[dashboard/functionalTests] stabilize initialization ordering (#15031) 2017-11-20 17:01:41 -07:00
Stacey Gammon
856d012b46
ensure time picker open in retry loop (#15034)
* ensure time picker open in retry loop

* clean up isTimepickerOpen to use testSubjects.exists
2017-11-20 09:55:28 -05:00
Peter Pisljar
b03eac4376
removing failing tilemap tests (#15048) 2017-11-20 13:18:06 +01:00
Stacey Gammon
337def12bd
Fix mistakes added in bwc url test PR (#15038)
* Fix mistakes in bcc tests

* Correct data-test-subj name
2017-11-17 18:06:27 -05:00
Stacey Gammon
7152d334cf
Add BWC url tests for 6.0 (#15033)
Also adds some stabilization by refactoring some retries and
expectations.
and fixes a bug that snuck in between two PRS where the pie slice css
changed.
2017-11-17 14:59:16 -05:00
Spencer
60298ec8b2
[ftr] default window size (#14834)
* [ftr/mocha] revert Mocha UI assigments after loading test files

* [ftr] add beforeTopLevelSuite and afterTopLevelSuite lifecycle hooks

* [ftr] add defaultWindowWidth and defaultWindowHeight options

Adds two configuration parameters to the functional test runner which
will set the windowSize before running the tests in any file and
restores the original window size when the tests complete.

Individual test files can set the windowSize within its own before() or
beforeEach() handlers using the same `command.setWindowSize()` command.

* [ftr/assignmentProxy] use better naming

* [ftr] restore initial window size after each suite

* [ftr] improve error message for unexpected suite definitions

* [ftr/remote] remove configuration option, rely on suite-level changes

* [ftr] fix stack manipulation order

* [ftr/remote] write tests for window size management
2017-11-17 11:15:02 -06:00
Stacey Gammon
de1b98cdb7
Add a couple tests with queries and saved searches linked to visualizations (#14878)
* Add a couple tests with queries and saved searches linked to visualizations

Fix issue when edit link is clicked too soon and embeddable hasn't finished loading

* attempt to fix flakiness

* remove duplicate lines
2017-11-17 10:24:08 -05:00
Peter Pisljar
5793410a35
pie chart labels (#12174)
* pie labels

* add simple unit test

* fixing dashboard test

* fixing basedo on review

* simplifying conflict resolution

* removing unused code

* cleanup code

* minor changes based on review

* updating option templates to match new design

* updating truncate_labels to work with chars instead pixels
2017-11-17 09:57:02 +01:00
Spencer
5cddc10077
Upgrade to eslint 4 (#14862)
* [eslint] upgrade to 4.10.0

* [eslint-config-kibana] limit jest config to jest test files

* [ui_framework] remove trailing comma from rest-spreads

* [dashboard/tests] tag jest helpers with .test.js suffix

* explicitly import expect.js where used

* [eslint] apply auto-fixes

* [eslint] manually add/wrap some parens for compliance

* [npm] point to local packages for testing/review

* [jest] remove .test extension from jest helpers

* [ui_framework] fix trailing comma removal from 3bc661a1c8

* [packages] upgrade eslint packages
2017-11-14 18:16:59 -07:00
Tyler Smalley
188796314d
Removes index.mapper.dynamic from test fixture (#14930)
This was removed in ES 6.0+

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2017-11-14 07:25:38 -08:00
Matt Bargar
5321d7a567
Remove support for expression based scripted fields (#14310)
This PR removes the ability to create scripted fields with the expression language. It also adds an error message to the scripted field list page if any expression scripts already exist which instructs the user to convert all their scripts to painless.
2017-11-13 15:39:53 -05:00
Peter Pisljar
5f1f28ba41 reverts metric visualization (#14052)
Uses the previous html/css rendering code instead of the svg-based rendering for simple metrics.
2017-11-09 14:49:58 -05:00
Stacey Gammon
6d4972869b
Add new title query param to dashboard listing page (#14760)
* introduce a mechanism to load a dashboard by title is a single one is found, if not, to refill the search box on the listing page

* Make case insensitive and prevent listing page from "blipping" up on the screen before the redirect

* Add tests
2017-11-09 14:23:14 -05:00
Tim Roes
0661a4aa64
Fix issue, where tags are vanishing after double resize (#14822)
* Fix issue, where tags vanishing after resizing

* Also fix rawText in debug log
2017-11-08 16:18:14 +01:00
Jonathan Budzenski
34b4e8c05d
[jenkins] Add docs script (#14769)
* [jenkins] Add docs script

* remove xvfb
2017-11-07 15:37:28 -06:00
Stacey Gammon
f806d64e60
Add dashboard tests (#14775)
* add a test that will fail due to the current TSVB bug

* add a test to catch the latest bug with saved searches

* reorder array so tests pass

* Update tests since the first panel is TSVB and won't have a spy pane toggle
2017-11-07 14:59:18 -05:00
Stacey Gammon
81e89685e1
Don't update layout multiple times in updateLayout function (#14780)
* Don't update panels in state one at a time when layout changes

* Add test that would have caught the bug

* fix test

Hmmm, I thought grabbing the panels the second time would change their
order predictably but seems no.  Still unsure if the order is
garaunteed.

* Need to split out merging panel updates action and setting panels

Tests caught this issue, woot.

* Fix remaining setState warnings by not calling getEmbeddableHander in render
2017-11-06 15:36:46 -05:00
Thomas Neirynck
22a2fa0f4a
add more regionmaps tests (#14735) 2017-11-06 09:31:15 -05:00
Stacey Gammon
ac5ae44590
Add new "use margins" option to add separation between panels (#14708)
* Add an option to add margins between panels

Make it a boolean useMargins to make this even simpler

* Fix issue with undefined not matching false and triggering a dirty state

* add some test helpers and css for plugin use-age

* default to margins on for new dashboards.

* use const variable syntax for margins

* Fix issue with older dashboards being bumped into useMargins: true mode
2017-11-02 19:17:43 -04:00
Stacey Gammon
92964ef45f
Sync saved searches that don't have local modifications on a dashboard (#14452)
* Add tests to catch error

* Fix test

* Don't store column and sort state in panel uiState unless explicitly overridden in a dashboard.

* add debug messages

* Elements can go stale between the find by and the click event so wrap in a retry

* fix bad merge with master
2017-11-02 16:47:40 -04:00
Stacey Gammon
abef22b2ef
only show expand toggle, in view mode, on hover (#14706)
* only show expand toggle, in view mode, on hover (and focus for accessibility)

* Fix tests
2017-11-02 15:00:57 -04:00
Stacey Gammon
5984553962
Fix issue with saved search changes not being preserved on a dashboard (#14678)
* add tests to catch the issue

* use Object.assign instead of the spread operator

since we want it to modify the original object
2017-10-31 08:30:47 -04:00
Chris Roberson
677742ee06
[Management] [7.0] Handle saved search import better (#14637)
* Port fixes from #14625 to 7.0

* Fix linting issue
2017-10-27 11:46:45 -04:00
Chris Cowan
bb859d93b9 [TSVB] Fix bugs with the new split gauge/metric behavior (#13823)
* Adding a check to make sure everything is available to render

* Adding some safety

* Fixing a bug with the label

* Adding an additional sleep to wait for the new data to arrive.
2017-10-26 15:47:57 -07:00
Stacey Gammon
fc27d2abe6 wrap the check in a retry so we know it's not just taking a little long for the css changes to take affect in the UI (#14575) 2017-10-26 09:55:09 -04:00
CJ Cenizal
05cbb92965 [eslint-config-kibana] Apply AirBnB spacing rules (#14522)
* Add AirBnB key-spacing rule.
* Add AirBnB comma-spacing rule.
2017-10-25 15:08:05 -07:00
CJ Cenizal
ec38367b70 [UI Framework] Improve KuiContextMenu keyboard navigation UX (#14434)
* Refactor focus state logic to use the React lifecycle correctly.
* Update KuiPopover snapshots.
* Remove unnecessary isVisible prop from KuiContextMenu.
* Allow user to both tab AND use the arrow keys for navigation.
* Reinstate ability to tab and shift-tab to the title of KuiContextMenuPanel.
* Release focus from Dashboard panel options KuiContextMenu by closing it when you select an option.
* Update KuiContextMenu example to demonstrate best practice of closing the menu when an item is clicked.
* Replace native transitionend event handler with onAnimationEnd React event handler.
2017-10-24 17:37:51 -07:00
Stacey Gammon
9c8887ab74 Fix flaky test (#14543)
Doesn’t fix the underlying issue (which hasn’t been determined yet) but
it should get the build passing consistently again.
2017-10-24 16:55:16 -04:00
Thomas Neirynck
147c6c2832 Re-enable the tilemap test (#14532)
Enables the tile-map test. this was disabled due to CORS-issues on the server end. These are now resolved.

This reverts commit e7fb1b0d8f.
2017-10-24 11:08:21 -04:00
Nathan Reese
88f3af406d Scale histogram aggregation interval to avoid crashing browser (#14157)
* update histogram agg to fetch min and max when search request started

* scale interval when too many buckets are created

* move min and max params into autoBounds param, remove typo in help text

* use decorated property instead of params to avoid changing agg state, add functional test

* remove sleep from functional test

* make args for onSearchRequest functions specific. Add getters and setters for autoBounds to AggConfig. Protect against divide by zero

* add unused arguments with eslint comment
2017-10-24 06:53:19 -06:00
Stacey Gammon
e5a3ba7802 Introduce redux into dashboard (#14518)
* Initial check in of introducing redux in dashboard

* Use redux-actions and redux-thunks to reduce boilerplate

* Make sure all panels are minimized from the start when a dashboard is loaded - we don't want a panel id from a different dashboard in the state tree on a fresh open.

* Remove unused file

* use classnames dependency instead of manual logic

* First pass on selectors, handleActions, and more segmented reducers.

* Fix bugs with selectors and reducers and add tests that would have caught them.

* Fix issue plus tests

discover was not returning a promise

* Make expanding a panel purely a css modification which avoids all re-renders

* Found another bug with initial state not being set correctly on a hard refresh

* Remove check for change handlers now that the event handler bug is fixed

* rename dashboardState => dashboard for reducers and redux state tree

* Remove unnecessary top level describe in jest tests

* Navigate back to landing page at the end of the newly added test suite

* Fix lint errors

* Stabilize flaky tests by waiting until saved object search is finished loading results

* Don't leak subscriptions to the store.

* use selectors to grab dashboard panel off state.

* Remove use of getState in dispatcher to avoid circular reference and still use selectors

* use spread over object.assign

* No need to pass second param in when the input is simply returned as-is.
2017-10-23 16:39:23 -04:00
Stacey Gammon
e7fb1b0d8f Comment out tile map tests to get the build passing again (#14519) 2017-10-23 15:29:38 -04:00
Kim Joar Bekkelund
b19c823bc3 Use Boom.boomify instead of deprecated Boom.wrap (#14325) 2017-10-12 08:56:07 +02:00
Court Ewing
19b760627b test: move es proxy tests to api_integration (#14406)
Integration tests should go into the corresponding directory under
`test` and should use the appropriate testing framework that is designed
for long-running tests like those. Tests under __tests__ directories
should be fast-running unit tests only.
2017-10-11 13:59:03 -04:00
Court Ewing
22e97f068e test: move url shortener tests to api_integration (#14411)
Integration tests should go into the corresponding directory under
test and should use the appropriate testing framework that is designed
for long-running tests like those. Tests under tests directories
should be fast-running unit tests only.
2017-10-11 13:57:29 -04:00
Kim Joar Bekkelund
6a2bb74407 Use Object spread instead of Object.assign where it makes sense (#13903)
* Prefer Object spread

* Add eslint rules for Object spread

* no slice
2017-10-10 14:50:56 +02:00
Tim Sullivan
57c25307b5 [FTR] Add getAttribute helpers to TestSubjects (#14340) 2017-10-06 09:28:46 -07:00
Spencer
6998f07454 [uiSettings] auto create/upgrade saved config (#14164)
* [uiSettings] auto upgrade savedConfig doc when missing

* naming tweaks

* fix comments

* ensure that rcVersions are not found within a version

* add some tests for non-single digit versions/rcs/betas

* return the condition, rather than using an if()

* assert that getUpgradeableConfig() is always called once

* [uiSettingsService] remove excess space

* [savedObjectsClient] only attempt to createOrUpgradeSavedConfig once

* [uiSettings/routes/tests] remove unused assert helper

* [functional/console] correct test title

* [ftr/kibanaServer/uiSettings] fix disableToastAutohide timeout
2017-10-05 15:34:09 -07:00
Chris Roberson
4c1d029c79 [Management] Allows for imports to select existing index (#14137)
* Adds ability to change index pattern on import

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>

* UI changes. Use a table in the modal grouped by index pattern id instead of multiple modals.

* PR feedback

* PR feedback

* PR updates

* Handle skip properly

* Fix error when there were no existing index patterns

* Tests for the new import conflict logic

* Fix invisible filters caused by missing index pattern (#14131)

"invisible filters" occur when the mapping chain throws an error. If a single filter throws an error, the entire chain rejects. As a result, not even the valid filters appear in the filter bar because they never get added to the scope. However the filters still exist in app state and still get sent with each search request.

The most common error occurs when the filter's meta.index property points to a non-existing index pattern. Since this property is only used for looking up field formatters and it is not essential for a working filter, we now fall back on raw values instead of failing if the index pattern is not found. See the PR this one replaces for discussion about other solutions we tried and why we chose to go this route.

* Show query and filter bars even when there's a linked search (#14212)

The query bar used to be hidden in the presence of a linked search because unlike filters, queries didn't get merged when flattening a SearchSource hierarchy. That means a query in the query bar would override the query in the linked search. This is no longer the case. As of 6.0 we include all queries in the SearchSource hierarchy in the final request, so there's no longer any reason to hide the query bar.

Since filters created via a Vis show up in the query bar when Kuery is selected, these filters now appear correctly even when there's a linked search in the vis editor.

Previously when unlinking a saved search visualize would insert the query and filters from the saved search into app state before removing the SearchSource from the hierarcy. This posed a problem because combining two lucene query strings isn't as easy as combing two sets of filters. We decided this behavior was a bit counterintuitive anyway. If the user wants to unlink the saved search, they probably want to discard it, not combine it with their local changes. So I've also updated the unlinking functionality to discard the saved search.

* limit wait time for baselayer (#14047)

* adding scope appy back (#14269)

* remove junk tests (#14191)

* We are using the index pattern id now

* Use the index pattern id here too

* Use an isolated es env for these tests

* Revert "Fix invisible filters caused by missing index pattern (#14131)"

This reverts commit e09d7ad1f9.

* Revert "Show query and filter bars even when there's a linked search (#14212)"

This reverts commit 3aee7c2bf0.

* Revert "limit wait time for baselayer (#14047)"

This reverts commit 44a71071ac.

* Revert "adding scope appy back (#14269)"

This reverts commit 51b6b51aac.

* Revert "remove junk tests (#14191)"

This reverts commit f06c18332b.

* Revert these
2017-10-04 20:42:07 -04:00
Nathan Reese
d5ed14f460 apply field formatter to tag cloud (#14230)
* apply field formatter to tag cloud

* use unformatted value for filter creation
2017-10-03 07:58:49 -06:00
Kim Joar Bekkelund
5009435148 [index patterns] Don't attempt to wrap Boom errors (#14253) 2017-10-03 15:06:51 +02:00
Spencer
e84761217e [savedObjects] fix error handling when Kibana index is missing (#14141)
* [savedObjects/delete+bulk_get] add failing tests

* [savedObjects/delete+bulk_get] improve 404 handling

* [savedObjects/client] fix mocha tests

* [savedObjects/tests] remove extra test wrapper

* [apiIntegration/kbnServer] basically disable es healthcheck

* [savedObjects/create] add integration test

* [savedObjects/find] add failing integration tests

* [savedObjects/find] fix failing test

* [savedObjects/client] explain reason for generic 404s

* [savedObjects/get] add integration tests

* [savedObjects/find] test request with unkown type

* [savedObjects/find] add some more weird param tests

* [savedObjects/find] test that weird params pass when no index

* [savedObjects/update] use generic 404

* fix typos

* [savedObjects/update] add integration tests

* remove debugging uncomment

* [savedObjects/tests] move backup kibana index delete out of tests

* [savedObjects/tests/esArchives] remove logstash data

* [savedObjects] update test

* [uiSettings] remove detailed previously leaked from API

* [functional/dashboard] wrap check that is only failing on Jenkins

* [savedObjects/error] replace decorateNotFound with createGenericNotFound

* fix typo

* [savedObjectsClient/errors] fix decorateEsError() test

* [savedObjectsClient] fix typos

* [savedObjects/tests/functional] delete document that would normally exist

* [savedObjectsClient/tests] use sinon assertions

* [savedObjects/apiTests] create without index responds with 503 after #14202
2017-10-02 18:51:58 -07:00
Tim Sullivan
7a52fed0d4 [Test/FTR] Add getPropertyAll to testSubjects service (#14210) 2017-09-28 10:59:50 -07:00
Spencer
4fed3725ae [SavedObjects] use constructor options (#14200) 2017-09-27 14:57:47 -07:00
Stacey Gammon
e35d7b0141 Replace gridster with react-grid-layout (#13853)
* Initial check-in to replace gridster with react-grid-layout and reactify panels

* # This is a combination of 3 commits.
# This is the 1st commit message:
Add margin of error to test determining panel widths

# This is the commit message #2:

use real kibana version when creating panel data. Will make future conversions easier.

# This is the commit message #3:

Fix lint errors

* Add margin of error to test determining panel widths

use real kibana version when creating panel data. Will make future conversions easier.

Move default height and width to dashboard_constants so those that need it don't end up including extra stuff like ui/chrome

* Remove unnecessary _.once when creating react directives in dashboard.js

* Remove unnecessary constructors

* Use componentDidMount instead of componentWillMount bc of async calls, and handle case where destroyEmbeddable is not defined.

* Remove unnecessary null in classNames

* Use loads defaultsDeep instead of Object.assign

* use render* instead of get* for functions returning an element

* use relative css paths

* Use local import path

* Switch to local imports and remove need for plugins path in jest tests

* Improve accessibility of max/min panel toggle icon

* remove unused css

Had to implement this via code

* disable eslint rule for setState in componentDidMount

Am not aware of a better way to handle this, aside from switching to
redux, since it’s recommended not to put async calls in
componentWillMount.  Since I plan to investigate redux next, disabling
for now. Open to other’s opinions on the matter.

* Use native map instead of lodash

* Have the grid handle setting the z-indexes of the right reactgriditem

* Make the draggable handle the title, not the whole heading

Otherwise the drag event often takes over click events when trying to
open the panel options menu and it gets really annoying.

* Change from click to mouse down detector in KuiOutsideClickDector so drags also close pop ups.

* Fix mistaken commit

Code from the redux PR snuck into this one.

* Run getEditPath and getTitle async calls in parallel - no need to wait on the return value of one before starting the others.

* Fix tests: update snapshots, add promise returns.

* version being added to panelData in the wrong spot caused isDirty flag to be true when it shouldn't be

* Fix unmounting/mounting problem with panels due to view/edit mode switch

* Fix bug where panels get squashed to one side when view mode is changed while a panel is expanded.

* Update snapshots to match wrong view mode comparison

* Improve naming of a variable

* Fix issue with pop over hiding behind tile maps

* Previous panel.js included ui/doc_table and ui/visualize - needed to include them in the chain for Dash only mode but not in that file.

* Fix bad merge: remove baseline screenshots
2017-09-26 18:02:13 -04:00
Jonathan Budzenski
b278ad96a9 [functional tests] Remove default screenshots (#14122)
* [functional tests] Remove default screenshots

* Remove baseline screenshots
2017-09-26 08:37:12 -05:00