* fixes https://github.com/elastic/kibana/issues/74449
* watcher test with specific permissions
* adding the false parameter
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Add index route for personal dashboard
* Fix links to personal source flow
In ent-search, the base route was /sources so the getSourcesPath helper was not needed. In Kibana, we use the ‘/p’ route to differentiate personal from org so the helper is needed and we pass false as the isOrganization flag
* Remove legacy sidebar text
When I first migrated this, I left the sidebar copy in so that it was not aboandoned before the design pass. After talking with John we decided to just use the copy to the right of the sidebar so this drops that legacy copy.
* Remove constants
* Remove legacy sidebar link
* Revert "Remove legacy sidebar text"
This reverts commit 8c8a3fb63c.
* Revert "Remove constants"
This reverts commit a88723ec90.
* Revert "Remove legacy sidebar link"
This reverts commit 5d08a12a7d.
* Update TODO
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* 🚀 Load indexPatternRefs only on edit mode
* :white_mark_check: Fix test with new editor init flag
* 🐛 Avoid to save to localStorage undefined indexPattern
* :white_mark_check: Adapted tests to new conditional ref loading
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* bump babel version
* build kbn-pm
* fix integration test
* remove cicular dependency between files which crashes Kibana in rutime
Co-authored-by: spalger <spalger@users.noreply.github.com>
* [ML] fix swim lane selected times with only start boundaries
* [ML] unit test
* [ML] update url variables
* [ML] selectedLanes to an array type
* [ML] handle legacy query params
* Move shared data to mock
* Change name of mock
Everywhere else we don’t use the “mock” prefix for mocked data so I’m changing here to match.
Also added missing “size” prop from mock.
* Remove unused actions
These were missed on the migration to the new add_source_logic file. All of that logic lives there now
* Add tests for source logic
* REmove resetFlashMessages
This is no longer used as Kibana resets its own. This was removed from the component already.
* Export items for use in tests
* Remove unnecessary condition
It’s literally not possible for this function to receive an empty contentSources parameter. Not sure why this was added. Even if the server sends response with no privateContentSources, the reducer falls back to an empty array.
* Add tests for sources logic
* Fix typo
* only check privileges if index param is not empty
* fix jest test i added in previous commit, fixes bug where timestamp field was printed twice in partial failure message
* adds two unit tests to check the error messages written from hasTimestampFields util function
* add refresh button to alerts list
* add refresh button to Alerts Details Page
* fix: add EuiFlexItem tag
* add tests for refresh button in alerts_list and alert_details
* fix: add test for requestRefresh and loadAlerts
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
resolves https://github.com/elastic/kibana/issues/68575
The index threshold alert defines an `index` parameter which is
typed as `string | string[]`. However the UI for this alert has
been typing it as only `string[]`.
This PR changes the UI to work with an incoming string value for
this parameter. If the parameter is edited in the UI, it will always
be set as an array, even if there is only one element.
* Bump EUI to v31.3.0
* jest snapshot updates
* Fixed space issue in kbnQueryBar date picker
* Removed unecessary space in query bar scss
Co-authored-by: miukimiu <elizabet.oliveira@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Create reusable AnalyticsCards component
* Update EngineOverview to use new AnalyticsCards component
* Update Analytics overview with AnalyticsCards + data
* Update QueryDetail with AnalyticsCards + data
* Update Analytics overview with AnalyticsChart + data
- turns out we do need startDate after all for charts, so I added it back to types
* Update QueryDetail with AnalyticsChart + data
* [Polish] Dash click and no result lines to match standalone UI
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Add getListeners to Kea test helpers
* Update TelemetryLogic to use new getListeners helper
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* [Maps] fix users without access to Maps should not have the option to create them
* fix test message
* wrap add geo field trigger in show capabilities check
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Remove history params
We already replace the history.push functionality with KibanaLogic.values.navigateToUrl but the history object was still being passed around.
* Add org sources container tests
* Add tests for source router
* Clean up leftover history imports
* Add tests for SourcesRouter
* Quick refactor for cleaner existence check
Optional chaining FTW
* Refactor to simplify setInterval logic
This commit does a refactor to move the logic for polling for status to the logic file. In doing this I realized that we were intializing sources in the SourcesView, when we are actually already initializing sources in the components that use this, which are OrganizationSources and PrivateSources, the top-level containers.
Because of this, I was able to remove the useEffect entireley, as the flash messages are cleared between page transitions in Kibana and the initialization of the sources ahppens in the containers.
* Add tests for SourcesView
* Fix type issue
* [Feedback] Move generateEnginePath to its own standalone helper
- instead of living inside EngineLogic.values
- I forgot Kea lets us do this now!
* Update all components using generateEngineRouter to import helper directly
* Add a generatePath engineName helper to EngineLogic
* Create mockEngineValues reusable mock
* Update routes + EngineNav & EngineRouter to include ENGINE_PATH in all urls
- routes: remove get*Route fns in here as all routes should prefer to use generatePath from EngineLogic moving forward
- EngineRouter - add missing canViewEngineDocuments checks
- Engine tests - import base mock values + update tests to point directly at files to work around the auto mock
* Update AnalyticsRouter to use new routes+generatePath
* Update DocumentDetailLogic to use new generatePath
+ Misc cleanup:
- organize imports by shared > AS specific > docs specific
- move delete-specific const's to directly before they're used, since they're only used in one place
- deconstruct KibanaLogic.values
* Update all components using getEngineRoute to use new generatePath
+ misc import order cleanup - prefer shared > specific groupings
* [PR feedback] Change components that override the engineName param to just use default generatePath
* [PR feedback] Rename instances of EngineLogic's generatePath to generateEnginePath
* Add full source mocks
The overview page recieves heavily annotated source data for display. This extends the existing mocks
* Refactor for easier readability
Uses optional chaining. Hide whitespace changes for easier reviewing of this commit
* Remove conditionals
The false case will never be true here because the line above only renders when there is a summary. Around line 109:
```
{!!summary &&
```
* Refactor GroupsSummary to variable
It was challenging to test the null in the original implementation so I refactored to cloer match the way we do this in other places by making the conditional rendering inline, rather than `null` in a function.
* Remove unused const
* Add overview test-subj attrs
* Add overview unit tests
* Add tests for SourceAdded
* Move meta to shared mock
* Add tests for SourceContent
* Add tests for SourceInfoCard
* Move redirect logic from component to logic file
We had this weird callback passing to trigger a redirect and we are already redirecting in the logic file for other things so I simplified this to have the logic file do the redirecting and not have to pass the callback around, which is hard to test and unnecessary complexity.
Also using the KibanaLogic navigateToUrl instead of history.push
# Conflicts:
# x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/source_logic.ts
* Add tests for SourceSettings
* Add tests for SourceSubNav
* I am the typo king
🤴🏼Prove me wrong.
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Fix createRequest typing to correctly report errors if incorrect args are passed
+ simplify out generic which was causing problems w/ checking - I'd rather check for unnecessary args than hasValidData, which we're not using much anymore
* Update WS settings routes
* Update WS groups routes
* Update WS sources routes
When something causes an exception in `TaskRunner.markTaskAsRunning()` its execution fails, but this happens before we update the SO, which means that this failure does not count towards the `attempts` on the task. Task Manager will continue to try running this task for ever.
This PR increments the `attempts` when a failure occurs during `TaskRunner.markTaskAsRunning()` to ensure such a task doesn't continue to run to infinity.
Note that this fix will not affect `scheduled` tasks, as they are designed to _ignore_ their `attempts` and run for ever. In such a case this task will continue to consume Task Manager resources until canceled, but these failures will be logged and could be identified when needed.
Cleanup work
1. Replaced naive initialisation of `last_polling_delay`
2. Changes values in `delayOnClaimConflicts` unit tests to make the values less confusing (it was easy to misunderstand the worker count for being the percentage of workers
3. Added comment explaining the usage of modulo
* Unskip "Observer location" test block.
* Commit temp "describe.only" to make flaky test runner go faster.
* Add optional chain for some potentially-null props.
* Make overview filters type partial.
* Repair broken types.
* Remove only call from test.
* Add unit tests and mark areas for improvement in \`FilterGroup\` component.
* Add aria-label translations and new labels.
* Refactor existing tests and add tests for new labels.
* Fix bug in event handler and update tests.
* Delete a comment.
* Delete a comment.
* Add some line breaks to help readability.
* Add additional tests, fix a bug.
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
At times we find the driver controlling the ComboBox in our UI tests can select the wrong item, this ensures we always select the correct index in the Connector tests.
* adding comparision select option
* adding time comparison field on some pages
* removing unused files
* fixing unit test
* adding unit tests
* enabling comparison for more than 8 days
* removing tooltip
* refactoring search bar
* moving useBreakPoint to common hooks folder, removing useShouldUSeMobileLayout hook
* addressing PR comments
* addressing PR comments
* addressing PR comments
* addressing PR comments
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
- Fixes the transform preview header to display the heading text in any case and the copy-to-clipboard button for latest configurations (the copy-to-clipboard option for pivot is displayed within the form).
- Fix to avoid listing all fields for the sort option for latest configuration and only show date fields
- Fixes ambiguous form field labels
* Add tests for Schema components
* Convert components to use clearFlashMessages helper
* Remove unused action types
These aren’t actually used anymore
* Fix type
This is actually a string from the server
* Move mock to shared mocks
* Add tests for logic file
* Fix App Search tests
Server actually sends back a string for `activeReindexJobId`
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Add encodePathParams helper to EnterpriseSearchRequestHandler
This helper accomplishes two things:
- Fixes 404s from the Enterprise Search server for user-generated IDs with special characters (e.g. ? char)
- Allows us to simplify some of our createRequest calls - no longer will we have to grab request.params to create paths, this helper will do so for us
* Update AS document route to use new helper
- This was the primary view/API I was testing to fix this bug
* Update remaining AS routes to use new helper
- shorter, saves us a few lines
+ remove unnecessary payload: params that doesn't actually validate params
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* A good chunk of server-side ES changes
* CCR files
* More areas where we just pass down the source to the client
* Some more
* Fix tests
* Fix tests and types
* initial commit
* adapt client-side signatures
* more type fixes
* adapt api IT asserts
* fix some unit tests
* fix more test usages
* fix integration tests
* fix FT test assertions
* fix FT test assertions
* add FTR API integ test suite
* create the plugin_api_integration test suite
* adapt and fix flyout tests
* update documentation
* update generated doc
* add unit tests for `executeImportHooks`
* wire resolve_import_errors and add unit tests
* move hooks registration to SO type API
* update generated doc
* design integration
* update generated doc
* Add FTR tests for import warnings
* deletes plugins api integ tests
* self review
* move onImport to management definition
* update license header
* rename actionUrl to actionPath
This PR adds the following:
1. We now validate the interval passed to `timeout` when a task type definition is registered.
2. replaces usage of `Joi` with `schema-type`
When a task expires it continues to reside in the queue until `TaskPool.cancelExpiredTasks()` is called. We call this in `TaskPool.run()`, but `run` won't get called if there is no capacity, as we gate the poller on `TaskPool.availableWorkers()` and that means that if you have as many expired tasks as you have workers - your poller will continually restart but the queue will remain full and that Task Manager is then in capable of taking on any more work. This is what caused `[Task Poller Monitor]: Observable Monitor: Hung Observable...`
* Instances latency distribution chart
Create an instances row component that does the data fetching for the
instances table and the distribution chart. Use the same data for both the chart and the table.
Tooltips and selection are disabled on the chart.
* import fix
* rename ServiceOverviewInstancesRow to ServiceOverviewInstancesChartAndTable
* Updates based on feedback
* remove stuff
* hasdata
* chore(NA): create new x-pack cigroups and rebalancing them all
* chore(NA): better cigroups balancing
* chore(NA): push rollup tests back into ciGroup1
* chore(NA): move some functional ml tests from cigroup3 into cigroup13
* chore(NA): move some more tests into ciGroup13
* chore(NA): use a single top level describe at x-pack/test/functional/apps/ml
* chore(NA): move settings into ciGroup13
* temporary test for es snapshots env
* Revert "temporary test for es snapshots env"
This reverts commit 789ebe7b9c.
* docs(NA): add missing documentation on the function tests describe split
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* add custom runner and config for load testing
* add full maven command
* add jenkins script
* run tests against build
* run kibana with no-base-path flag
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* usgin esarchive to load e2e
* using esarchive to load e2e
* using esarchive to load e2e
* using esarchive to load e2e
* using esarchive to load e2e
* chaning archiver script to copy file to both e2e and api tests
* chaning archiver script to copy file to both e2e and api tests
* removing task folder
* running e2e through script
* using cy.clock to set now
* adding basic test
* adding cypress run script
* adding cypress run script
* fixing some stuff
* excluding new e2e dir
* adding new project for new e2e dir
* adding new project for new e2e dir
* unformatting file
* adding unit tests
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
## Summary
Temporarily addresses https://github.com/elastic/kibana/issues/88450
A follow PR will address full fix.
### Issue
Exceptions table search not functioning as expected.
### Diagnostic
The exception list SO properties are mapped as keywords, meaning ES does not tokenize them. Need to add a `text` mapping for fields we want to search on in order for search to work as expected. Expectations for exceptions table search being:
- I can search `Endpoint Security` and get results that match `Endpoint` or `Security`
- I can search `"Endpoint Security"` and it will conduct an exact match search
It's too late in the release cycle for mappings updates - a follow up PR will properly fix search.
### Without Search
<img width="1766" alt="Screen Shot 2021-01-19 at 7 52 01 PM" src="https://user-images.githubusercontent.com/10927944/105112279-aed64300-5a90-11eb-95fc-1922eb2055e9.png">
### Checklist
- [ ] [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
* Add AnalyticsUnavailable component
* Add AnalyticsHeader component
+ update AnalyticsLogic to store allTags prop passed by API
+ convertTagsToSelectOptions util helper
* Add AnalyticsLayout that all subroutes will utilize
- Handles shared concerns of:
- Loading state & unavailable state
- Flash messages & log retention callout
- Reusing the header component
- Fetching data
- Reloading data based on filter updates
* Add very basic subroute views that utilize AnalyticsLayout
* Update QueryDetail pages to set breadcrumbs
* Fix QueryDetail breadcrumbs to not 404 on the 'Query' crumb
Redirect to the /analytics overview since we don't actually have a /query_details overview
* [PR feedback] Enforce date range defaults on the client side
- instead of using coincidence to sync our client side default range & server default range
- tags remain ''/undefined as default
* [PR feedback] Add explicit query vs analytics view prop
- to help devs more quickly distinguish at a glance whether a view will fetch analytics data or query data
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Making kibanaFeatures an optional parameter and catching error on plugin start
* Gracefully handle 404 errors when no access to features endpoint
* Adding functional test
* Only render location status badge when there are actually locations to display.
* Add aria-label to describe location section.
* Update test data to reflect real-world data better. Refactor enzyme tests.
* Refactor component test.
* Fix test names.
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
## Summary
Addresses issue issue 87110
**Issue**
When prepackaged rules were created during the Endpoint Security enrollment flow, the endpoint exceptions list was failing to be created. As a result, when a user navigated to the `Endpoint Security` rule to add an exception it would display errors and not allow a user to add exceptions.
* Await promises to ensure promise rejection does not crash kibana
* Fix test
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* partial failure if unmapped timestamp override field or unmapped @timestamp field
* fixes unit tests
* fix threat match rules integration tests
* unskip integration test for partial failure when not all indices have timestamp override field
* replace ts-expect-error in test with a partial type
* use destructured param and != null for ternary
* fix typo in utils.test.ts
* remove unnecessary optional chaining
* replace logger.debug with logger.error and update test case for threat match integration test to search auditbeat-* instead of empty index causing it to search wrong indicies like .kibana, etc..
* adds unit test to write a success when all shard failure messages are no mapping found for a timestamp field, moves privilege check and timestamp field cap check into utility functions and updates code to be more functional
* need to write an error, not a partial failure, if the rule cannot read ANY of the indices provided
* use isEmpty for checking timestamp override field param and remove let from hasReadIndexPrivileges util function
* replace references to helpers/toPromise | toError to use common/fp_utils, remove unnecessary flow wrappers, no need for checking if timestampField is null since it is typed as string and we do the checking beforehand, add a const bool to clean up logic for getting timestampFieldOverride
* replace usage of flow with pipe to make arguments explicit
* set width
* cleanup
* add show scale toggle in map settings
* tslint
* remove unmapped css comment
* move scale for full screen mode so they do not collide
* change default and add unit test for scale_control
* simplify scale
* add tilda to label
* update jest expects
* eslint
* eslint
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Update older tests mocking useValues to setMockValues
* Update older logic tests to use newer LogicMounter helper
- NOTE: shared logic files are still using resetContext however, in order to not accidentally override/mock kea + since they should be testing their own mount helpers
* Merge/DRY kea.mock helpers into a single import
* Remove unnecessary kea.mock file imports
- the automock already happens when you import something from the kea.mock file
- in some cases in WS the mock just wasn't needed
* Newline linting
- Do I need a hobby? yes
- Is this my hobby? ...maybe
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
## Summary
A user received a `407` response when using a `registryProxyUrl` format like `http://user:pass@host:port`
I believe the issue is we're not including the [`auth` property as described in this issue](https://github.com/TooTallNate/node-https-proxy-agent/issues/12#issuecomment-216098644).
Add tests to ensure it only adds `auth` if username & password are given.
### 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
```
getProxyAgentOptions
auth property
present & correct if given username and password
✓ proxy url is http (1 ms)
✓ proxy url is https
missing if not given username and password
✓ proxy url is http
✓ proxy url is https
```