This commit accompanies the four that precede it. Rather than squash
them altogether, the four previous commits all do nothing except move
files to help avoid conflicts.
Updates discover, visualize, and dashboard to use the date picker added to the query bar in #29130. There are still some areas where we use the top nav date picker, like Timelion and TSVB which don't have a query bar.
Modify the way migrations detect mapping changes. The previous approach simply
diffed the index mappings against the mappings defined in Kibana. The problem was
that sometimes the index mappings will *always* differ. For example, if an index template
is affecting the .kibana* indices. Or if Elasticsearch adds a new magical mapping that
appears in the index, even though not specified (this happened in the 7.0 release). So,
instead of diffing, we now store hashes of our mappings in _meta, and compare against
those.
* replace kbnTimepicker directive with EuiSuperDatePicker
* remove kbnTimepicker directive
* remove bootstrap datepicker
* Embed timepicker in query bar (#29130)
* replace kbnTimepicker directive with EuiSuperDatePicker
* remove kbnTimepicker directive
* remove bootstrap datepicker
* embed timepicker in query bar
* flesh out date picker in query bar for maps app
* wire up refresh config
* fix bug with way update function called by watcher
* get maps application functional tests working with new timepicker
* update setAbsoluteRange for EuiSuperDatePicker
* replace setQuickTime with calls to setAbsoluteTime
* remove open time picker button in discover empty results view
* pass config values to super-date-picker directive
* remove getPrettyDuration
* clean up typescript lint problems
* some functional test fixes
* try something else to fix I18n problems
* fix some more functional tests
* update query_bar jest test
* remove unused method in kbn_global_timepicker
* do not import removed timepicker styles
* remove mode from time state
* remove mode from time_history interface
* fix problem with ui_settings_defaults
* fix failing TSVB functional test
* another round to test fixes
* more functional test changes
* fixes for failing tests
* add retry block to flaky tsvb test
* styles/bootstrap_dark.less
* fix functional tests
* call fetch event even when times are the same
* add retry around flaky tsvb test
* fix timefilter jest test, attempt to fix another flaky functional test
* revert emitting fetch outside of areTimePickerValsDifferent check
* clean up time mode code that is no longer needed in dashboard
* fix timefilter tests changed by timefilter emit revert
* Dashboard visual pass (initial)
* Adjusted panel header
..And used a different selector for editing mode to fix bug of `.dshPanel--editing` needing a hard refresh to update.
* better positioning of legend toggle
* Fixed legend toggle position
* Fixed some visualize sidebar font sizes
* better position for resize handle
* Consolidated error and warning messages
* Last edits and removing old testing things
* snaps
* Fix tag cloud
* Comment out markdown-it for now, since it’s not working
* update area chart snapshot
* Styled empty dashboard state
* PR feedback
- background fix
- dark mode highlight color fix
- euiScrollbars
- euiSpacer
* Fix reporting
* More PR comments
- No edit button in mobile
- No markdown comment for panel error
- i18n id addition
- Remove euiHeader sharing fix
* Revert “hide edit button”
See https://github.com/elastic/elasticsearch/pull/38254
Using the `version` parameter to implement optimistic concurrency is not going to be supported in 7.0, so we need to replace our usage of document version with the new `_seq_no` and `_primary_term` parameters. These fields are returned in the same way that `_version` was returned on all read/write requests except for search, where it needs to be requested by sending `seq_no_primary_term: true` in the body of the search request. These parameters are sent back to Elasticsearch on write requests with the `if_seq_no` and `if_primary_term` parameters, and are functionally equivalent to sending a `version` in a write request before elastic/elasticsearch#38254.
To make these updates I searched the code base for uses of a `version` and `_version`, then triaged each usage, so I'm fairly confident that I got everything but it's possible something slipped through the cracks, so if you know of any usage of the document version field please help me out by double checking that I converted it.
- [x] **Saved Objects**: @elastic/kibana-platform, @elastic/es-security - for BWC and ergonomics the `version` provided by the Saved Objects client/API was not removed, it was converted from a number to a string whose value is `base64(json([_seq_no, _primary_term]))`. This allows the Saved Objects API and its consumers to remain mostly unmodified, as long as the underlying value in the version field is irrelevant. This was the case for all usages in Kibana, only thing that needed updating was tests and TS types.
- [x] **Reporting/esqueue**: @joelgriffith, @tsullivan - the version parameter was used here specifically for implementing optimistic concurrency, and since its usage was contained within the esqueue module I just updated it to use the new `_seq_no` and `_primary_term` fields.
- [x] **Task Manager**: @tsullivan @njd5475 - Like esqueue this module uses version for optimistic concurrency but the usage is contained with the module so I just updated it to use, store, and request the `_seq_no` and `_primary_term` fields.
- [ ] **ML**: @elastic/ml-ui - Best I could tell the only "version" in the ML code refers to the stack version, 077245fed8
- [ ] **Beats CM**: @elastic/beats - Looks like the references to `_version` in the code is only in the types but not in the code itself. I updated the types to use `_seq_no` and `_primary_term`, and their camelCase equivalents where appropriate. I did find a method that used one of the types referencing version but when investigating its usage it seemed the only consumer of that method was itself so i removed it. 52d890fed7
- [x] **Spaces (tests)**: @elastic/kibana-security - The spaces test helpers use saved objects with versions in a number of places, so I updated them to use the new string versions where the version was predictable, and removed the assertion on version where it wasn't. We test the version in the saved objects code so this should be fine.
* [Maps] add saved objects for all sample data sets
* add functional tests that compare sample data maps to baseline images
* add check for layer loading in functional tests
* try something out in CI
* try map without EMS regions
* add weblogs test but hide region layer
* skip tests with EMS vector layers
* gis-map to map and ES_GEOHASH_GRID to ES_GEO_GRID
* add resolution property to ES_GEO_GRID source descriptor
* move alphaValue from style descriptor to layer descriptor and rename to alpha
* terms join label change 'group by' to 'of'
* ensure sample data sets work with no internet access
* get functional tests working with updated full screen snapshots
* delete gis folder left overs
* give time for visibility to toggle to fire
* make web logs screen comparision more forgiving
* wait for layers to load on full screen
Fixes https://github.com/elastic/kibana/issues/29373
Fixes https://github.com/elastic/kibana/issues/29833
This flaky test is caused by the filter input box not being filled in completely. I was able to reproduce this once locally, but only after running the tests a couple times. To fix this I tried switching to the `testSubjects.setValue()` function, which focuses the input and clears its value before attempting to type into the field. This seems to have a higher success rate as I was able to run the test 40 times after making the change without a failure.
* csp: nonce and unsafe-eval for scripts
To kick things off, a rudimentary CSP implementation only allows
dynamically loading new JavaScript if it includes an associated nonce
that is generated on every load of the app.
A more sophisticated content security policy is necessary, particularly
one that bans eval for scripts, but one step at a time.
* img-src is not necessary if the goal is not to restrict
* configurable CSP owned by security team
* smoke test
* remove x-content-security-policy
* document csp.rules
* fix tsconfig for test
* switch integration test back to regular js
* stop looking for tsconfig in test
* grrr, linting errors not caught by precommit
* docs: people -> you for consistency sake
Co-Authored-By: epixa <court@epixa.com>
Fixes the build issues introduced in #25563 and re-introduces the new react/eui/typescript filter bar, essentially reverting the revert in #29662. I did have to resolve one merge conflict in query_bar.tsx, and re-deleted all of the old filter bar code where translation code had been added.
* Bring over all ui-select styles and convert color vars
* Some bootstrap dark theming
* Consolidating non-EUI form control styles
* Update some tutorial pieces set to EUI
* Fix up visualize editor sidebar as best as I can
* PR feedback
- comment for image
- euiScrollbar
- euiBorderThick
* Fix advanced toggle test
* Don’t show IE’s select arrow
* initial commit of K7 side nav
* [ui/persistedLog/recentlyAccessed] support observing history items
* [globalNav] use real recentlyAccessed and navLink data
* fixes header logo and mobile layout
* handle hidden links and no recents, use size vars
* handle hidden links and no recents, use size vars
* adds prop to wrap flyout link text
* fix menu scroll for IE
* [chrome/headerGlobalNav] fix typescript issues
* [chrome/headerGlobalNav] only ignore types that are actually missing
* update EUI to 6.6.0
* Revert "update EUI to 6.6.0"
This reverts commit 048cbf9157f8fc7410d4cf8e017b210c4548104e.
* [chrome] remove HeaderAppMenu component
* [ftr/services/appsMemnu] update for new style
* [ftr/discover] tweak size of discover tests and size-dependent assertions
* [chrome] disable offsets in embed mode
* [ftr/discover] try sticking with original screen width
* [ftr/discover] try to force screensize before checking axis labels
* [ftr/services/appMenu] ensure menu closed after clicking app
* uptime app icon, mobile header size removed
* [ftr/discover] make assertion resilient to minor changes in vis width
* [chrome] add types for nav apis
* [chrome/recentlyAccessed] display app icons when possible
* [ftr/discover] make a little wider so scroll doesn't interfer with vis width
* [ftr/services/globalNav] fix test subject
* Embed timepicker in query bar (#29130)
* replace kbnTimepicker directive with EuiSuperDatePicker
* remove kbnTimepicker directive
* remove bootstrap datepicker
* embed timepicker in query bar
* flesh out date picker in query bar for maps app
* wire up refresh config
* fix bug with way update function called by watcher
* get maps application functional tests working with new timepicker
* remove some changes outside of scoped work
* clean up typescript lint problems
* fix query_bar I18n lint error
* update query_bar jest test
* grab some parts missing from one cherry-pick
* pass dateRange to updateQueryAndDispatch when app state changes
* use timefilter disable methods to hide timepicker from top naav
* get selected refresh unit
* use EuiSuperUpdate button
* Fix responsive sizing of datepicker (#29)
* set isDisabled on EuiSuperUpdateButton
* review feedback
* remove ts-ignore comment from defaultProps, fix query_bar snapshot
* make new props optional
* fighting with ts linter
* do not include dateRangeFrom and dateRangeTo in isDirty when shoDateRange is not true
* pull initial query from UI settings
* Add new references attribute to saved objects
* Add dual support for dashboard export API
* Use new relationships API supporting legacy relationships extraction
* Code cleanup
* Fix style and CI error
* Add missing spaces test for findRelationships
* Convert collect_references_deep to typescript
* Add missing trailing commas
* Fix broken test by making saved object API consistently return references
* Fix broken api integration tests
* Add comment about the two TS types for saved object
* Only return title from the attributes returned in findRelationships
* Fix broken test
* Add missing security tests
* Drop filterTypes support
* Implement references to search, dashboard, visualization, graph
* Add index pattern migration to dashboards
* Add references mapping to dashboard mppings.json
* Remove findRelationships from repository and into it's own function / file
* Apply PR feedback pt1
* Fix some failing tests
* Remove error throwing in migrations
* Add references to edit saved object screen
* Pass types to findRelationships
* [ftr] restore snapshots from master, rely on migrations to add references
* [security] remove `find_relationships` action
* remove data set modifications
* [security/savedObjectsClient] remove _getAuthorizedTypes method
* fix security & spaces tests to consider references and migrationVersion
* Add space id prefixes to es_archiver/saved_objects/spaces/data.json
* Rename referenced attributes to have a suffix of RefName
* Fix length check in scenario references doesn't exist
* Add test for inject references to not be called when references array is empty or missing
* some code cleanup
* Make migrations run on machine learning data files, fix rollup filterPath for savedSearchRefName
* fix broken test
* Fix collector.js to include references in elasticsearch response
* code cleanup pt2
* add some more tests
* fix broken tests
* updated documentation on referencedBy option for saved object client find function
* Move visualization migrations into kibana plugin
* Update docs with better description on references
* Apply PR feedback
* Fix merge
* fix tests I broke adressing PR feedback
* PR feedback pt2
* Allow passing a default operator to use on find operations
* Default operator to OR like elasticsearch to avoid passing null
* Add dashboard search tests
* Make search_operator optional
* Fix query_params.test.js
* Include searchOperator in saved_object_finder
* Apply PR feedback
* Rename searchOperator to defaultSearchOperator
We've seen a number of flaky test failures where the tests are waiting for the rendering count to be `11` but it is `12` for some reason (which is probably totally fine). This is causing tests to regularly fail when they probably shouldn't, so I've updated the `PageObjects.visualize.waitForRenderingCount()` to accept a `minimumCount` instead of an exact count that is expected. I've also updated the function to use `retry.waitFor()` for slightly better logging.
```
[00:01:13] │ debg Waiting up to 20000ms for rendering count to be greater than or equal to [3]...
[00:01:13] │ debg TestSubjects.find(visualizationLoader)
[00:01:13] │ debg findByCssSelector [data-test-subj~="visualizationLoader"]
[00:01:13] │ debg -- currentRenderingCount=2
[00:01:13] │ debg TestSubjects.find(visualizationLoader)
[00:01:13] │ debg findByCssSelector [data-test-subj~="visualizationLoader"]
[00:01:13] │ debg -- currentRenderingCount=3
```
* Fix timelion missing renderer on resize
Adding a watch to the renderComplete promise to fix missing rendering of chart
when the resize observer detect a change in size.
Removed the existing resize observer.
* Revert removing observe resize
It's need on the timelion app to resize since that app doesn't use
visualize loader
* Change double watch to watchgroup
* Reenable skipped dashboard test
* [scss] build a light/dark theme for each style sheet, only include correct stylesheet
* Created dark theme Bootstrap
Right now it’s importing both dark and light theme, but light is last so it’s overriding. Not sure how to only import the one or the other.
* migrate light/dark style to unique webpack bundle
* [build] fix log messaage about built sass
* [build/notice] deduplicate notices
* [uiRender/bootstrap] make try auth if necessary
* [visualize/editor] set reversed prop
* remove unnecessary change
* [styles] show toast when theme:darkMode is changed
* [styles] update copy
* [uiRender] default dark mode to false
* partial progress
* fix routing, account for create flow
* fix test
* fix test
* fix test
* fix next page after delete
* fix test
* indices refs to index_patterns as appropriate
* more refactor and potential test fix
* change more urls
Fixes#29194
In node 10, urls are validated to not include any multi-byte characters, which wouldn't be possible if we were always encoding variables injected into URLs but we missed a couple places.
* [dashboard+gis] remove dark mode options
* [reporting/extract] restore fixtures
* remove mentions of old `.theme-dark` class
* import panel styles from panel/_index.scss
* [visualize] update breadcrumbs when updating visualization
* [ftr] auto-scroll elements passed the fixed header if necessary
* [uiSettings] enable the k7design by default
* [ftr/services/flyout] add ensureClosed() and ensureAllClosed()
* [ftr/services/globalNav] implement globalNav service
* [ftr/services/appsMenu] implement service for using app menu
* [ftr/services/userMenu] add service for using user menu
* [ftr/discover+visualize] update assertions that are based on the app width
* [ftr/monitoring] pass test subjects to new breadcrumbs
* [headerGlobalNav] don't offset the app container in embed mode
* update heights for slightly smaller header
While working on https://github.com/elastic/kibana/pull/28503 an update needs to be made to an assertion that is copy/pasted all over the place. To make the process simpler I've added a new helper that does the work in one place and allows updating once.
As suggested by @legrego in #28792, this PR adds a config flag to completely disable the welcome screen, which is enabled by the functional test runner to ensure that the welcome screen doesn't pop up.
With https://github.com/elastic/kibana/pull/28503 we will be enabling the k7design by default, which adds a fixed header to the top of the page. This causes issues with the default "scroll into view" logic, as elements which are in the top overflow will be scrolled into view but then covered by the header.
My first attempt to solve this was adjusting the layout to only scroll the content below the header. This allowed the [standard scroll into view algorithm](https://drafts.csswg.org/cssom-view/#element-scrolling-members) to function as intended, but had a slightly worse UX on OSes like macOS, and @elastic/kibana-design ultimately pushed back because not allowing the body to scroll has other implications.
Instead I have implemented a `LeadfootElementWrapper#scrollIntoViewIfNecessary()` method which is automatically called before each `#click()` and `#moveMouseTo()` call. This new method scrolls the element into view when necessary, and then additionally adjusts the scroll position of the root scroll element by the necessary pixels if the top of the element is within `layout.fixedHeaderHeight` pixels.
* [pageObjects/welcome] automatically disable on navigation
* [pageObjects/welcome] disable on beforeTests to not slow down navigation
* [ftr/services/welcome] also disable welcome after logout
* [ftr/services/welcome] revist home after disabling welcome